:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  background: #f1f5f9;
  font-synthesis: none;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ed;
  --card: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b91c1c;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: #f1f5f9; }
body { margin: 0; min-height: 100vh; background: #f1f5f9; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px 20px 60px; }
.topbar { display: flex; gap: 18px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
h1, h2 { margin: 0; letter-spacing: -0.025em; }
h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: 24px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .13em; color: #64748b; margin-bottom: 5px; }
.status-pill, .muted-chip { border-radius: 999px; padding: 9px 12px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.status-pill { border: 1px solid #cbd5e1; background: #fff; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.status-connected { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.status-connected .status-dot { background: #22c55e; }
.status-connecting { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.status-connecting .status-dot { background: #f59e0b; }
.status-offline { color: #475569; }
.muted-chip { background: #f1f5f9; color: #475569; }
.tabs { display: flex; gap: 8px; padding: 6px; background: #e2e8f0; border-radius: 14px; margin-bottom: 20px; width: fit-content; }
.tab-button { border: 0; background: transparent; padding: 11px 18px; border-radius: 10px; font-weight: 800; color: #475569; }
.tab-button.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.grid { display: grid; gap: 20px; }
.print-grid { grid-template-columns: minmax(320px, .85fr) minmax(360px, 1.15fr); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 24px; box-shadow: 0 12px 30px rgba(15,23,42,.055); }
.card-heading-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.form-card { align-self: start; }
.field-group { margin-bottom: 20px; position: relative; }
.field-group label { display: block; font-size: 14px; font-weight: 800; margin-bottom: 8px; }
input, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; min-height: 50px; padding: 11px 13px; background: #fff; color: #0f172a; outline: none; }
input:focus, select:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.12); }
input[type="range"] { padding: 0; min-height: 32px; box-shadow: none; border: 0; }
.field-help, .preview-note { color: #64748b; font-size: 13px; line-height: 1.45; margin: 8px 0 0; }
.two-col-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.primary-button, .secondary-button, .danger-button { min-height: 46px; border-radius: 12px; border: 0; padding: 10px 15px; font-weight: 800; }
.primary-button { background: var(--accent); color: white; }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { background: #e2e8f0; color: #0f172a; }
.danger-button { background: #fee2e2; color: #991b1b; width: 100%; margin-top: 10px; }
.large-button { width: 100%; min-height: 58px; font-size: 16px; letter-spacing: .02em; }
button:disabled { opacity: .55; cursor: not-allowed; }
.stepper { display: grid; grid-template-columns: 54px 1fr 54px; gap: 8px; }
.stepper-btn { border: 0; background: #e2e8f0; border-radius: 12px; font-size: 28px; font-weight: 700; }
#copiesInput { text-align: center; font-size: 20px; font-weight: 800; }
.preview-stage { min-height: 360px; border-radius: 16px; background: repeating-conic-gradient(#e2e8f0 0% 25%, #f8fafc 0% 50%) 50% / 18px 18px; display: grid; place-items: center; padding: 28px; overflow: auto; }
#labelCanvas { display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; background: #fff; box-shadow: 0 8px 25px rgba(15,23,42,.22); image-rendering: auto; }
.suggestions { position: absolute; z-index: 30; left: 0; right: 0; top: 78px; max-height: 240px; overflow-y: auto; border: 1px solid #cbd5e1; background: #fff; border-radius: 12px; box-shadow: 0 15px 35px rgba(15,23,42,.16); }
.suggestion-item { padding: 12px 13px; border: 0; background: #fff; width: 100%; text-align: left; }
.suggestion-item:hover, .suggestion-item.active { background: #f0fdfa; }
.hidden { display: none !important; }
.progress-card { margin-top: 14px; padding: 14px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; }
.progress-track { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 10px 0 8px; }
.progress-bar { height: 100%; width: 0%; background: #0f766e; transition: width .15s ease; }
#progressHint { margin: 0; color: #64748b; font-size: 12px; }
.message-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #eff6ff; color: #1e3a8a; font-size: 14px; line-height: 1.45; }
.message-box.error { background: #fef2f2; color: #991b1b; }
.message-box.success { background: #f0fdf4; color: #166534; }
.printer-info { display: grid; gap: 1px; margin: 0 0 18px; border-radius: 12px; overflow: hidden; border: 1px solid #e2e8f0; }
.printer-info div { display: grid; grid-template-columns: 1fr 1fr; background: #f8fafc; padding: 11px 13px; }
.printer-info dt { color: #64748b; }
.printer-info dd { margin: 0; text-align: right; font-weight: 700; }
.range-legend { display: flex; justify-content: space-between; align-items: center; color: #64748b; font-size: 12px; }
.range-legend strong { color: #0f172a; font-size: 16px; }
.products-card, .privacy-card { grid-column: 1 / -1; }
.add-product-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 14px; }
.product-list { display: grid; gap: 8px; max-height: 380px; overflow: auto; padding-right: 4px; }
.product-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px solid #e2e8f0; border-radius: 12px; }
.product-row span { font-weight: 650; }
.delete-product { border: 0; background: #fef2f2; color: #991b1b; border-radius: 9px; padding: 7px 10px; font-weight: 800; }
.empty-state { color: #64748b; text-align: center; padding: 22px; border: 1px dashed #cbd5e1; border-radius: 12px; }
.file-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 820px) {
  .app-shell { padding: 18px 14px 42px; }
  .topbar { align-items: flex-start; }
  .print-grid, .settings-grid { grid-template-columns: 1fr; }
  .products-card, .privacy-card { grid-column: auto; }
  .preview-card { order: -1; }
  .preview-stage { min-height: 260px; padding: 18px; }
}
@media (max-width: 520px) {
  .topbar { flex-direction: column; }
  .tabs { width: 100%; }
  .tab-button { flex: 1; padding: 10px; }
  .card { padding: 18px; border-radius: 15px; }
  .two-col-fields { grid-template-columns: 1fr; gap: 0; }
  .button-row > * { flex: 1 1 100%; }
  .add-product-row { grid-template-columns: 1fr; }
}
