:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #677181;
  --line: #d8dde5;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --accent: #3f7d74;
  --accent-strong: #2f625b;
  --navy: #15222c;
  --sea: #4f8f84;
  --mist: #eef5f4;
  --danger: #a62a2a;
  --warn-bg: #fff6d8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.delivery-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(21, 34, 44, 0.96), rgba(63, 125, 116, 0.88)),
    url("https://images.unsplash.com/photo-1494412574643-ff11b0a5c1c3?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

.delivery-shell {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.delivery-hero {
  color: #fff;
  padding: 8px 0 34px;
}

.delivery-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 54px;
}

.delivery-logo {
  width: 118px;
  height: auto;
  display: block;
}

.delivery-badge {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #eaf4f2;
  font-size: 13px;
  font-weight: 800;
}

.delivery-hero-copy {
  max-width: 760px;
}

.delivery-hero .eyebrow {
  color: #bce4dc;
}

.delivery-hero h1 {
  color: #fff;
  font-size: clamp(34px, 6vw, 64px);
  max-width: 920px;
}

.delivery-subtitle {
  max-width: 680px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.55;
}

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

.delivery-card,
.delivery-details {
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.delivery-card {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.delivery-card.primary {
  border-top: 5px solid var(--sea);
}

.delivery-card h2,
.delivery-details h2 {
  color: var(--navy);
  font-size: 22px;
}

.delivery-card p {
  color: #53616c;
  line-height: 1.5;
}

.step {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.subtle-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.subtle-link:hover {
  text-decoration: underline;
}

.delivery-details {
  margin-top: 18px;
  padding: 22px 24px;
}

.delivery-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.delivery-meta span {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--sea);
  padding-left: 10px;
  color: #4d5964;
}

.delivery-meta strong {
  color: var(--navy);
  font-size: 12px;
  text-transform: uppercase;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf1f5;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: white;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 10px 14px;
  color: white;
  background: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

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

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

button:disabled,
button:disabled:hover {
  background: #cbd3dc;
  color: #6d7784;
  cursor: not-allowed;
}

button.secondary {
  color: var(--ink);
  background: #e7ebf0;
}

button.secondary:hover {
  background: #d8dee6;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: #3d4652;
  font-size: 13px;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto 60px;
}

.topbar,
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.viewer-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.login {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 8px;
  align-items: center;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.compact {
  gap: 10px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(24, 32, 42, 0.06);
  margin-bottom: 16px;
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.check input {
  width: 18px;
  min-height: 18px;
}

.section-title,
.viewer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cards {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.link-row input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e9f3f2;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.warning {
  padding: 12px 14px;
  border: 1px solid #e6c855;
  border-radius: 8px;
  background: var(--warn-bg);
  color: #665000;
  margin-bottom: 16px;
}

.audit {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 360px;
  overflow: auto;
}

.audit-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.viewer-page {
  background: #dfe5ec;
}

.viewer-status {
  width: min(760px, calc(100vw - 32px));
  margin: 40px auto;
  padding: 16px;
  border-radius: 8px;
  background: white;
  color: var(--muted);
  text-align: center;
}

.pdf-viewer {
  display: grid;
  justify-content: center;
  gap: 18px;
  padding: 24px 12px 60px;
}

.page-shell {
  position: relative;
  overflow: hidden;
  background: white;
  box-shadow: 0 8px 30px rgba(24, 32, 42, 0.24);
}

.page-shell canvas {
  display: block;
  width: min(100vw - 24px, 960px);
  height: auto;
}

.watermark {
  position: absolute;
  inset: -35%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  transform: rotate(-28deg);
  pointer-events: none;
  opacity: 0.14;
}

.watermark span {
  color: #1f2937;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 780px) {
  .topbar,
  .viewer-bar,
  .card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.two,
  .login,
  .link-row {
    grid-template-columns: 1fr;
  }

  .viewer-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .delivery-grid,
  .delivery-meta {
    grid-template-columns: 1fr;
  }

  .delivery-nav {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 34px;
  }
}

@media print {
  body::before {
    content: "Printing is controlled by the protected viewer.";
    display: block;
    padding: 24px;
    font-size: 18px;
    font-weight: 800;
  }

  .viewer-bar,
  .pdf-viewer,
  .viewer-status {
    display: none !important;
  }

  body.can-print::before {
    display: none;
  }

  body.can-print .viewer-bar,
  body.can-print .viewer-status {
    display: none !important;
  }

  body.can-print .pdf-viewer {
    display: block !important;
    padding: 0;
  }

  body.can-print .page-shell {
    break-after: page;
    box-shadow: none;
  }

  body.can-print .page-shell canvas {
    width: 100%;
  }

  body.can-print .watermark {
    display: none !important;
  }
}
