:root {
  --bg: #f3f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #68758b;
  --line: #dde5ef;
  --primary: #153f73;
  --primary-dark: #0d2b50;
  --accent: #1e72c7;
  --success: #31b66b;
  --success-soft: #eaf8f0;
  --warning: #f5b400;
  --shadow: 0 20px 60px rgba(20, 63, 115, 0.11);
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(220, 228, 239, 0.9);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.header-note {
  color: var(--muted);
  font-size: 14px;
}

.hero {
  padding: 52px 0 42px;
  background:
    radial-gradient(circle at top right, rgba(30, 114, 199, 0.15), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #eef5fc 100%);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5.1vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  color: var(--primary-dark);
}

.lead {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.search-card,
.state-card,
.card-shell {
  background: var(--card);
  border: 1px solid rgba(220, 228, 239, 0.96);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-card { padding: 28px; }

.tracking-form label {
  display: block;
  margin-bottom: 12px;
  color: var(--primary-dark);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#trackingInput { text-transform: uppercase; }

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 114, 199, 0.12);
}

button {
  min-height: 54px;
  padding: 0 26px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.help-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.result-section { padding: 32px 0 72px; }

.state-card {
  padding: 34px;
  text-align: center;
}

.state-card h2 {
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.state-card p {
  margin: 0;
  color: var(--muted);
}

.loader {
  width: 34px;
  height: 34px;
  margin: 0 auto 16px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.results-summary { margin-bottom: 14px; }

.multi-result-note {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eaf3fd;
  color: var(--primary);
  font-weight: 700;
}

.schedule-list,
.shipment-result {
  display: grid;
  gap: 16px;
}

.shipment-result + .shipment-result {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.result-overview {
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1.15fr 1.85fr;
  gap: 24px;
  align-items: center;
}

.found-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.found-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 23px;
  font-weight: 700;
  flex: 0 0 auto;
}

.card-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.found-copy h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 27px;
  letter-spacing: -0.03em;
}

.overview-route {
  margin-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.overview-route strong { color: var(--primary-dark); }

.meta-separator {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.overview-data {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.overview-item {
  min-width: 0;
}

.overview-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.overview-item strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-dark);
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex !important;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #edf5fd;
  color: var(--primary) !important;
  font-size: 12px !important;
}

.route-card {
  min-height: 170px;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: minmax(145px, 0.8fr) minmax(300px, 2fr) minmax(145px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.route-port {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.route-port strong {
  color: var(--primary-dark);
  font-size: 19px;
}

.route-port span {
  color: var(--muted);
  font-size: 13px;
}

.route-port time {
  color: var(--text);
  font-weight: 700;
}

.route-port-end { text-align: right; }

.route-path {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.route-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}

.route-line {
  height: 1px;
  border-top: 1px dashed #7e96b5;
}

.route-vessel {
  min-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  text-align: center;
}

.route-vessel strong {
  color: var(--primary-dark);
  font-size: 14px;
  line-height: 1.25;
}

.ship-icon {
  width: 46px;
  height: 46px;
}

.key-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.key-fact {
  min-height: 104px;
  padding: 18px;
}

.key-fact span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.key-fact strong {
  display: block;
  margin-top: 10px;
  color: var(--primary-dark);
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.containers-block {
  padding: 0;
  overflow: hidden;
}

.containers-block summary {
  min-height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--primary-dark);
  font-weight: 700;
}

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

.containers-block summary strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eaf3fd;
  color: var(--primary);
  font-size: 13px;
}

.containers-toggle {
  margin-left: auto;
  color: var(--muted);
  font-size: 20px;
  transition: transform 0.18s ease;
}

.containers-block[open] .containers-toggle { transform: rotate(180deg); }

.containers-content {
  padding: 0 24px 24px;
  border-top: 1px solid var(--line);
}

.containers-toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.containers-toolbar h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 19px;
}

.container-filter {
  width: min(270px, 100%);
}

.container-filter input {
  min-height: 42px;
  padding: 0 13px;
  font-size: 14px;
  text-transform: uppercase;
}

.containers-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.container-chip {
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e2ed;
  border-radius: 11px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  text-align: center;
}

.container-empty,
.muted-text {
  color: var(--muted);
}

.timeline-card {
  padding: 24px 22px 28px;
  overflow: hidden;
}

.timeline-card h3 {
  margin: 0 0 24px;
  color: var(--primary-dark);
  font-size: 20px;
}

.timeline-scroll {
  overflow-x: auto;
  padding: 4px 2px 8px;
}

.timeline {
  --timeline-progress: 0%;
  position: relative;
  min-width: 860px;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  list-style: none;
}

.timeline::before,
.timeline::after {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(100% / 14);
  height: 2px;
}

.timeline::before {
  right: calc(100% / 14);
  background: #cfd8e4;
}

.timeline::after {
  width: var(--timeline-progress);
  background: var(--success);
}

.timeline-step {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.timeline-node {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 2px solid #cfd8e4;
  border-radius: 50%;
  background: #fff;
  color: #9aa7b9;
  font-weight: 700;
}

.timeline-step.completed .timeline-node {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.timeline-step.current .timeline-node {
  width: 50px;
  height: 50px;
  margin-top: -4px;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(21, 63, 115, 0.28);
}

.timeline-step strong {
  margin-top: 10px;
  color: var(--primary-dark);
  font-size: 12px;
  line-height: 1.3;
}

.timeline-step time {
  min-height: 31px;
  margin-top: 5px;
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.timeline-step time small {
  margin-top: 2px;
  color: var(--accent);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer p {
  margin: 0;
  padding: 26px 0;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1060px) {
  .result-overview { grid-template-columns: 1fr; }
  .key-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .containers-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .route-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .route-port-end { text-align: center; }
  .route-path { order: 2; }
  .route-port-start { order: 1; }
  .route-port-end { order: 3; }
  .key-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .containers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { width: min(100% - 24px, 1120px); }
  .hero { padding: 40px 0 34px; }
  .header-inner { min-height: 60px; }
  .brand-title { font-size: 14px; }
  .brand-subtitle { font-size: 11px; }
  .header-note { display: none; }
  .form-row { grid-template-columns: 1fr; }
  button { width: 100%; }
  .result-overview { padding: 20px; }
  .overview-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-card { padding: 24px 18px; }
  .route-path { grid-template-columns: auto 1fr auto 1fr auto; }
  .key-facts { grid-template-columns: 1fr; }
  .containers-block summary { padding: 0 18px; }
  .containers-content { padding: 0 18px 18px; }
  .containers-toolbar {
    padding: 14px 0;
    align-items: stretch;
    flex-direction: column;
  }
  .container-filter { width: 100%; }
  .containers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .overview-data { grid-template-columns: 1fr; }
  .containers-grid { grid-template-columns: 1fr; }
  .route-path { gap: 4px; }
  .ship-icon { width: 38px; height: 38px; }
}
