:root {
  --bg: #f5efe4;
  --panel: rgba(255, 255, 255, 0.84);
  --ink: #162033;
  --muted: #5f6878;
  --line: rgba(22, 32, 51, 0.12);
  --accent: #1f6f63;
  --accent-strong: #14584f;
  --shadow: 0 24px 70px rgba(22, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 99, 0.17), transparent 28%),
    radial-gradient(circle at bottom right, rgba(196, 122, 30, 0.12), transparent 22%),
    linear-gradient(145deg, #f9f6ef, #ece5d9 54%, #f4eee4);
}

.traffic-counter {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: min(220px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 45px rgba(22, 32, 51, 0.14);
}

.traffic-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.traffic-subtitle {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.traffic-section + .traffic-section {
  margin-top: 10px;
}

.traffic-divider {
  height: 1px;
  margin: 10px 0;
  background: var(--line);
}

.traffic-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  font-size: 0.92rem;
}

.traffic-grid span {
  color: var(--muted);
}

.traffic-grid strong {
  color: var(--ink);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

h1, h2, label, button {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 840px;
  margin-top: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

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

label {
  font-weight: 600;
}

input,
select,
button {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  font: inherit;
}

input,
select {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

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

.checkbox input {
  width: 18px;
  height: 18px;
}

.lookup-row,
.actions-row {
  display: grid;
  gap: 12px;
}

.lookup-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.actions-row {
  grid-template-columns: repeat(3, minmax(0, 220px));
}

button {
  padding: 14px 20px;
  border: none;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
}

.secondary-button {
  background: linear-gradient(135deg, #2c5067, #233f52);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

.output-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 14px;
}

#status-text,
.meta,
.field-note {
  color: var(--muted);
}

.field-note {
  margin: -4px 0 0;
  line-height: 1.5;
}

.preview.empty {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.summary-bar span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(31, 111, 99, 0.08);
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.82);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  position: sticky;
  top: 0;
  background: #f6f3ed;
}

code {
  padding: 0.12rem 0.36rem;
  border-radius: 0.4rem;
  background: rgba(22, 32, 51, 0.08);
}

@media (max-width: 820px) {
  .lookup-row,
  .actions-row,
  .output-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .traffic-counter {
    right: 12px;
    bottom: 12px;
  }
}
