:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4ef;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --surface: rgba(255, 255, 255, .96);
}

* { box-sizing: border-box; }

html.auth-locked body { overflow: hidden; }
html.auth-locked .page { opacity: .45; pointer-events: none; user-select: none; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(37, 99, 235, .12), transparent 28%),
    radial-gradient(circle at 88% 92%, rgba(14, 165, 233, .10), transparent 26%),
    #f1f5f9;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.035em; }
.subtitle { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.header-actions .btn { white-space: nowrap; text-decoration: none; }

.label-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.label-option { display: grid; grid-template-columns: 44px 1fr 28px; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid transparent; border-radius: 17px; color: var(--ink); background: rgba(255, 255, 255, .88); box-shadow: 0 8px 24px rgba(15, 23, 42, .06); cursor: pointer; text-align: left; }
.label-option:hover { border-color: #bfdbfe; }
.label-option.active { border-color: var(--blue); background: #eff6ff; box-shadow: 0 10px 28px rgba(37, 99, 235, .14); }
.label-option > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.label-option strong { font-size: 17px; }
.label-option small { color: var(--muted); font-size: 12px; }
.option-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #1d4ed8; background: #dbeafe; font-size: 23px; font-weight: 900; }
.option-check { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: transparent; background: #e2e8f0; font-weight: 900; }
.label-option.active .option-check { color: #fff; background: var(--blue); }

.workspace { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr); gap: 22px; align-items: start; }
.preview-card, .controls-card { background: var(--surface); border: 1px solid rgba(255, 255, 255, .9); border-radius: 22px; box-shadow: 0 18px 55px rgba(15, 23, 42, .10); }
.preview-card { padding: 16px; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; color: #334155; }
.preview-heading > div { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .14); }
.dimensions { color: var(--muted); font-size: 12px; font-weight: 750; }

.paper-preview { max-height: 68vh; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #cbd5e1; }
.preview-sheet { width: min(100%, 390px); aspect-ratio: 576 / 1119; margin: 0 auto; overflow: hidden; background: #fff; box-shadow: 0 6px 22px rgba(15, 23, 42, .18); transition: aspect-ratio .2s ease; }
.preview-sheet iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }

.controls-card { padding: clamp(22px, 4vw, 36px); position: sticky; top: 20px; }
.tag { display: inline-flex; padding: 6px 9px; border-radius: 999px; color: #1d4ed8; background: #dbeafe; font-size: 11px; font-weight: 900; letter-spacing: .07em; }
h2 { margin: 12px 0 8px; font-size: 34px; letter-spacing: -.03em; }
.description { margin: 0; color: #475569; line-height: 1.55; }

.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 22px 0; }
.specs div { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.specs span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.specs strong { font-size: 14px; }

#printForm > label { display: block; margin-bottom: 8px; color: #334155; font-weight: 850; }
.quantity-row { display: grid; grid-template-columns: 54px 1fr 54px; gap: 8px; margin-bottom: 14px; }
.quantity-row input, .qty-btn { min-height: 54px; border: 1px solid #cbd5e1; border-radius: 13px; background: #fff; color: var(--ink); font-size: 21px; font-weight: 850; text-align: center; }
.quantity-row input { width: 100%; appearance: textfield; }
.quantity-row input::-webkit-inner-spin-button { appearance: none; }
.qty-btn { cursor: pointer; font-size: 28px; }
.qty-btn:active { transform: scale(.97); }

.print-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 12px 28px rgba(37, 99, 235, .26); cursor: pointer; font-size: 18px; font-weight: 900; }
.print-btn:active { transform: translateY(1px); }
.print-btn:disabled { opacity: .6; cursor: wait; }
.print-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.message { margin-top: 14px; padding: 11px 12px; border-radius: 11px; color: #991b1b; background: #fee2e2; font-size: 14px; font-weight: 750; }

@media (max-width: 780px) {
  .page { width: min(100% - 20px, 620px); padding-top: 16px; }
  .page-header { display: grid; }
  .header-actions { justify-content: flex-start; }
  .label-picker { grid-template-columns: 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .controls-card { position: static; grid-row: 1; }
  .paper-preview { max-height: 55vh; }
}

@media (max-width: 430px) {
  .specs { grid-template-columns: 1fr; }
  .header-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .header-actions .btn { text-align: center; }
}

