/* ============ Ignis — fire safety theme ============
   Cream canvas, dark-brown ink, fire red/orange accents.
   Inspired by editorial finance-portfolio style: huge two-tone
   display type, hairline rules, soft warm surfaces. */

:root {
  --bg: #faf5ec;
  --bg-soft: #f3ecdd;
  --surface: #fffdf8;
  --ink: #3a2e28;
  --ink-soft: #7d6f66;
  --ink-faint: #b3a89e;
  --line: #e7ddcc;
  --red: #d9402a;
  --red-dark: #b32e1c;
  --orange: #f08c1e;
  --amber: #e8b73a;
  --green: #4d8a4d;
  --green-soft: #e7f0e3;
  --red-soft: #fbe5e0;
  --orange-soft: #fdeed8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(58, 46, 40, 0.05), 0 8px 24px -12px rgba(58, 46, 40, 0.18);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(240, 140, 30, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(217, 64, 42, 0.05), transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(250, 245, 236, 0.7);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 26px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.sidebar .brand { font-size: 16px; }
.brand .flame { font-size: 20px; }
.brand .brand-accent { color: var(--red); }
.brand-sub { font-size: 11px; color: var(--ink-faint); font-weight: 500; margin-top: -24px; margin-bottom: 22px; letter-spacing: 0.06em; text-transform: uppercase; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14.5px;
  transition: all 0.15s;
}
.nav-link:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--ink); color: var(--bg); }
.nav-link .icon { width: 20px; text-align: center; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.user-chip { font-size: 13px; color: var(--ink-soft); line-height: 1.3; }
.user-chip strong { color: var(--ink); display: block; }

.main { flex: 1; padding: 34px 40px 80px; max-width: 1080px; }

/* Mobile bottom nav */
.bottomnav { display: none; }

@media (max-width: 760px) {
  .sidebar { display: none; }
  .main { padding: 20px 16px 96px; }
  .bottomnav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a {
    flex: 1;
    text-align: center;
    padding: 10px 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .bottomnav a .icon { font-size: 20px; }
  .bottomnav a.active { color: var(--red); }
  .bottomnav a:hover { text-decoration: none; }
}

/* ---------- Typography ---------- */

.page-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.page-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 26px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-soft);
  margin: 30px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Cards & stats ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--orange));
  opacity: 0;
}
.stat.hot::before { opacity: 1; }
.stat .stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-soft); }
.stat .stat-value { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.stat .stat-value.danger { color: var(--red); }
.stat .stat-value.good { color: var(--green); }

/* ---------- Tables / list rows ---------- */

.rows { display: flex; flex-direction: column; gap: 10px; }

.row-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s, transform 0.1s;
  cursor: pointer;
  color: inherit;
}
.row-card:hover { border-color: var(--ink-faint); text-decoration: none; }
.row-card.static { cursor: default; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 15px; }
.row-sub { font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { text-align: right; font-size: 13px; color: var(--ink-soft); flex-shrink: 0; }

.type-badge {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--orange-soft);
}
.type-badge.retired { filter: grayscale(1); opacity: 0.55; }

/* ---------- Pills ---------- */

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pill-red { background: var(--red-soft); color: var(--red-dark); }
.pill-orange { background: var(--orange-soft); color: #a35d0c; }
.pill-ok { background: var(--green-soft); color: var(--green); }
.pill-muted { background: var(--bg-soft); color: var(--ink-soft); }

/* ---------- Forms ---------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(240, 140, 30, 0.15);
}
.hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .field-row { grid-template-columns: 1fr; } }

.checkbox-field { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 14px 0; cursor: pointer; }
.checkbox-field input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--red); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--red), #e2571f);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(217, 64, 42, 0.5);
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-faint); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-danger { background: var(--red-soft); color: var(--red-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

/* ---------- Auth screens ---------- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

.auth-hero {
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.auth-hero .hero-brand { position: absolute; top: 40px; left: 56px; font-weight: 800; font-size: 20px; }
.auth-hero .hero-brand .script { font-family: 'Snell Roundhand', 'Segoe Script', cursive; font-weight: 400; font-size: 15px; color: var(--ink-soft); display: block; margin-bottom: 2px; }
.auth-hero h1 {
  font-size: clamp(48px, 6.5vw, 88px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.auth-hero h1 .accent { color: var(--orange); display: block; }
.auth-hero .hero-sub { margin-top: 18px; max-width: 420px; color: var(--ink-soft); font-size: 15px; }
.hero-spark {
  position: absolute;
  top: 12%; right: -8%;
  width: 380px; height: 380px;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.8;
}
.hero-spark::after {
  content: '';
  position: absolute;
  inset: 90px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.hero-flame { position: absolute; top: 20%; right: 14%; font-size: 68px; transform: rotate(-8deg); filter: drop-shadow(0 12px 24px rgba(240,140,30,.35)); }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 22px; }
.auth-alt { margin-top: 18px; font-size: 14px; color: var(--ink-soft); text-align: center; }

.lang-toggle {
  position: fixed;
  top: 18px; right: 20px;
  z-index: 50;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 12px; cursor: pointer; color: var(--ink-faint);
}
.lang-toggle button.active { background: var(--ink); color: var(--bg); }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(58, 46, 40, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 16px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface);
  border-radius: 18px;
  padding: 26px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px -12px rgba(58, 46, 40, 0.4);
}
.modal h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- Toast ---------- */

#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.25s;
  max-width: 90vw;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.35);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-err { background: var(--red-dark); color: #fff; }

/* ---------- Inspection flow ---------- */

.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
}
.check-item .check-label { flex: 1; font-size: 14.5px; font-weight: 500; }
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.seg button {
  border: 0; background: var(--surface); font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 14px; cursor: pointer; color: var(--ink-faint);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on-pass { background: var(--green-soft); color: var(--green); }
.seg button.on-fail { background: var(--red-soft); color: var(--red-dark); }
.check-item input[type='number'], .check-item input[type='text'] {
  width: 130px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit;
}

.result-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.result-toggle button {
  padding: 18px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--ink-faint);
}
.result-toggle button.sel-pass { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.result-toggle button.sel-fail { border-color: var(--red); background: var(--red-soft); color: var(--red-dark); }

.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb {
  width: 86px; height: 86px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .photo-x {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(58, 46, 40, 0.75);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.photo-add {
  width: 86px; height: 86px;
  border-radius: 12px;
  border: 1.5px dashed var(--ink-faint);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  color: var(--ink-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.photo-add span { font-size: 10.5px; font-weight: 600; }
.photo-add:hover { border-color: var(--orange); color: var(--ink); }

.sig-wrap { margin-bottom: 18px; }
.sig-canvas {
  width: 100%;
  height: 150px;
  border: 1.5px dashed var(--ink-faint);
  border-radius: 12px;
  background: #fff;
  touch-action: none;
  display: block;
  cursor: crosshair;
}
.sig-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.sig-hint { font-size: 12px; color: var(--ink-faint); }

/* Checklist template editor */
.tpl-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.tpl-item-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tpl-item-fields input, .tpl-item select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--ink);
}
.tpl-item-fields input:focus { outline: none; border-color: var(--orange); }
.tpl-item select { width: 108px; flex-shrink: 0; }
.tpl-item-btns { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.tpl-item-btns button {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-soft);
}
.tpl-item-btns button:hover:not(:disabled) { border-color: var(--ink-faint); color: var(--ink); }
.tpl-item-btns button:disabled { opacity: 0.35; cursor: default; }
.tpl-item-btns button.danger { color: var(--red-dark); }
@media (max-width: 560px) {
  .tpl-item { flex-wrap: wrap; }
  .tpl-item select { width: 100%; order: 3; }
  .tpl-item-btns { flex-direction: row; order: 4; }
}

.insp-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.insp-media a { display: block; }
.insp-media img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  background: #fff;
}
.insp-media img.sig { object-fit: contain; background: #fff; }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 10px 0; }
.qr-box svg { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr-code-text { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 18px; font-weight: 700; letter-spacing: 0.2em; }

/* ---------- Landing page ---------- */

.landing { overflow-x: hidden; }
.l-wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.l-nav { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; background: rgba(250, 245, 236, 0.85); backdrop-filter: blur(10px); }
.l-nav-inner { display: flex; align-items: center; gap: 26px; height: 62px; }
.l-nav-links { display: flex; gap: 22px; flex: 1; }
.l-nav-links a { color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.l-nav-links a:hover { color: var(--ink); text-decoration: none; }
.l-nav-cta { display: flex; align-items: center; gap: 10px; }
.l-nav .lang-toggle { position: static; }
@media (max-width: 640px) { .l-nav-links { display: none; } }

.l-hero { padding: 72px 0 84px; position: relative; }
.l-hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .l-hero-grid { grid-template-columns: 1fr; } .l-hero { padding: 44px 0 56px; } }

.l-display {
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.l-display .accent { color: var(--orange); display: block; }
.l-sub { margin-top: 20px; color: var(--ink-soft); font-size: 16.5px; line-height: 1.6; max-width: 520px; }
.l-cta-row { margin-top: 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.l-cta-note { font-size: 13px; color: var(--ink-faint); font-weight: 600; }

.l-hero-art { position: relative; min-height: 320px; }
.l-mock {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.l-mock-1 { top: 30px; left: 0; right: 18%; display: flex; align-items: center; gap: 12px; }
.l-mock-2 { top: 128px; right: 0; width: 46%; }
.l-mock-3 { top: 208px; left: 8%; width: 52%; }
@media (max-width: 860px) { .l-hero-art { display: none; } }

.l-section { padding: 64px 0; }
.l-section-alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.l-h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -0.03em; text-align: center; margin-bottom: 36px; }

.l-feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.l-feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.l-feat-icon { font-size: 26px; margin-bottom: 10px; }
.l-feat-t { font-weight: 800; font-size: 15.5px; letter-spacing: -0.01em; margin-bottom: 6px; }
.l-feat-d { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }

.l-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.l-step { text-align: center; padding: 0 8px; }
.l-step-n {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(217, 64, 42, 0.55);
}

.l-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; align-items: start; max-width: 940px; margin: 0 auto; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); position: relative; }
.plan-featured { border: 2px solid var(--red); box-shadow: 0 18px 44px -18px rgba(217, 64, 42, 0.35); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 99px; white-space: nowrap;
}
.plan-name { font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.plan-price { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 16px; }
.plan-price span { font-size: 13px; font-weight: 600; color: var(--ink-faint); letter-spacing: 0; }
.plan-feats { list-style: none; margin: 0 0 20px; display: flex; flex-direction: column; gap: 9px; }
.plan-feats li { font-size: 14px; padding-left: 22px; position: relative; }
.plan-feats li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800; }

.l-final { padding: 84px 0; }

.legal-body { max-width: 720px; padding-top: 40px; padding-bottom: 80px; }
.legal-body h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.legal-body .legal-date { color: var(--ink-faint); font-size: 13px; margin-bottom: 26px; }
.legal-body h3 { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; margin: 26px 0 8px; }
.legal-body p { font-size: 14.5px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 12px; }
.legal-body p strong { color: var(--ink); }
.l-footer { border-top: 1px solid var(--line); padding: 26px 0; }
.l-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }

/* ---------- QR label sheets ---------- */

.labels-page { max-width: 880px; margin: 0 auto; padding: 28px 24px 60px; }
.labels-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  background: #fff;
}
.label-card {
  border: 1.5px dashed #bbb;
  margin: -0.75px; /* collapse neighboring cut lines into one */
  padding: 16px 10px 12px;
  text-align: center;
  background: #fff;
  break-inside: avoid;
  page-break-inside: avoid;
}
.label-qr svg { width: 118px; height: 118px; display: inline-block; }
.label-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-weight: 700; font-size: 15px; letter-spacing: 0.18em; margin-top: 8px; color: #000; }
.label-info { font-size: 11.5px; font-weight: 700; margin-top: 4px; color: #222; }
.label-loc { font-size: 10px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-brand { font-size: 8.5px; color: #999; margin-top: 6px; letter-spacing: 0.04em; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff !important; }
  .labels-page { max-width: none; padding: 0; }
  #toast-root { display: none !important; }
}

/* ---------- Misc ---------- */

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 20px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  font-size: 14.5px;
}

.spinner-wrap { display: flex; justify-content: center; padding: 48px; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--ink-soft); font-weight: 600; }
.kv dd { font-weight: 500; }

.breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.breadcrumb a { color: var(--ink-soft); font-weight: 600; }
