:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f5f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.hidden {
  display: none;
}

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

.scanner-card,
.history-card {
  background: #ffffff;
  border: 1px solid #dfe4ec;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
}

.scanner-card {
  padding: 28px;
}

.heading-row,
.history-topline,
.input-row,
.status-indicator {
  display: flex;
  align-items: center;
}

.heading-row,
.history-topline {
  justify-content: space-between;
  gap: 16px;
}

.status-indicator {
  gap: 10px;
  color: #5e6b80;
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 5px;
  color: #61708a;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
}

h2 {
  margin-bottom: 18px;
  font-size: 1.25rem;
}

.status-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 999px;
  background: #aab4c5;
  box-shadow: 0 0 0 5px rgba(170, 180, 197, 0.18);
}

.status-submitting {
  background: #b87908;
  box-shadow: 0 0 0 5px rgba(184, 121, 8, 0.18);
}

.status-success {
  background: #16834a;
  box-shadow: 0 0 0 5px rgba(22, 131, 74, 0.18);
}

.status-error {
  background: #c03737;
  box-shadow: 0 0 0 5px rgba(192, 55, 55, 0.18);
}

.selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.selector-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label > span,
.scan-form > label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

select,
input {
  width: 100%;
  border: 1px solid #bdc6d4;
  border-radius: 10px;
  background: #ffffff;
  color: #172033;
  outline: none;
}

select {
  min-height: 48px;
  padding: 0 14px;
}

input {
  min-height: 58px;
  padding: 0 16px;
  font-size: 1.15rem;
}

select:focus,
input:focus {
  border-color: #2853a3;
  box-shadow: 0 0 0 4px rgba(40, 83, 163, 0.12);
}

.scan-form {
  margin-top: 24px;
}

.input-row {
  gap: 12px;
}

button {
  min-height: 58px;
  padding: 0 24px;
  border: 0;
  border-radius: 10px;
  background: #172e57;
  color: #ffffff;
  font-weight: 800;
}

button:hover:not(:disabled) {
  background: #234177;
}

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

.secondary-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #b8c2d0;
  background: #ffffff;
  color: #243651;
}

.secondary-button:hover:not(:disabled) {
  background: #f3f6fa;
}

.scan-form p {
  margin: 8px 0 0;
  color: #66738a;
  font-size: 0.9rem;
}

.queue-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.summary-stat {
  padding: 14px 10px;
  border: 1px solid #e0e5ec;
  border-radius: 10px;
  background: #f8fafc;
  text-align: center;
}

.summary-stat strong,
.summary-stat span {
  display: block;
}

.summary-stat strong {
  font-size: 1.45rem;
}

.summary-stat span {
  margin-top: 3px;
  color: #69758a;
  font-size: 0.78rem;
  font-weight: 750;
}

.summary-failed strong {
  color: #ae2e2e;
}

.result-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid;
}

.result-success {
  border-color: #93d3af;
  background: #f0fbf5;
}

.result-error {
  border-color: #e2a6a6;
  background: #fff4f4;
}

pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}

.history-card {
  margin-top: 24px;
  padding: 24px;
}

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

.history-item {
  padding: 16px;
  border: 1px solid #e1e6ed;
  border-radius: 12px;
}

.history-processing {
  border-color: #dfc487;
}

.history-failed {
  border-color: #e2a6a6;
  background: #fffafa;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  color: #66738a;
  font-size: 0.85rem;
}

.history-response {
  margin-top: 9px;
  color: #3d4a5e;
}

.status-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge-success {
  background: #e6f6ed;
  color: #13733f;
}

.badge-processing {
  background: #fff3d6;
  color: #8a5b05;
}

.badge-queued {
  background: #eef2f7;
  color: #546177;
}

.badge-failed {
  background: #fdeaea;
  color: #ae2e2e;
}

.history-actions {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 980px);
    padding-top: 18px;
  }

  .scanner-card,
  .history-card {
    padding: 20px;
    border-radius: 12px;
  }

  .selector-grid {
    grid-template-columns: 1fr;
  }

  .input-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .heading-row {
    align-items: flex-start;
  }
}


.tracker-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tracker-nav-link {
  padding: 9px 14px;
  border: 1px solid #d3dae5;
  border-radius: 999px;
  background: #ffffff;
  color: #4d5c74;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.tracker-nav-link:hover {
  background: #f8fafc;
}

.tracker-nav-link.active {
  border-color: #172e57;
  background: #172e57;
  color: #ffffff;
}

.landing-shell {
  width: min(760px, calc(100% - 32px));
  padding-top: 72px;
}

.landing-card {
  padding: 34px;
}

.landing-intro {
  margin: 12px 0 26px;
  color: #66738a;
}

.tracker-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tracker-link-card {
  display: block;
  min-height: 150px;
  padding: 22px;
  border: 1px solid #d7dee8;
  border-radius: 14px;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
}

.tracker-link-card:hover {
  border-color: #9cadc4;
  background: #f2f6fb;
}

.tracker-link-card strong,
.tracker-link-card span {
  display: block;
}

.tracker-link-card strong {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.tracker-link-card span {
  color: #66738a;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .selector-grid-three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tracker-links {
    grid-template-columns: 1fr;
  }

  .tracker-nav {
    overflow-x: auto;
  }
}


.scan-type-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scan-type-control select {
  min-width: 0;
  flex: 1 1 auto;
}

.scan-type-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd4e1;
  border-radius: 12px;
  background: #f4f7fb;
  color: #324763;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.scan-type-icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-type-icon[data-scan-type="Start"] {
  border-color: #9ab4d7;
  background: #edf4fd;
  color: #24558d;
}

.scan-type-icon[data-scan-type="Cold Crash"] {
  border-color: #9ccbd5;
  background: #edfafd;
  color: #167184;
}

.scan-type-icon[data-scan-type="Ready For Bottling"] {
  border-color: #9fd0b5;
  background: #effaf4;
  color: #1b7648;
}

.scan-type-icon[data-scan-type="Bottled"] {
  border-color: #c7b5dc;
  background: #f7f1fc;
  color: #6b438d;
}


.product-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-control select {
  min-width: 0;
  flex: 1 1 auto;
}

.product-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd4e1;
  border-radius: 12px;
  background: #f4f7fb;
  color: #324763;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.product-icon svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-icon[data-product="Beer"] {
  border-color: #e2c27b;
  background: #fff7e7;
  color: #9a6300;
}

.product-icon[data-product="Cider"] {
  border-color: #b9cf7e;
  background: #f6faea;
  color: #5f7f13;
}

.product-icon[data-product="Wine"] {
  border-color: #d4a6bc;
  background: #fdf2f7;
  color: #8b2958;
}

.product-icon[data-product="Carbonated Wine"] {
  border-color: #d2b1e8;
  background: #faf3ff;
  color: #7a42a8;
}

.product-icon[data-product="Seltzer"] {
  border-color: #9ccbd5;
  background: #edfafd;
  color: #167184;
}
