:root {
  color-scheme: light;
  --bg: #f2f4f1;
  --surface: #ffffff;
  --surface-strong: #111111;
  --border: #d5dbd2;
  --text: #171b17;
  --muted: #5a655b;
  --accent: #c4572f;
  --accent-strong: #9f3d1d;
  --green: #2f6e57;
  --gold: #b28a2c;
  --shadow: 0 20px 60px rgba(17, 23, 19, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

.masthead {
  position: relative;
  min-height: 420px;
  background: #131313;
  color: #f6f7f3;
  overflow: hidden;
}

.masthead__image {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.88) 0%, rgba(8, 8, 8, 0.7) 44%, rgba(8, 8, 8, 0.3) 100%),
    url("./assets/nespresso-store.jpg") center/cover no-repeat;
}

.masthead__content {
  position: relative;
  z-index: 1;
  padding: 48px 0 40px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: #d0b169;
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 2.6rem;
  line-height: 1.08;
}

.lead {
  max-width: 760px;
  margin: 14px 0 28px;
  color: rgba(246, 247, 243, 0.85);
  font-size: 1.05rem;
}

.serial-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
  color: inherit;
}

.field span {
  font-size: 0.92rem;
  font-weight: 600;
}

.field input {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #f6f7f3;
}

.field input::placeholder {
  color: rgba(246, 247, 243, 0.56);
}

.field--inline input {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
}

.button--primary {
  background: var(--accent);
  color: #fff;
}

.button--primary:hover {
  background: var(--accent-strong);
}

.button--secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.button--ghost {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.scanner-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.44);
  backdrop-filter: blur(8px);
}

.scanner-panel__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.scanner-panel__eyebrow,
.scanner-panel__status {
  margin: 0;
}

.scanner-panel__eyebrow {
  color: #d0b169;
  font-size: 0.86rem;
  font-weight: 700;
}

.scanner-panel__status {
  margin-top: 6px;
  color: rgba(246, 247, 243, 0.82);
}

.scanner-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scanner-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.scanner-stage__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-stage__frame {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(84%, 420px);
  aspect-ratio: 2.4 / 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.example-strip,
.stats-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.chip,
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f6f7f3;
}

.chip {
  background: rgba(255, 255, 255, 0.14);
}

.chip button {
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
}

.band {
  padding: 32px 0 48px;
}

.band--results {
  background: linear-gradient(180deg, #f2f4f1 0%, #eef2ea 100%);
}

.band--catalog {
  background: #ffffff;
  border-top: 1px solid var(--border);
}

.status-banner {
  min-height: 64px;
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-banner[data-state="ok"] {
  border-color: rgba(47, 110, 87, 0.28);
  background: rgba(47, 110, 87, 0.08);
}

.status-banner[data-state="warn"] {
  border-color: rgba(178, 138, 44, 0.28);
  background: rgba(178, 138, 44, 0.08);
}

.status-banner[data-state="error"] {
  border-color: rgba(196, 87, 47, 0.28);
  background: rgba(196, 87, 47, 0.08);
}

.summary-grid,
.segment-grid,
.type-list {
  display: grid;
  gap: 14px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
}

.segment-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 28px;
}

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

.tile,
.segment,
.type-card {
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tile__label,
.segment__label,
.type-card__eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.tile__value,
.segment__value,
.type-card h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.3;
}

.tile__meta,
.segment__meta,
.type-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin: 0 0 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.48rem;
}

.section-copy {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.type-card ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.catalog-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.tab[aria-selected="true"] {
  border-color: transparent;
  background: var(--surface-strong);
  color: #fff;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.catalog-table th,
.catalog-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

.catalog-table th {
  color: var(--muted);
  font-weight: 700;
  background: #f7f9f6;
}

.catalog-table tr:last-child td {
  border-bottom: 0;
}

.footer {
  padding: 20px 0 32px;
  background: #ffffff;
}

.footer__content {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state {
  padding: 20px 16px;
  color: var(--muted);
}

.status-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .catalog-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .masthead {
    min-height: 0;
  }

  .masthead__content {
    padding: 36px 0 28px;
  }

  h1 {
    font-size: 2rem;
  }

  .serial-form,
  .section-head,
  .summary-grid,
  .segment-grid,
  .type-list {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
  }

  .actions {
    width: 100%;
  }

  .scanner-panel__head {
    flex-direction: column;
  }

  .scanner-panel__actions {
    width: 100%;
  }

  .button {
    flex: 1 1 0;
  }
}
