@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
}

:root {
  --ink: #eaf1fb;
  --ink-soft: #c6d2e8;
  --muted: #91a3bf;
  --paper: rgba(255, 255, 255, 0.055);
  --paper-solid: #0d1526;
  --canvas: #060a15;
  --canvas-warm: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --brand: #1d4ed8;
  --brand-deep: #67d2fa;
  --brand-soft: rgba(29, 78, 216, 0.2);
  --brand-pale: rgba(34, 184, 240, 0.075);
  --accent: #22b8f0;
  --accent-soft: rgba(34, 184, 240, 0.12);
  --danger: #ff8b91;
  --danger-soft: rgba(239, 68, 68, 0.13);
  --warning: #f8c96b;
  --warning-soft: rgba(245, 158, 11, 0.13);
  --success: #62dfa7;
  --success-soft: rgba(16, 185, 129, 0.13);
  --info: #78d4f7;
  --info-soft: rgba(34, 184, 240, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24), 0 12px 30px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 24px 64px rgba(0, 0, 0, 0.34);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --focus: #22b8f0;
  --header-height: 72px;
  font-family: "Manrope", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 88% 4%, rgba(34, 184, 240, 0.12), transparent 29rem),
    radial-gradient(circle at 8% 34%, rgba(29, 78, 216, 0.12), transparent 32rem),
    var(--canvas);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  font-size: 1rem;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

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

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Manrope", ui-sans-serif, sans-serif;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 18ch;
  margin-bottom: 0.7rem;
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  font-weight: 720;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.28rem, 2vw, 1.65rem);
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
}

a {
  color: var(--brand-deep);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--brand);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

.shell {
  width: min(100% - 40px, 1440px);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: white;
  background: var(--brand-deep);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid rgba(189, 203, 198, 0.8);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 26px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-logo {
  width: 108px;
  height: auto;
}

.brand-product {
  padding-left: 10px;
  color: var(--muted);
  border-left: 1px solid var(--line-strong);
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 15px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 620;
  text-decoration: none;
}

.primary-nav a::after {
  position: absolute;
  right: 15px;
  bottom: -1px;
  left: 15px;
  height: 3px;
  background: var(--brand);
  border-radius: 4px 4px 0 0;
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 150ms ease, transform 150ms ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--brand-deep);
}

.primary-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.logout-form {
  margin-left: 2px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--ink);
  border-radius: 2px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-block: 42px 100px;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.page-alert-wrap {
  padding-top: 20px;
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  padding-block: clamp(38px, 6vw, 72px) 30px;
}

.page-hero-actions {
  align-items: center;
}

.hero-copy {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
}

.eyebrow,
.step-label {
  margin-bottom: 0.4rem;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card {
  padding: clamp(20px, 3vw, 30px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2,
.section-heading p:last-child {
  margin-bottom: 0;
}

.compact-heading {
  align-items: center;
}

.section-hint,
.section-description {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-description {
  margin-bottom: 20px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 17px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 690;
  line-height: 1.1;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(13, 100, 90, 0.17);
}

.button-primary:hover:not(:disabled) {
  color: #fff;
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.button-secondary {
  color: var(--brand-deep);
  background: #fff;
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled) {
  color: var(--brand-deep);
  background: var(--brand-pale);
  border-color: var(--brand);
}

.button-quiet {
  color: var(--ink-soft);
  background: transparent;
}

.button-quiet:hover:not(:disabled) {
  color: var(--brand-deep);
  background: var(--brand-pale);
}

.button-small {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.86rem;
}

.button-wide {
  width: 100%;
}

.button-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button-secondary .button-loader,
.button-quiet .button-loader {
  border-color: rgba(13, 100, 90, 0.25);
  border-top-color: currentColor;
}

.is-loading .button-loader {
  display: inline-block;
}

.is-loading .button-label {
  opacity: 0.82;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 1.35rem;
  line-height: 1;
}

.icon-button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.danger-text {
  color: var(--danger);
}

.status-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
}

.status-pill {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 0.83rem;
  box-shadow: var(--shadow-sm);
}

.status-chip {
  padding: 4px 9px;
  font-size: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--muted);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(107, 127, 123, 0.12);
}

.status-online,
.status-printed {
  color: var(--success);
  background: var(--success-soft);
  border-color: #b9dec9;
}

.status-online .status-dot,
.status-printed .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(35, 100, 71, 0.13);
}

.status-offline,
.status-failed {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc1bd;
}

.status-offline .status-dot,
.status-failed .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(170, 52, 52, 0.12);
}

.status-queued,
.status-printing {
  color: var(--info);
  background: var(--info-soft);
  border-color: #c5dbe8;
}

.status-uncertain {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #ecd69c;
}

.status-cancelled,
.status-neutral,
.status-unknown {
  color: var(--muted);
  background: #f3f5f4;
  border-color: var(--line);
}

.alert,
.info-strip,
.warning-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.alert p,
.info-strip p,
.warning-strip p {
  margin-bottom: 0;
}

.alert-info,
.info-strip {
  color: #244e69;
  background: var(--info-soft);
  border-color: #c8dce8;
}

.alert-error {
  color: #7c2525;
  background: var(--danger-soft);
  border-color: #edc3bf;
}

.alert-warning,
.warning-strip {
  color: #6f4b08;
  background: var(--warning-soft);
  border-color: #ebd49a;
}

.alert-success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #badbc7;
}

.info-strip > span,
.warning-strip > span {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
}

.inset-strip {
  margin-top: 22px;
}

.field {
  min-width: 0;
}

.field label,
.scope-fieldset legend {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 680;
}

.label-line {
  display: flex;
  min-height: 25px;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: inset 0 1px 2px rgba(20, 44, 43, 0.025);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #91a9a2;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(22, 127, 114, 0.17);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  background: #fffafa;
  border-color: var(--danger);
}

.secondary-input {
  margin-top: 8px;
}

.help-text,
.field-error {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.field-error {
  color: var(--danger);
  font-weight: 620;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.field-meta > span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  gap: 19px 16px;
}

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

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

.span-two {
  grid-column: 1 / -1;
}

.confidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  color: var(--muted);
  background: #f1f4f2;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 740;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.confidence-high {
  color: var(--success);
  background: var(--success-soft);
  border-color: #badbc7;
}

.confidence-medium {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #ecd69c;
}

.confidence-low {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc1bd;
}

.confidence-group {
  margin-top: 2px;
}

.label-form {
  display: grid;
  gap: 22px;
}

.import-card {
  overflow: hidden;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 660;
}

.privacy-note > span {
  font-size: 0.58rem;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto minmax(230px, 0.75fr);
  align-items: stretch;
  gap: 20px;
}

.dropzone {
  position: relative;
  display: flex;
  min-height: 146px;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: var(--brand-pale);
  border: 1.5px dashed #88b7ae;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  background: #e5f4ef;
  border-color: var(--brand);
}

.dropzone.is-dragging {
  transform: scale(1.006);
}

.dropzone:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.dropzone-icon {
  position: relative;
  display: grid;
  width: 48px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  background: #fff;
  border: 1px solid #a8cbc4;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.dropzone-icon::before,
.dropzone-icon::after,
.dropzone-icon span {
  position: absolute;
  background: var(--brand);
  border-radius: 2px;
  content: "";
}

.dropzone-icon::before {
  width: 18px;
  height: 2px;
}

.dropzone-icon::after {
  width: 2px;
  height: 18px;
}

.dropzone-icon span {
  top: 11px;
  right: 9px;
  width: 10px;
  height: 2px;
  opacity: 0.35;
}

.dropzone-copy {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.dropzone-copy strong {
  font-size: 1rem;
}

.dropzone-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.import-or {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.import-or::before,
.import-or::after {
  width: 1px;
  height: 38px;
  margin-inline: auto;
  background: var(--line);
  content: "";
}

.import-or {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.manual-start {
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  align-items: start;
  gap: 12px;
  padding: 20px;
  background: var(--canvas-warm);
  border: 1px solid #e4dfd1;
  border-radius: var(--radius);
}

.manual-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #735a24;
  background: var(--accent-soft);
  border-radius: 9px;
  font-size: 1.15rem;
}

.manual-start h3,
.manual-start p {
  margin-bottom: 3px;
}

.manual-start p {
  color: var(--muted);
  font-size: 0.83rem;
}

.manual-start .button {
  grid-column: 1 / -1;
  justify-self: start;
  margin-left: -10px;
}

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

.pdf-source-preview {
  max-width: 620px;
  margin-top: 20px;
  padding: 16px;
  background: #f1f3f0;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.pdf-preview-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.pdf-preview-heading h3,
.pdf-preview-heading p {
  margin: 2px 0 0;
}

.pdf-preview-heading p {
  color: var(--muted);
  font-size: 0.76rem;
}

.pdf-canvas-wrap {
  position: relative;
  display: grid;
  min-height: 180px;
  max-height: 430px;
  place-items: center;
  overflow: auto;
  padding: 12px;
  background: #dfe4e0;
  border: 1px solid #c9d1cd;
  border-radius: 9px;
}

.pdf-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 5px 18px rgba(20, 44, 43, 0.18);
}

.pdf-preview-spinner {
  position: absolute;
}

.pdf-preview-error {
  max-width: 42ch;
  margin: 0;
  color: var(--danger);
  font-size: 0.84rem;
  text-align: center;
}

.inline-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.inline-status.is-error,
.form-status.is-error {
  color: var(--danger);
}

.inline-status.is-success,
.form-status.is-success {
  color: var(--success);
}

.source-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 18px;
  padding: 15px 17px;
  background: var(--brand-pale);
  border: 1px solid #bad9d1;
  border-radius: 12px;
}

.source-summary strong,
.source-summary p {
  display: block;
  margin: 2px 0 0;
}

.source-summary p {
  color: var(--muted);
  font-size: 0.8rem;
}

.source-kind {
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.notice-stack {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, 0.92fr);
  align-items: start;
  gap: 22px;
}

.editor-column {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.form-section {
  min-width: 0;
}

.preview-column {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  min-width: 0;
}

.preview-card {
  min-height: 520px;
}

.preview-heading-row {
  align-items: center;
}

.preview-status {
  min-height: 360px;
}

.state-panel {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #fafbf9;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.state-panel h2,
.state-panel h3 {
  margin: 12px 0 6px;
  color: var(--ink);
}

.state-panel p {
  max-width: 42ch;
  margin-bottom: 0;
}

.state-panel .button,
.state-panel a {
  margin-top: 18px;
}

.state-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 13px;
  font-size: 1.25rem;
  font-weight: 800;
}

.state-error .state-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

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

.preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

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

.label-preview {
  min-width: 0;
  margin: 0;
  padding: 10px;
  background: #edf0ec;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.label-preview-frame {
  overflow: hidden;
  aspect-ratio: 102 / 192;
  background: #fff;
  border: 1px solid #cbd2cf;
  border-radius: 5px;
  box-shadow: 0 5px 14px rgba(20, 44, 43, 0.12);
}

.label-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.label-preview figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 660;
}

.preview-safety-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-size: 0.79rem;
}

.preview-safety-note > span {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

.preview-safety-note p {
  margin: 0;
}

.preview-actions {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  text-align: center;
}

.preview-actions small {
  color: var(--muted);
  font-size: 0.7rem;
}

.editor-column.is-source-disabled {
  position: relative;
  opacity: 0.58;
}

.editor-column.is-source-disabled::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 2px solid var(--brand-soft);
  border-radius: var(--radius-lg);
  content: "";
  pointer-events: none;
}

.items-heading-row {
  align-items: center;
}

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

.items-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.items-table th {
  padding: 10px 9px;
  color: var(--muted);
  background: #f6f8f6;
  border-bottom: 1px solid var(--line);
  font-size: 0.73rem;
  font-weight: 740;
  text-align: left;
}

.items-table th:first-child {
  width: 22%;
}

.items-table th:nth-child(3) {
  width: 15%;
}

.items-table th:nth-child(4) {
  width: 13%;
}

.items-table th:last-child {
  width: 48px;
}

.items-table td {
  padding: 7px 5px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

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

.items-table input {
  min-height: 40px;
  padding: 8px 9px;
  border-color: transparent;
  box-shadow: none;
}

.items-table input:hover {
  border-color: var(--line-strong);
}

.items-table input:focus {
  border-color: var(--focus);
}

.item-action {
  text-align: center;
}

.items-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.items-footer .help-text {
  margin: 0;
}

.review-panel {
  margin-top: 4px;
  border: 2px solid #98c3ba;
  box-shadow: var(--shadow-md);
  scroll-margin-top: calc(var(--header-height) + 20px);
}

.review-topline {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.review-topline p:last-child {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 30px;
  padding-block: 24px;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 18px 24px;
  margin: 0;
}

.review-summary div {
  min-width: 0;
}

.review-summary dt,
.metric-grid dt,
.settings-summary dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 690;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.review-summary dd,
.metric-grid dd,
.settings-summary dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.review-controls {
  display: grid;
  gap: 18px;
  padding: 18px;
  background: var(--canvas-warm);
  border: 1px solid #e3ded2;
  border-radius: 13px;
}

.compact-field select {
  max-width: 140px;
}

.check-row {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  font-weight: 540 !important;
  cursor: pointer;
}

.check-row input {
  width: 19px;
  min-width: 19px;
  height: 19px;
  min-height: 19px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--brand);
}

.review-actions,
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.success-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #afd7bf;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.success-panel h2,
.success-panel p {
  margin-bottom: 2px;
}

.success-panel > div {
  margin-right: auto;
}

.success-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 800;
}

.mobile-review-bar {
  display: none;
}

.page-stack {
  display: grid;
  gap: 20px;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.filter-form .button {
  margin-bottom: 1px;
}

.list-state .state-panel {
  min-height: 290px;
}

.table-scroll {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  background: #f7f9f7;
  font-size: 0.73rem;
  font-weight: 760;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: #fafcfb;
}

.data-table td {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.data-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.mono-short,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
}

.job-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 4px;
}

.jobs-card-list {
  display: none;
}

.jobs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.jobs-pagination p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

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

.job-mobile-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.job-mobile-card > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.job-mobile-card p {
  margin: 8px 0 2px;
  color: var(--ink-soft);
}

.job-mobile-card small {
  color: var(--muted);
}

.job-mobile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 13px 0;
}

.job-mobile-meta span {
  color: var(--muted);
  font-size: 0.73rem;
}

.job-mobile-meta strong {
  display: block;
  color: var(--ink);
  font-size: 0.83rem;
}

.job-mobile-actions {
  display: flex;
  gap: 8px;
}

.printer-overview {
  min-height: 300px;
}

.printer-overview .state-panel {
  min-height: 236px;
}

.printer-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.printer-title-row > div:nth-child(2) {
  margin-right: auto;
}

.printer-title-row h2,
.printer-title-row p:last-child {
  margin-bottom: 0;
}

.printer-title-row p:last-child {
  color: var(--muted);
}

.device-illustration {
  position: relative;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  background: var(--brand-soft);
  border-radius: 18px;
}

.device-body {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  height: 34px;
  background: var(--brand);
  border-radius: 7px 7px 10px 10px;
}

.device-body::after {
  position: absolute;
  right: 10px;
  bottom: 8px;
  left: 10px;
  height: 4px;
  background: #083f3a;
  border-radius: 4px;
  content: "";
}

.device-paper {
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 26px;
  width: 27px;
  height: 34px;
  background: #fff;
  border: 1px solid #a5beb8;
  border-radius: 3px;
}

.device-paper::before,
.device-paper::after {
  position: absolute;
  right: 5px;
  left: 5px;
  height: 2px;
  background: #9eb5af;
  content: "";
}

.device-paper::before { top: 9px; }
.device-paper::after { top: 15px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
  margin: 26px 0 0;
}

.metric-grid > div {
  min-width: 0;
  padding: 0 16px;
  border-left: 2px solid var(--brand-soft);
}

.metric-grid code {
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  gap: 20px;
}

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

.event-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  background: #f7f9f7;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.event-card p,
.event-card time {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.event-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  font-weight: 800;
}

.check-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  color: var(--ink-soft);
}

.check-list li::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 50%;
  font-size: 0.67rem;
  font-weight: 800;
  content: "✓";
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 920px);
  align-items: start;
  justify-content: center;
  gap: 28px;
}

.settings-nav {
  position: sticky;
  top: calc(var(--header-height) + 22px);
  display: grid;
  gap: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.settings-nav a {
  padding: 10px 12px;
  color: var(--ink-soft);
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 620;
  text-decoration: none;
}

.settings-nav a:hover {
  color: var(--brand-deep);
  background: var(--brand-pale);
}

.settings-content {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.settings-section {
  scroll-margin-top: calc(var(--header-height) + 22px);
}

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

.settings-summary > div {
  padding: 13px 14px;
  background: #f7f9f7;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.settings-form {
  display: grid;
  gap: 22px;
}

.form-status {
  min-height: 20px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.token-list {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.token-row p,
.token-row small {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.empty-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  color: var(--muted);
  background: #f8faf8;
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
}

.empty-inline > span {
  font-size: 1.5rem;
}

.empty-inline p {
  margin: 0;
}

.token-create > summary {
  width: max-content;
  list-style: none;
}

.token-create > summary::-webkit-details-marker {
  display: none;
}

.token-create[open] > summary {
  margin-bottom: 20px;
}

.token-form {
  padding: 20px;
  background: var(--canvas-warm);
  border: 1px solid #e3ded2;
  border-radius: 12px;
}

.scope-fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.scope-fieldset legend {
  padding-inline: 5px;
}

.scope-fieldset > .help-text {
  margin: -5px 0 5px;
}

.scope-sensitive {
  color: #734e0a;
}

.secret-panel {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  color: #5c430c;
  background: var(--warning-soft);
  border: 1px solid #e9cf8d;
  border-radius: 12px;
}

.secret-panel p {
  margin-bottom: 0;
}

.secret-copy-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.secret-copy-row code {
  display: block;
  min-width: 0;
  flex: 1;
  padding: 11px;
  overflow: auto;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ddc477;
  border-radius: 8px;
  white-space: nowrap;
}

.security-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.security-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.security-list li > span {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

.security-list p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.login-page {
  background: #edf2ef;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 0.9fr) minmax(460px, 1.1fr);
}

.login-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(42px, 7vw, 92px);
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, 0.11), transparent 22rem),
    linear-gradient(145deg, #0b5850, #103f3e 72%);
}

.brand-login {
  position: absolute;
  top: 36px;
  left: clamp(42px, 7vw, 92px);
  color: #fff;
}

.brand-login:hover {
  color: #fff;
}

.brand-login .brand-mark {
  color: var(--brand-deep);
  background: #fff;
}

.brand-login small {
  color: rgba(255, 255, 255, 0.68);
}

.login-brand-copy {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.login-brand-copy .eyebrow {
  color: #9ddbd0;
}

.login-brand-copy h1 {
  max-width: 13ch;
  font-size: clamp(2.4rem, 5.6vw, 4.7rem);
}

.login-brand-copy > p:last-child {
  max-width: 48ch;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.05rem;
}

.login-benefits {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.86);
  list-style: none;
  font-size: 0.88rem;
}

.login-benefits span {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  place-items: center;
  color: var(--brand-deep);
  background: #aee1d6;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
}

.login-illustration {
  position: absolute;
  z-index: 1;
  right: -110px;
  bottom: -60px;
  width: 420px;
  height: 420px;
  opacity: 0.12;
  transform: rotate(-6deg);
}

.illustration-printer {
  position: absolute;
  right: 10px;
  bottom: 0;
  width: 300px;
  height: 220px;
  background: #fff;
  border-radius: 34px;
}

.illustration-printer::before {
  position: absolute;
  right: 48px;
  bottom: 40px;
  left: 48px;
  height: 25px;
  background: #0b5850;
  border-radius: 15px;
  content: "";
}

.illustration-label {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 60px;
  width: 180px;
  height: 280px;
  padding: 28px 20px;
  background: #fff;
  border-radius: 12px;
}

.illustration-label span {
  display: block;
  height: 12px;
  margin-bottom: 20px;
  background: #0b5850;
  border-radius: 7px;
}

.illustration-label span:nth-child(2) { width: 72%; }
.illustration-label span:nth-child(3) { height: 70px; }

.login-form-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 42px 28px 24px;
}

.login-card {
  width: min(100%, 430px);
  padding: clamp(26px, 5vw, 42px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.login-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.1rem);
}

.login-intro {
  margin-bottom: 26px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 18px;
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.field-heading a,
.auth-back-link a:not(.button) {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 680;
}

.auth-back-link {
  margin: 22px 0 0;
  text-align: center;
}

.auth-back-link .button {
  text-decoration: none;
}

.login-form .alert {
  margin-bottom: 18px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 46px;
  height: 34px;
  padding: 0 8px;
  color: var(--brand-deep);
  background: var(--brand-pale);
  border: 0;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 690;
}

.login-footer {
  display: flex;
  width: min(100%, 430px);
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.72rem;
}

.login-footer p {
  margin: 0;
}

.mobile-login-brand {
  display: none;
}

@media (max-width: 1120px) {
  .editor-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  }

  .label-previews {
    grid-template-columns: 1fr;
  }

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

  .three-columns .field:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  :root {
    --header-height: 66px;
  }

  .header-inner {
    gap: 12px;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 20px;
    display: none;
    width: min(320px, calc(100vw - 40px));
    height: auto;
    align-items: stretch;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow-md);
  }

  .primary-nav.is-open {
    display: grid;
  }

  .primary-nav a {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .primary-nav a::after {
    display: none;
  }

  .primary-nav a[aria-current="page"] {
    background: var(--brand-pale);
  }

  .logout-form {
    margin-left: 0;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .preview-column {
    position: static;
    grid-row: 1;
  }

  .preview-card {
    min-height: 0;
  }

  .preview-status {
    min-height: 300px;
  }

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

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .settings-nav a {
    flex: 0 0 auto;
  }

  .login-shell {
    grid-template-columns: minmax(320px, 0.72fr) minmax(420px, 1fr);
  }

  .login-brand-panel {
    padding-inline: 44px;
  }

  .brand-login {
    left: 44px;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 28px, 1440px);
  }

  body[data-page="create"] {
    padding-bottom: 88px;
  }

  .site-header {
    position: sticky;
  }

  .logout-form .button {
    width: 40px;
    overflow: hidden;
    color: transparent;
  }

  .logout-form .button::after {
    color: var(--ink-soft);
    content: "↪";
    font-size: 1.15rem;
  }

  .page-hero,
  .page-hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding-block: 34px 22px;
  }

  .page-hero .status-pill {
    align-self: flex-start;
  }

  .page-hero-actions .button {
    width: 100%;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .card {
    padding: 20px;
    border-radius: var(--radius);
  }

  .import-layout {
    grid-template-columns: 1fr;
  }

  .import-or {
    flex-direction: row;
  }

  .import-or::before,
  .import-or::after {
    width: 100%;
    height: 1px;
  }

  .dropzone {
    min-height: 134px;
    flex-wrap: wrap;
  }

  .dropzone .button {
    margin-left: 64px;
  }

  .import-actions .button {
    width: 100%;
  }

  .two-columns,
  .three-columns,
  .review-grid,
  .two-content-columns {
    grid-template-columns: 1fr;
  }

  .three-columns .field:last-child {
    grid-column: auto;
  }

  .form-grid {
    gap: 17px;
  }

  .label-previews {
    grid-template-columns: 1fr;
  }

  .label-preview {
    max-width: 390px;
    margin-inline: auto;
  }

  .preview-card {
    min-height: 0;
  }

  .preview-status {
    min-height: 240px;
  }

  .state-panel {
    min-height: 220px;
  }

  .items-table-wrap {
    overflow: visible;
    border: 0;
  }

  .items-table,
  .items-table tbody,
  .items-table tr,
  .items-table td {
    display: block;
    width: 100%;
  }

  .items-table thead {
    display: none;
  }

  .items-table tr {
    position: relative;
    margin-bottom: 12px;
    padding: 14px 48px 14px 12px;
    background: #f8faf8;
    border: 1px solid var(--line);
    border-radius: 11px;
  }

  .items-table td {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border: 0;
  }

  .items-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.73rem;
    font-weight: 680;
  }

  .items-table .item-action {
    position: absolute;
    top: 8px;
    right: 7px;
    display: block;
    width: 38px;
  }

  .items-table .item-action::before {
    display: none;
  }

  .items-table input {
    background: #fff;
    border-color: var(--line);
  }

  .items-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .review-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .review-actions .button {
    width: 100%;
  }

  .success-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .success-panel .button {
    width: 100%;
  }

  .mobile-review-bar {
    position: fixed;
    z-index: 90;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 11px max(14px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -8px 28px rgba(20, 44, 43, 0.11);
    backdrop-filter: blur(12px);
  }

  .mobile-review-bar > div {
    display: grid;
    min-width: 0;
  }

  .mobile-review-bar span {
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-review-bar small {
    color: var(--muted);
    font-size: 0.65rem;
  }

  .filter-form {
    grid-template-columns: 1fr;
  }

  .filter-form .button {
    width: 100%;
  }

  .jobs-table {
    display: none;
  }

  .jobs-card-list {
    display: block;
  }

  .jobs-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-actions .button {
    flex: 1;
  }

  .printer-title-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .printer-title-row .status-pill {
    margin-left: 96px;
  }

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

  .settings-summary {
    grid-template-columns: 1fr;
  }

  .token-row {
    grid-template-columns: 1fr auto;
  }

  .token-row .button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .login-shell {
    display: block;
  }

  .login-brand-panel {
    display: none;
  }

  .login-form-panel {
    min-height: 100vh;
    justify-content: center;
    padding: 28px 18px;
  }

  .mobile-login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
  }

  .mobile-login-brand .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 20px, 1440px);
  }

  .brand > span:last-child {
    display: none;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .dropzone {
    padding: 17px;
  }

  .dropzone-copy {
    width: calc(100% - 64px);
  }

  .dropzone .button {
    width: 100%;
    margin-left: 0;
  }

  .source-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .items-heading-row .button,
  .preview-heading-row .button {
    align-self: stretch;
  }

  .review-topline {
    gap: 10px;
  }

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

  .printer-title-row .status-pill {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .secret-copy-row {
    flex-direction: column;
  }

  .login-card {
    padding: 24px 20px;
  }

  .login-footer {
    align-items: center;
    flex-direction: column;
  }
}

/* UnifyIT brand theme. Keep label/PDF paper white; application chrome stays dark. */
.site-header {
  border-bottom-color: var(--line);
  background: rgba(6, 10, 21, 0.84);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--ink);
}

.primary-nav a::after {
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.card,
.login-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  backdrop-filter: blur(16px);
}

.button {
  border-radius: 12px;
}

.button-primary {
  background: var(--brand);
  border-color: #315fdc;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.32);
}

.button-primary:hover:not(:disabled) {
  background: #2563eb;
  border-color: #3b82f6;
}

.button-secondary,
.status-pill,
.status-chip {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line-strong);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(34, 184, 240, 0.1);
  border-color: rgba(34, 184, 240, 0.42);
}

input,
select,
textarea,
.items-table input,
.secret-copy-row code {
  color: var(--ink);
  background: rgba(3, 7, 17, 0.62);
  border-color: var(--line-strong);
  color-scheme: dark;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(34, 184, 240, 0.5);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(34, 184, 240, 0.2);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  background: rgba(127, 29, 29, 0.2);
}

.status-online,
.status-printed {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(98, 223, 167, 0.32);
}

.status-offline,
.status-failed {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 139, 145, 0.32);
}

.status-queued,
.status-printing {
  color: var(--info);
  background: var(--info-soft);
  border-color: rgba(120, 212, 247, 0.3);
}

.status-uncertain {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(248, 201, 107, 0.3);
}

.status-cancelled,
.status-neutral,
.status-unknown,
.confidence-chip {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
}

.alert-info,
.info-strip {
  color: var(--info);
  background: var(--info-soft);
  border-color: rgba(120, 212, 247, 0.28);
}

.alert-error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 139, 145, 0.3);
}

.alert-warning,
.warning-strip,
.secret-panel {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(248, 201, 107, 0.3);
}

.alert-success,
.success-panel {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(98, 223, 167, 0.3);
}

.dropzone,
.source-summary {
  background: rgba(34, 184, 240, 0.065);
  border-color: rgba(34, 184, 240, 0.38);
}

.dropzone:hover,
.dropzone.is-dragging {
  background: rgba(34, 184, 240, 0.12);
  border-color: var(--accent);
}

.dropzone-icon,
.manual-start,
.pdf-source-preview,
.state-panel,
.items-table th,
.review-controls,
.data-table th,
.event-card,
.settings-summary > div,
.token-row,
.empty-inline,
.token-form,
.items-table tr,
.settings-nav,
.primary-nav,
.mobile-review-bar {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.pdf-canvas-wrap,
.label-preview {
  background: #111827;
  border-color: var(--line-strong);
}

.pdf-canvas-wrap canvas,
.label-preview-frame,
.device-paper,
.illustration-printer,
.illustration-label {
  background: #fff;
}

.label-preview-frame {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

.review-panel {
  border-color: rgba(34, 184, 240, 0.44);
}

.data-table tbody tr:hover {
  background: rgba(34, 184, 240, 0.045);
}

.scope-sensitive {
  color: var(--warning);
}

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

.login-page {
  background: var(--canvas);
}

.login-brand-panel {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 82% 16%, rgba(34, 184, 240, 0.24), transparent 27rem),
    radial-gradient(circle at 12% 74%, rgba(29, 78, 216, 0.24), transparent 30rem),
    #060a15;
  background-size: 52px 52px, 52px 52px, auto, auto, auto;
  border-right: 1px solid var(--line);
}

.login-brand-copy .eyebrow {
  color: var(--accent);
}

.login-brand-copy > p:last-child,
.login-benefits {
  color: var(--ink-soft);
}

.login-benefits span {
  color: #06111d;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(34, 184, 240, 0.28);
}

.illustration-printer::before,
.illustration-label span {
  background: var(--brand);
}

.login-form-panel {
  background:
    radial-gradient(circle at 55% 35%, rgba(29, 78, 216, 0.12), transparent 24rem),
    transparent;
}

.login-card {
  border-color: var(--line-strong);
}

.password-toggle {
  color: var(--accent);
  background: rgba(34, 184, 240, 0.09);
}

.mobile-login-brand {
  justify-content: center;
}

@media (max-width: 760px) {
  .items-table tr,
  .primary-nav,
  .mobile-review-bar {
    background: rgba(9, 17, 33, 0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .mobile-review-bar,
  .button,
  .preview-safety-note {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .card {
    box-shadow: none;
  }
}
