:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --panel: #12161b;
  --panel-2: #191e24;
  --line: #2a3139;
  --text: #f4f6f8;
  --muted: #9ba7b3;
  --red: #d72d2d;
  --red-dark: #9d2020;
  --green: #2eaa68;
  --amber: #e1a62c;
  --blue: #4f8fe8;
  --shadow: 0 18px 50px rgba(0,0,0,.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
#app { min-height: 100vh; min-height: 100dvh; }
.shell { min-height: 100vh; min-height: 100dvh; background: radial-gradient(circle at top, #171c22 0, var(--bg) 38%); padding-bottom: max(22px, env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: rgba(10,12,15,.92); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.brand-lock { width: 38px; height: 38px; border-radius: 11px; background: var(--red); display: grid; place-items: center; font-size: 21px; box-shadow: 0 8px 24px rgba(215,45,45,.22); }
.brand-copy { min-width: 0; }
.brand-title { font-weight: 850; letter-spacing: .02em; line-height: 1.05; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.main { width: min(1040px, 100%); margin: 0 auto; padding: 18px 16px 36px; }
.hero { margin: 8px 0 18px; }
.hero h1 { font-size: clamp(26px, 7vw, 42px); margin: 0; letter-spacing: -.035em; line-height: 1.02; }
.hero p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; max-width: 700px; }
.status-strip { display: flex; align-items: center; gap: 8px; margin: 12px 0 18px; font-size: 13px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(46,170,104,.12); }
.status-dot.off { background: var(--amber); box-shadow: 0 0 0 4px rgba(225,166,44,.12); }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.action-card { border: 1px solid var(--line); border-radius: 18px; padding: 18px; min-height: 145px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)), var(--panel); color: var(--text); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.action-card.primary { border-color: rgba(215,45,45,.55); background: linear-gradient(145deg, rgba(215,45,45,.16), rgba(255,255,255,.015)), var(--panel); }
.action-card .emoji { font-size: 28px; display: block; margin-bottom: 14px; }
.action-card strong { display: block; font-size: 18px; margin-bottom: 5px; }
.action-card span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 26px 0 10px; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title span { color: var(--muted); font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.record-head { display: flex; gap: 12px; align-items: flex-start; }
.record-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(215,45,45,.14); color: #ff8585; font-size: 24px; flex: 0 0 auto; }
.record-title { min-width: 0; flex: 1; }
.record-title h2, .record-title h3 { margin: 0; }
.record-title h2 { font-size: 24px; }
.record-title h3 { font-size: 17px; }
.record-title p { margin: 5px 0 0; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 750; border: 1px solid var(--line); background: var(--panel-2); }
.badge.red { color: #ff9a9a; border-color: rgba(215,45,45,.42); background: rgba(215,45,45,.11); }
.badge.green { color: #78dba6; border-color: rgba(46,170,104,.35); background: rgba(46,170,104,.1); }
.badge.amber { color: #f4c762; border-color: rgba(225,166,44,.34); background: rgba(225,166,44,.1); }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.detail { border: 1px solid var(--line); background: var(--panel-2); border-radius: 13px; padding: 12px; min-width: 0; }
.detail label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.detail div { font-weight: 700; overflow-wrap: anywhere; }
.detail.full { grid-column: 1 / -1; }
.stack { display: grid; gap: 10px; }
.lock-row { border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 13px; }
.lock-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.lock-row strong { font-size: 15px; }
.lock-row p { color: var(--muted); margin: 5px 0 0; font-size: 13px; line-height: 1.35; }
.btn { border: 0; border-radius: 13px; min-height: 48px; padding: 12px 16px; background: var(--panel-2); color: var(--text); font-weight: 800; cursor: pointer; border: 1px solid var(--line); }
.btn.primary { background: var(--red); border-color: var(--red); }
.btn.primary:active { background: var(--red-dark); }
.btn.green { background: var(--green); border-color: var(--green); color: #06110b; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row > * { flex: 1; }
.back-row { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.back-row button { flex: 0 0 auto; }
.back-row h1 { margin: 0; font-size: 22px; }
.flow-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 18px; }
.step-dot { height: 5px; background: var(--line); border-radius: 999px; }
.step-dot.on { background: var(--red); }
.scan-slot { border: 1px dashed #47515c; border-radius: 16px; padding: 15px; background: rgba(255,255,255,.018); }
.scan-slot.done { border-style: solid; border-color: rgba(46,170,104,.5); background: rgba(46,170,104,.065); }
.scan-slot + .scan-slot { margin-top: 10px; }
.scan-slot h3 { margin: 0 0 6px; font-size: 15px; }
.scan-slot p { color: var(--muted); margin: 0 0 12px; font-size: 13px; }
.form-group { margin-top: 14px; }
.form-group label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #0d1115; color: var(--text); padding: 13px 14px; outline: none; min-height: 48px; }
.input:focus, .textarea:focus, .select:focus { border-color: #566575; box-shadow: 0 0 0 3px rgba(79,143,232,.12); }
.textarea { min-height: 108px; resize: vertical; }
.pin { letter-spacing: .32em; font-size: 22px; font-weight: 800; text-align: center; }
.notice { border: 1px solid rgba(225,166,44,.35); background: rgba(225,166,44,.08); color: #f0d18a; border-radius: 14px; padding: 12px 13px; font-size: 13px; line-height: 1.45; }
.notice.error { border-color: rgba(215,45,45,.4); background: rgba(215,45,45,.09); color: #ffabab; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.78); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal { width: min(620px, 100%); max-height: 94dvh; overflow: auto; background: #0e1216; border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 15px 15px max(18px, env(safe-area-inset-bottom)); box-shadow: 0 -20px 70px rgba(0,0,0,.5); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; flex: 1; font-size: 19px; }
.scanner-frame { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 3/4; max-height: 58dvh; }
.scanner-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-target { position: absolute; inset: 50% auto auto 50%; width: 68%; aspect-ratio: 1; transform: translate(-50%,-50%); border: 3px solid rgba(255,255,255,.95); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,.23); pointer-events: none; }
.scan-target::before, .scan-target::after { content:""; position:absolute; left:10%; right:10%; height:2px; background: var(--red); top:50%; box-shadow: 0 0 12px var(--red); }
.scanner-help { color: var(--muted); text-align: center; font-size: 13px; margin: 12px 0; }
.file-label { display: block; }
.file-label input { display:none; }
.manual-row { display: flex; gap: 8px; }
.manual-row input { flex: 1; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300; max-width: calc(100% - 30px); background: #20262d; border: 1px solid #39424c; border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13px; animation: toastIn .18s ease-out; }
.toast.error { border-color: rgba(215,45,45,.55); background: #281516; color: #ffc0c0; }
@keyframes toastIn { from { transform: translate(-50%, 10px); opacity: 0; } }
.loading { min-height: 180px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid #303842; border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 690px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 12px; font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: #101419; }
tr:last-child td { border-bottom: 0; }

.history-mobile-list { display: none; }
.history-card { border: 1px solid var(--line); background: #11161b; border-radius: 17px; padding: 15px; }
.history-card + .history-card { margin-top: 10px; }
.history-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.history-card-head strong { display: block; font-size: 17px; }
.history-card-head span:not(.badge) { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.history-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 13px; }
.history-field { min-width: 0; }
.history-field.full { grid-column: 1 / -1; }
.history-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.history-field strong { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.history-field small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.admin-tabs { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; margin: 12px 0; }
.admin-tabs button { flex: 0 0 auto; }
.admin-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.admin-form .full { grid-column: 1/-1; }
.mini-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-btn { border: 1px solid var(--line); background: #171c22; color: var(--text); border-radius: 9px; padding: 7px 9px; font-size: 11px; font-weight: 750; cursor: pointer; }
.qr-label { background: white; color: #111; border-radius: 16px; padding: 22px; text-align: center; }
.qr-label h2 { margin: 0 0 5px; font-size: 23px; }
.qr-label p { margin: 4px 0; }
.qr-box { display: inline-block; margin: 18px auto; padding: 8px; background: white; }
.qr-code-text { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 800; letter-spacing: .06em; }
.success-mark { width: 72px; height: 72px; margin: 8px auto 14px; border-radius: 50%; background: rgba(46,170,104,.14); color: #77e0a9; display: grid; place-items: center; font-size: 38px; }
@media (min-width: 760px) {
  .main { padding-top: 26px; }
  .action-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .action-card { min-height: 165px; }
  .modal-backdrop { align-items: center; padding: 22px; }
  .modal { border-radius: 22px; max-height: 90vh; }
}
@media (max-width: 520px) {
  .action-grid { grid-template-columns: 1fr 1fr; }
  .action-card { min-height: 132px; padding: 15px; }
  .action-card strong { font-size: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail.full { grid-column: auto; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form .full { grid-column: auto; }
  .admin-tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; gap: 8px; }
  .admin-tabs button { width: 100%; }
  .history-desktop-table { display: none; }
  .history-mobile-list { display: block; }
  .history-title { align-items: flex-end; }
  .history-title span { text-align: right; font-size: 12px; }
  .history-card-grid { grid-template-columns: 1fr 1fr; }
}
@media print {
  body * { visibility: hidden !important; }
  #qr-print-area, #qr-print-area * { visibility: visible !important; }
  #qr-print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}

/* v0.1.3 — mobile Admin records use cards instead of wide tables */
.admin-mobile-list { display: none; }
.admin-record-card { border: 1px solid var(--line); background: #11161b; border-radius: 17px; padding: 15px; }
.admin-record-card + .admin-record-card { margin-top: 10px; }
.admin-record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-record-head > div { min-width: 0; }
.admin-record-head strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.admin-record-head span:not(.badge) { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.admin-record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 13px; }
.admin-record-field { min-width: 0; }
.admin-record-field.full { grid-column: 1 / -1; }
.admin-record-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-record-field strong { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.admin-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.admin-card-actions.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.admin-card-actions .mini-btn { width: 100%; min-height: 42px; padding: 9px 7px; }

@media (max-width: 520px) {
  .admin-desktop-table { display: none; }
  .admin-mobile-list { display: block; }
  .admin-record-grid { grid-template-columns: 1fr 1fr; }
  .admin-card-actions.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 380px) {
  .admin-card-actions.three { grid-template-columns: 1fr; }
}

/* v0.1.4 — shared read-only Viewer profile */
.viewer-login-card { max-width: 500px; margin: 20px auto; }
.viewer-readonly-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }
.viewer-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.viewer-toolbar h2 { margin: 0; }
.viewer-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.viewer-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.viewer-tabs .btn { width: 100%; }
.viewer-equipment-card { border: 1px solid var(--line); background: #11161b; border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.viewer-equipment-card + .viewer-equipment-card { margin-top: 12px; }
.viewer-equipment-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.viewer-equipment-head > div { min-width: 0; }
.viewer-equipment-head strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.viewer-equipment-head span:not(.badge) { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.viewer-equipment-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px 0; }
.viewer-equipment-meta > div { min-width: 0; border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 11px; }
.viewer-equipment-meta span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.viewer-equipment-meta strong { display: block; overflow-wrap: anywhere; font-size: 13px; line-height: 1.35; }
.viewer-lock-stack { margin-top: 0; }
.viewer-history-list { display: none; }
.viewer-admin-pin-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 14px; }
.viewer-admin-pin-row .form-group { margin-top: 0; }
.viewer-admin-pin-row .btn { min-width: 180px; }
.viewer-permission-list { display: grid; gap: 8px; color: var(--text); font-size: 13px; line-height: 1.4; }
.viewer-permission-list.muted { color: var(--muted); }

@media (max-width: 520px) {
  .viewer-toolbar { align-items: flex-start; }
  .viewer-toolbar .btn { flex: 0 0 auto; }
  .viewer-section-title { align-items: flex-end; }
  .viewer-section-title span { text-align: right; }
  .viewer-equipment-meta { grid-template-columns: 1fr 1fr; }
  .viewer-history-list { display: block; }
  .viewer-history-table { display: none; }
  .viewer-admin-pin-row { grid-template-columns: 1fr; }
  .viewer-admin-pin-row .btn { min-width: 0; width: 100%; }
}

@media (max-width: 380px) {
  .viewer-equipment-meta { grid-template-columns: 1fr; }
}

/* v0.1.5 — Admin batch QR printing */
.print-codes-intro .record-head { margin-bottom: 14px; }
.print-type-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.print-type-tabs .btn { width: 100%; }
.print-scale-note { margin-top: 12px; }
.print-template-card { margin-top: 12px; }
.print-template-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.print-template-head h3 { margin: 0; }
.print-template-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.size-chip { flex: 0 0 auto; border: 1px solid #34546c; background: #102332; color: #9ed8ff; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.print-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.print-spec-grid > div { border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 11px; min-width: 0; }
.print-spec-grid span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.print-spec-grid strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.lock-size-control { display: grid; grid-template-columns: minmax(180px, .7fr) 1.3fr; gap: 12px; align-items: end; margin-top: 14px; }
.lock-size-control .form-group { margin: 0; }
.lock-size-control .notice { margin: 0; }
.batch-picker-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 18px 0 9px; }
.batch-picker-toolbar h2 { margin: 0; }
.batch-picker-toolbar > div:first-child span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.batch-code-list { display: grid; gap: 8px; }
.batch-code-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); background: #11161b; border-radius: 14px; padding: 12px 13px; cursor: pointer; }
.batch-code-row:hover { border-color: #4a5660; }
.batch-code-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.batch-code-main, .batch-code-meta { min-width: 0; }
.batch-code-main strong, .batch-code-meta strong { display: block; overflow-wrap: anywhere; }
.batch-code-main small, .batch-code-meta small { display: block; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.batch-code-meta { text-align: right; }
.muted-row { opacity: .62; }
.batch-print-button { margin-top: 12px; }
.batch-print-dialog { max-width: 880px; }
.batch-print-dialog > #batch-print-area { max-height: 58vh; overflow: auto; background: #e7e7e7; padding: 18px; border-radius: 14px; }
.batch-print-instructions { margin-bottom: 12px; }
.equipment-batch-sheet { display: grid; grid-template-columns: repeat(auto-fill, 3in); gap: .15in; align-items: start; justify-content: center; }
.equipment-engrave-tag { box-sizing: border-box; width: 3in; height: 1in; display: flex; align-items: center; gap: .10in; padding: .08in .40in .08in .45in; background: #fff; color: #000; outline: 1px dashed #999; overflow: hidden; }
.equipment-qr-frame { box-sizing: border-box; flex: 0 0 .84in; width: .84in; height: .84in; padding: .06in; background: #fff; display: flex; align-items: center; justify-content: center; }
.equipment-qr-frame .batch-qr, .equipment-qr-frame .batch-qr img, .equipment-qr-frame .batch-qr canvas { width: .72in !important; height: .72in !important; display: block; }
.equipment-tag-copy { min-width: 0; line-height: 1.05; }
.equipment-tag-copy strong { display: block; font-size: 12pt; letter-spacing: .02em; }
.equipment-tag-copy span { display: block; font-size: 8.5pt; font-weight: 700; margin-top: .04in; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equipment-tag-copy small { display: block; font-size: 6.8pt; margin-top: .04in; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock-batch-sheet { display: grid; grid-template-columns: repeat(auto-fill, 1in); gap: .18in; align-items: start; justify-content: center; }
.lock-print-item { box-sizing: border-box; width: 1in; height: .75in; padding: .025in; background: #fff; color: #000; text-align: left; outline: 1px dashed #999; overflow: hidden; break-inside: avoid; page-break-inside: avoid; display: flex; flex-direction: row; align-items: center; gap: .025in; }
.lock-qr-frame { box-sizing: border-box; flex: 0 0 .64in; width: .64in; height: .64in; padding: .015in; background: #fff; display: flex; align-items: center; justify-content: center; }
.lock-qr-frame .batch-qr, .lock-qr-frame .batch-qr img, .lock-qr-frame .batch-qr canvas { width: .61in !important; height: .61in !important; display: block; }
.lock-print-caption { width: .285in; margin-top: 0; line-height: 1.00; min-height: 0; overflow: hidden; }
.lock-print-caption strong { display: block; font-size: 5.4pt; }
.lock-print-caption span { display: block; font-size: 4.0pt; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .018in; }
.lock-print-caption small { display: block; font-size: 3.8pt; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .018in; }

@media (max-width: 520px) {
  .print-template-head { flex-direction: column; }
  .print-spec-grid { grid-template-columns: 1fr 1fr; }
  .lock-size-control { grid-template-columns: 1fr; }
  .batch-code-row { grid-template-columns: auto minmax(0,1fr); }
  .batch-code-meta { grid-column: 2; text-align: left; }
  .batch-print-dialog > #batch-print-area { padding: 10px; }
}

@media print {
  @page { margin: .25in; }
  body.batch-printing * { visibility: hidden !important; }
  body.batch-printing #batch-print-area,
  body.batch-printing #batch-print-area * { visibility: visible !important; }
  body.batch-printing #batch-print-area { position: absolute !important; left: 0 !important; top: 0 !important; width: auto !important; max-height: none !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; background: #fff !important; border-radius: 0 !important; }
  body.batch-printing .equipment-batch-sheet { display: grid !important; grid-template-columns: repeat(2, 3in) !important; gap: .15in !important; justify-content: start !important; }
  body.batch-printing .equipment-engrave-tag { outline: 0.5pt solid #bbb !important; break-inside: avoid; page-break-inside: avoid; }
  body.batch-printing .lock-batch-sheet { display: grid !important; gap: .18in !important; justify-content: start !important; }
}

/* v0.1.20 — printable LOTO history reports */
.history-print-card { margin-bottom: 16px; }
.history-print-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.history-print-head h3 { margin:0; }
.history-print-head p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.history-print-controls { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:10px; margin-top:14px; }
.history-print-controls label { display:block; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; margin:0 0 5px; }
.history-print-note { margin:10px 0 0; }
@media (max-width: 620px) {
  .history-print-head { flex-direction:column; }
  .history-print-head .btn { width:100%; }
  .history-print-controls { grid-template-columns:1fr 1fr; }
  .history-print-controls > div:first-child { grid-column:1 / -1; }
}
