/* FW Inspect — one stylesheet, mobile first */
:root {
  --navy: #14213d;
  --navy-2: #22335c;
  --accent: #f77f00;
  --accent-dark: #c96500;
  --bg: #f3f4f7;
  --card: #fff;
  --text: #1b1f2a;
  --muted: #6b7280;
  --line: #e2e5ec;
  --ok: #16794a;   --ok-bg: #e5f5ec;
  --warn: #9a5b00; --warn-bg: #fff2d6;
  --bad: #b42318;  --bad-bg: #fde8e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--navy-2); }
h1 { font-size: 1.45rem; margin: 0 0 .2rem; line-height: 1.2; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; display: flex; gap: .75rem; align-items: baseline; }
h2 a { font-weight: 500; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.center { text-align: center; }
.right { margin-left: auto; }
.danger-text { color: var(--bad); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 600; min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { background: var(--accent); color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .5px; border-radius: 6px; padding: .3rem .4rem; }
.mainnav { display: flex; gap: .2rem; }
.mainnav a { color: #c9d1e6; text-decoration: none; padding: .45rem .7rem; border-radius: 6px; font-weight: 500; }
.mainnav a:hover { background: var(--navy-2); color: #fff; }
.mainnav a.active { background: var(--navy-2); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.usermenu { margin-left: auto; display: flex; gap: .9rem; font-size: .88rem; }
.usermenu a { color: #c9d1e6; text-decoration: none; }
.navtoggle { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.4rem; padding: .2rem .4rem; }
.mainnav a.mobile-only { display: none; }
.mainnav a, .usermenu a { white-space: nowrap; }
@media (max-width: 1280px) and (min-width: 1025px) {
  .topbar { gap: .6rem; }
  .mainnav a { padding: .45rem .45rem; font-size: .9rem; }
  .usermenu { gap: .6rem; font-size: .82rem; }
  .brand-name { max-width: 150px; }
}
@media (max-width: 1100px) and (min-width: 1025px) {
  .usermenu .username { display: none; }
}

@media (max-width: 1024px) {
  .navtoggle { display: block; }
  .usermenu { display: none; }
  .mainnav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); flex-direction: column; padding: .5rem; }
  body.nav-open .mainnav { display: flex; }
  .mainnav a { padding: .8rem 1rem; }
  .mainnav a.mobile-only { display: block; border-top: 1px solid var(--navy-2); }
}

/* ---------- page ---------- */
.main { max-width: 1180px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.pagehead { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1rem; }
.pagehead p { margin: .2rem 0 0; }
.crumb { display: inline-block; font-size: .85rem; color: var(--muted); text-decoration: none; margin-bottom: .25rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 760px; }
.card.hint { background: #eef3ff; box-shadow: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; }
.stack { display: flex; flex-direction: column; gap: .85rem; }
.row2, .row3 { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .88rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); background: #fff; border: 1px solid #cfd4de; border-radius: 8px; padding: .55rem .65rem; width: 100%; min-height: 42px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.formactions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .4rem; }
.formactions.sticky { position: sticky; bottom: 0; background: rgba(243, 244, 247, .96); padding: .7rem 0; z-index: 5; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.filters input[name=q] { flex: 2 1 220px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--navy); background: #fff; border: 1px solid #cfd4de; border-radius: 8px; padding: .55rem .95rem; min-height: 40px; cursor: pointer; }
.btn:hover { border-color: var(--navy-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--bad); border-color: #f1b7b0; }
.btn.link { border-color: transparent; background: none; }
.btn.small { font-size: .8rem; padding: .3rem .6rem; min-height: 30px; }
.btn.big { font-size: 1rem; padding: .75rem 1.3rem; min-height: 48px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: wait; }

.license-banner { padding: .7rem .9rem; border-radius: 8px; margin-bottom: .8rem; font-weight: 600; }
.license-banner.warn { background: var(--warn-bg); color: var(--warn); }
.license-banner.bad { background: var(--bad-bg); color: var(--bad); }
.flash { padding: .7rem .9rem; border-radius: 8px; margin-bottom: .8rem; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }

/* ---------- data ---------- */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.muted { background: #eceef2; color: var(--muted); }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.right { text-align: right; white-space: nowrap; }
tr.inactive td { opacity: .55; }
table.edit td { padding: .35rem; }
table.edit input, table.edit select { min-height: 36px; padding: .35rem .5rem; }
.w-num { width: 90px !important; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .85rem; }
.dl dd { margin: 0; }
.dl.tight { gap: .2rem .9rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; text-decoration: none; color: var(--text); border-top: 4px solid var(--navy-2); }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.bad { border-top-color: var(--bad); }
.stat.warn { border-top-color: var(--accent); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.qr { display: inline-block; padding: 8px; background: #fff; }
.qr svg { display: block; }
.log { max-height: 460px; overflow: auto; font-size: .85rem; }
.log-row { padding: .3rem 0; border-bottom: 1px solid var(--line); }
details.upload-doc { margin-top: 1rem; }
details.upload-doc summary { cursor: pointer; font-weight: 600; color: var(--navy-2); margin-bottom: .8rem; }
.doc-upload { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------- legal pages ---------- */
.legal { max-width: 860px; margin-left: auto; margin-right: auto; }
.legal h2 { font-size: 1.45rem; display: block; }
.legal h3 { font-size: 1.05rem; margin-top: 1.3rem; }
.legal ul { padding-left: 1.3rem; }
.legal li { margin: .3rem 0; }
.legal table { margin: .5rem 0 1rem; }
.layout-bare .legal { max-width: 860px; }

/* ---------- footer ---------- */
.sitefoot { display: flex; justify-content: center; gap: 1.2rem; padding: 0 1rem 2rem; font-size: .8rem; }
.sitefoot a { color: var(--muted); }
.install { max-width: 760px; }
.install-qr { display: flex; gap: 1.2rem; align-items: center; margin: 1rem 0 1.4rem; flex-wrap: wrap; }
.install-qr .qr { width: 180px; height: 180px; background: #fff; }
.steps { padding-left: 1.2rem; margin: .4rem 0 1rem; } .steps li { margin-bottom: .35rem; }
.layout-bare .auth-card.install { max-width: 760px; }
.langswitch { display: inline-flex; gap: .45rem; align-items: center; }
.langswitch b { font-weight: 700; }
.langswitch a, .langswitch b { text-decoration: none; font-size: .8rem; letter-spacing: .03em; }
.usermenu .langswitch { padding-right: .6rem; border-right: 1px solid rgba(255,255,255,.2); }
.usermenu .langswitch b { color: #fff; }
.sitefoot .langswitch b { color: var(--text, #222); }

/* ---------- auth / scan ---------- */
.layout-bare .main { display: block; padding-top: 2rem; }
.auth { display: flex; justify-content: center; }
.auth-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 1.6rem; width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--navy); margin-bottom: 1.1rem; }
.auth-card h1 { margin-bottom: .8rem; }
.scan-state { border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .2rem; }
.scan-state b { font-size: 1.15rem; letter-spacing: .03em; }
.scan-state.ok { background: var(--ok-bg); color: var(--ok); }
.scan-state.warn { background: var(--warn-bg); color: var(--warn); }
.scan-state.bad { background: var(--bad-bg); color: var(--bad); }
.scan h2 { margin-top: 1.2rem; }

/* ---------- inspection form ---------- */
.checklist .section { margin: 1.1rem 0 .3rem; padding-bottom: .3rem; border-bottom: 2px solid var(--line); color: var(--navy-2); text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; }
.checklist .section:first-of-type { margin-top: .4rem; }
.checklist-tools { display: flex; justify-content: flex-end; }
.item { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.item .q { font-weight: 500; }
.item .guidance { margin-top: .2rem; font-weight: 400; }
.item .val { max-width: 220px; }
.item .toggle-extra { grid-column: 1 / -1; justify-self: start; padding-left: 0; color: var(--muted); }
.item-extra { grid-column: 1 / -1; display: none; gap: .5rem; flex-direction: column; }
.item.open .item-extra, .item.is-fail .item-extra { display: flex; }
.item.open .toggle-extra, .item.is-fail .toggle-extra { display: none; }
.item.is-fail { background: linear-gradient(90deg, var(--bad-bg), transparent 70%); margin: 0 -1.2rem; padding-left: 1.2rem; padding-right: 1.2rem; }
@media (max-width: 560px) { .item { grid-template-columns: 1fr; } .item .val { max-width: none; } }

.seg { display: inline-flex; border: 1px solid #cfd4de; border-radius: 9px; overflow: hidden; background: #fff; }
.seg label { margin: 0; font-weight: 600; font-size: .9rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .6rem .95rem; min-width: 62px; text-align: center; cursor: pointer; user-select: none; border-left: 1px solid #e3e6ec; }
.seg label:first-child span { border-left: 0; }
.seg-pass input:checked + span, .seg-yes input:checked + span { background: var(--ok); color: #fff; }
.seg-fail input:checked + span, .seg-no input:checked + span { background: var(--bad); color: #fff; }
.seg-na input:checked + span { background: #6b7280; color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.photos { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.thumb { position: relative; width: 78px; height: 78px; border-radius: 8px; overflow: hidden; background: #eceef2; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-del { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.thumb.loading { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }
.addphoto { flex-direction: row; cursor: pointer; }
.addphoto span { display: flex; align-items: center; justify-content: center; width: 78px; height: 78px; border: 2px dashed #cfd4de; border-radius: 8px; font-size: .8rem; color: var(--navy-2); text-align: center; }

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.res { margin: 0; }
.res input { position: absolute; opacity: 0; }
.res span { display: block; padding: .8rem; border: 2px solid #cfd4de; border-radius: 9px; text-align: center; cursor: pointer; font-weight: 700; }
.res-pass input:checked + span, .res-pass_with_notes input:checked + span { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.res-fail input:checked + span { border-color: var(--accent); background: var(--warn-bg); color: var(--warn); }
.res-remove_from_service input:checked + span { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }

.sigpad { border: 2px dashed #cfd4de; border-radius: 10px; background: #fff; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: 180px; cursor: crosshair; }
.sig-tools { margin-top: .5rem; display: flex; gap: .8rem; align-items: center; }

/* ---------- checklist editor ---------- */
.tpl-section { border-left: 4px solid var(--navy-2); }
.tpl-section-head { display: flex; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.tpl-section-head .sec-name { font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; color: var(--navy); }
.tpl-items { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .8rem; }
.tpl-item { border: 1px solid var(--line); border-radius: 9px; padding: .7rem; display: flex; flex-direction: column; gap: .5rem; background: #fafbfc; }
.tpl-item-main { display: grid; grid-template-columns: 1fr 170px; gap: .5rem; }
@media (max-width: 560px) { .tpl-item-main { grid-template-columns: 1fr; } }
.tpl-item .small-field { font-size: .85rem; min-height: 36px; }
.tpl-item-bar { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; font-size: .85rem; }
.tpl-item-bar .right { display: flex; gap: .3rem; }
.icon-btn { width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid #cfd4de; border-radius: 8px; background: #fff; cursor: pointer; font-size: .95rem; line-height: 1; color: var(--navy); }
.icon-btn:hover { border-color: var(--navy-2); }
.icon-btn.danger-text { color: var(--bad); }
#js-add-section { align-self: flex-start; }

/* ---------- standards & guidance ---------- */
.stack-tight { display: flex; flex-direction: column; gap: .35rem; }
.lbl { font-size: .88rem; }
.std-filter { margin-bottom: .4rem; }
.checklist-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: -.3rem; }
.std-picker { display: flex; flex-direction: column; gap: .4rem; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; padding: .5rem; background: #fafbfc; }
.std-option { border-radius: 7px; padding: .35rem .5rem; }
.std-option.on { background: #fff; box-shadow: 0 0 0 1px var(--line); }
.std-option label.check { align-items: baseline; flex-wrap: wrap; gap: .35rem; }
.std-guidance { display: none; margin: .4rem 0 .3rem 1.6rem; padding-left: .8rem; border-left: 3px solid var(--accent); }
.std-option.on .std-guidance { display: block; }
.guidance-body { font-size: .9rem; }
.guidance-body h4 { margin: .7rem 0 .25rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--navy-2); }
.guidance-body h4:first-child { margin-top: 0; }
.guidance-body ul { margin: 0 0 .4rem; padding-left: 1.2rem; }
.guidance-body li { margin: .15rem 0; }
.guidance-body p { margin: 0 0 .4rem; }
.guidance-panel { border: 1px solid var(--line); border-radius: 9px; margin-bottom: .5rem; background: #fff; }
.guidance-panel summary { cursor: pointer; padding: .65rem .8rem; list-style-position: inside; }
.guidance-panel[open] summary { border-bottom: 1px solid var(--line); }
.guidance-panel .guidance-body { padding: .7rem .9rem .5rem; }
.guidance-card { border-left: 4px solid var(--accent); }

/* ---------- certificate ---------- */
.certificate { background: #fff; max-width: 860px; margin: 0 auto; padding: 2rem 2.2rem; box-shadow: var(--shadow); border-radius: 4px; position: relative; }
.certificate.is-void::after { content: 'VOID'; position: absolute; top: 35%; left: 50%; transform: translate(-50%, -50%) rotate(-20deg); font-size: 9rem; font-weight: 900; color: rgba(180, 35, 24, .15); pointer-events: none; }
.cert-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--navy); padding-bottom: .8rem; }
.cert-logo { display: block; max-height: 56px; max-width: 240px; margin-bottom: .4rem; }
.logo-preview { max-height: 72px; max-width: 280px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }
.cert-company { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.cert-no { text-align: right; }
.cert-no .big { font-size: 1.35rem; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; }
.cert-result { margin: 1rem 0; padding: .8rem 1rem; border-radius: 8px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: 1.15rem; font-weight: 800; }
.cert-result.res-pass, .cert-result.res-pass_with_notes { background: var(--ok-bg); color: var(--ok); }
.cert-result.res-fail { background: var(--warn-bg); color: var(--warn); }
.cert-result.res-remove_from_service { background: var(--bad-bg); color: var(--bad); }
.cert-result .small { font-weight: 500; color: var(--text); }
.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 640px) { .cert-grid { grid-template-columns: 1fr; } .certificate { padding: 1.2rem; } }
.certificate h3 { color: var(--navy); border-bottom: 1px solid var(--line); padding-bottom: .25rem; }
.cert-table td, .cert-table th { padding: .4rem .5rem; font-size: .88rem; }
.cert-table tr.sec td { background: #f3f5f9; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--navy-2); }
.cert-table .w-res { width: 90px; text-align: center; }
.ans { font-weight: 700; }
.ans-pass, .ans-yes { color: var(--ok); }
.ans-fail, .ans-no { color: var(--bad); }
.ans-na { color: var(--muted); }
.cert-photos { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.cert-photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 4px; }
.cert-sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sigbox { width: 240px; height: 80px; border-bottom: 1px solid var(--text); display: flex; align-items: flex-end; justify-content: center; }
.sigbox img { max-width: 100%; max-height: 80px; }
.cert-foot { margin-top: 1rem; }

/* ---------- QR labels ---------- */
.layout-print .main { max-width: none; padding: 1rem; }
.labels-bar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.labels { display: flex; flex-wrap: wrap; gap: 4mm; }
.label { border: 1px dashed #bbb; border-radius: 3mm; padding: 2.5mm; display: flex; gap: 2.5mm; align-items: center; background: #fff; break-inside: avoid; page-break-inside: avoid; }
.label .qr { padding: 0; }
.label-text { line-height: 1.15; min-width: 0; }
.label-co { font-weight: 800; color: var(--navy); }
.label-cat { font-weight: 600; }
.label-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; }
.label-sub, .label-hint { color: #555; }
.size-s .label { width: 60mm; height: 30mm; font-size: 7pt; }
.size-s .qr svg { width: 24mm !important; height: 24mm !important; }
.size-m .label { width: 80mm; height: 40mm; font-size: 8.5pt; }
.size-m .qr svg { width: 34mm !important; height: 34mm !important; }
.size-l .label { width: 100mm; height: 55mm; font-size: 10pt; }
.size-l .qr svg { width: 48mm !important; height: 48mm !important; }

/* ---------- print ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .noprint, .flash, .labels-bar { display: none !important; }
  .main { padding: 0; max-width: none; }
  .certificate { box-shadow: none; padding: 0; max-width: none; }
  .label { border-color: #ddd; }
  a { color: inherit; text-decoration: none; }
  .cert-result, .badge, .cert-table tr.sec td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- billing ---------- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.plan { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 2px solid var(--line); border-radius: 12px; }
.plan-best { border-color: var(--accent); }
.plan-price { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.plan .btn { margin-top: .5rem; }
.inline-form { display: flex; gap: .6rem; align-items: center; }
.inline-form select { width: auto; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) { .plans { grid-template-columns: 1fr; } }

/* ---------- offline mode ---------- */
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.netstate { font-size: .82rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; }
.netstate.on { background: var(--ok-bg); color: var(--ok); }
.netstate.off { background: var(--warn-bg); color: var(--warn); }
.fl-list { list-style: none; margin: .4rem 0; padding: 0; }
.fl-list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.fl-list li:last-child { border-bottom: 0; }
.fl-list li > a, .fl-list li > span:first-child { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; color: inherit; min-width: 0; }
.fl-list li > a b { color: var(--navy-2); }
.fl-err { color: var(--bad); }
.fl-sync { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.fl-dl { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; align-items: end; }
.fl-set-actions { display: flex; gap: .3rem; flex-shrink: 0; }
.fl-synced { margin: .4rem 0; }
.fl-synced summary { cursor: pointer; color: var(--muted); }
#fl-search { margin: .3rem 0 .4rem; }
@media (max-width: 640px) { .fl-dl { grid-template-columns: 1fr; } }
