/* HEB Prestart Briefing — iPad-first styling. */
:root {
  --heb-blue: #0054A6;
  --heb-blue-dark: #003e7d;
  --ink: #1d2733;
  --muted: #6b7785;
  --line: #d7dee6;
  --bg: #eef2f6;
  --card: #ffffff;
  --green: #2faa4f;
  --amber: #f4c20d;
  --orange: #f4900c;
  --red: #d61f1f;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(20, 40, 70, 0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
#app { min-height: 100%; padding-bottom: env(safe-area-inset-bottom); }

h1 { font-size: 26px; margin: 0; }
h2 { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 16px; }
.hint { color: var(--muted); font-size: 14px; }
.hint.pad { padding: 16px; }

/* ---------- app bar ---------- */
.app-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 8px 14px; padding-top: calc(8px + env(safe-area-inset-top));
  box-shadow: var(--shadow);
}
.app-logo { height: 34px; }
.app-title { color: var(--muted); font-weight: 600; }
.bar-title {
  flex: 1; border: none; font-size: 18px; font-weight: 600;
  padding: 8px 10px; border-radius: 8px; background: #f3f6f9; min-width: 120px;
}
.bar-title:focus { outline: 2px solid var(--heb-blue); background: #fff; }
.save-state { color: var(--green); font-size: 13px; font-weight: 600; min-width: 64px; text-align: right; }

/* ---------- buttons ---------- */
.tool-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 10px 14px; border-radius: 10px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.1;
}
.tool-btn:active { transform: translateY(1px); }
.tool-btn.primary { background: var(--heb-blue); color: #fff; border-color: var(--heb-blue); }
.tool-btn.ghost { background: #f3f6f9; color: var(--muted); }
.tool-btn.small { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.tool-btn.big { padding: 14px 20px; font-size: 17px; }
.tool-btn.active { background: var(--heb-blue); color: #fff; border-color: var(--heb-blue); }

/* ---------- home ---------- */
.home-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 20px 18px 8px; flex-wrap: wrap;
}
.brief-list { padding: 8px 18px 40px; display: grid; gap: 12px; }
.brief-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
}
.brief-main { flex: 1; min-width: 0; }
.brief-title { font-weight: 700; font-size: 17px; }
.brief-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- tabs ---------- */
.tabs {
  position: sticky; top: 51px; z-index: 20;
  display: flex; gap: 4px; background: #fff; padding: 6px 10px;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.tab {
  border: none; background: transparent; color: var(--muted);
  padding: 10px 16px; border-radius: 10px; font-size: 15px; font-weight: 600; white-space: nowrap;
}
.tab.active { background: var(--heb-blue); color: #fff; }

/* ---------- panels / sections ---------- */
.panel { padding: 16px; max-width: 1100px; margin: 0 auto; }
.section-title {
  font-size: 15px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--heb-blue); font-weight: 800; margin: 22px 0 10px;
  border-bottom: 2px solid var(--heb-blue); padding-bottom: 6px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; margin-top: 12px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field textarea, .pf-field input, .pf-field textarea, .sign-cell input {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  background: #fff; width: 100%; color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .pf-field input:focus, .pf-field textarea:focus {
  outline: none; border-color: var(--heb-blue); box-shadow: 0 0 0 3px rgba(0,84,166,.15);
}

/* ---------- attachments ---------- */
.attach-box { margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.attach-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; background: #f3f6f9; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.attach-name { font-size: 14px; font-weight: 600; }
.attach-name.link { color: var(--heb-blue); text-decoration: underline; cursor: pointer; }
.attach-rm, .lib-del { border: none; background: transparent; color: var(--muted); font-size: 15px; padding: 2px 4px; }
.lib-kind { background: var(--heb-blue); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- permits ---------- */
.permit-table { display: grid; gap: 8px; }
.permit-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.permit-row.on { border-left-color: var(--heb-blue); }
.permit-name { font-weight: 700; flex: 1; min-width: 160px; }
.req-toggle { border: 1px solid var(--line); background: #f3f6f9; color: var(--muted); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.req-toggle.on { background: var(--green); color: #fff; border-color: var(--green); }
.permit-exp-wrap { display: flex; flex-direction: column; }
.mini-label { font-size: 11px; color: var(--muted); font-weight: 700; }
.permit-expiry { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; }
.permit-status { width: 100%; font-size: 13px; color: var(--heb-blue); font-weight: 600; }
.permit-numinput { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; min-width: 110px; }
.permit-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- permit / generic forms ---------- */
.permit-form { display: grid; gap: 14px; }
.pf-field { display: flex; flex-direction: column; gap: 6px; }
.pf-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.pf-field textarea { min-height: 70px; }
.pf-yesno, .pf-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-yesno button, .pf-checks button {
  border: 1px solid var(--line); background: #f3f6f9; color: var(--ink);
  border-radius: 8px; padding: 9px 14px; font-weight: 600;
}
.pf-yesno button.active, .pf-checks button.active { background: var(--heb-blue); color: #fff; border-color: var(--heb-blue); }
.pf-yesno.tiny button, .pf-checks.tiny button { padding: 5px 9px; font-size: 12px; }

/* permit sections, notes, lists, tables, sign blocks */
.pf-section { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--heb-blue); border-bottom: 2px solid var(--heb-blue); padding-bottom: 5px; margin-top: 8px; }
.pf-note { font-size: 13px; color: var(--muted); background: #f3f6f9; border-left: 3px solid var(--line); padding: 8px 12px; border-radius: 6px; margin: 0; line-height: 1.45; }
.pf-ynrow, .pf-insprow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.pf-ynlabel { flex: 1; min-width: 180px; font-size: 14px; }
.pf-initials { width: 64px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; }
.pf-tablewrap { gap: 8px; }
.pf-table { display: grid; gap: 4px; overflow-x: auto; }
.pf-trow { display: flex; gap: 6px; align-items: center; min-width: max-content; }
.pf-thead { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.pf-tcell { min-width: 120px; }
.pf-tcell input { padding: 8px 9px; }
.pf-tcell-rm { min-width: 36px; display: flex; justify-content: center; }
.pf-trm { border: none; background: transparent; color: var(--red); font-size: 15px; }
.pf-sign { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pf-signgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pf-subfield { display: flex; flex-direction: column; gap: 4px; }
.pf-sublabel { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------- library picker ---------- */
.lib-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.lib-list { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.lib-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.lib-item.selected { border-color: var(--heb-blue); background: #eef5ff; }
.lib-name { flex: 1; font-weight: 600; }
.lib-name em { color: var(--muted); font-weight: 400; }

/* ---------- hazards ---------- */
.haz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.haz-table { display: grid; gap: 6px; margin-top: 10px; }
.haz-row {
  display: grid; grid-template-columns: 1.4fr 1.6fr .7fr 1.6fr .7fr .7fr;
  gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; align-items: center;
}
.haz-headrow { background: var(--heb-blue); color: #fff; font-weight: 700; font-size: 13px; position: sticky; }
.haz-headrow .haz-cell { color: #fff; }
.haz-cell { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.haz-cell.sqe { display: flex; gap: 4px; }
.sqe-tag { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: #eef2f6; color: #b9c3cd; }
.sqe-tag.on.s { background: var(--heb-blue); color: #fff; }
.sqe-tag.on.q { background: #6f42c1; color: #fff; }
.sqe-tag.on.e { background: var(--green); color: #fff; }
.haz-cell.actions { display: flex; gap: 6px; }
.rating-badge { display: inline-block; padding: 5px 10px; border-radius: 8px; font-weight: 800; font-size: 13px; }

@media (max-width: 760px) {
  .haz-row { grid-template-columns: 1fr 1fr; }
  .haz-headrow { display: none; }
  .haz-cell::before { content: attr(data-l); }
}

/* risk chart */
.risk-chart { margin-top: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.risk-chart summary { font-weight: 700; cursor: pointer; color: var(--heb-blue); }
.rc-tbl { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12px; }
.rc-tbl th, .rc-tbl td { border: 1px solid #fff; padding: 8px 6px; text-align: center; }
.rc-tbl th { background: #e7edf3; color: var(--ink); }
.rc-tbl td { font-weight: 800; }

/* ---------- sign-off ---------- */
.sign-table { display: grid; gap: 6px; margin-top: 12px; }
.sign-row { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 1.4fr auto; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.sign-head { background: #e7edf3; font-weight: 700; font-size: 13px; }
.sign-cell { min-width: 0; }
.sign-sigcell { display: flex; align-items: center; gap: 8px; }
.sign-thumb { height: 34px; max-width: 110px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
@media (max-width: 760px) { .sign-row { grid-template-columns: 1fr 1fr; } .sign-head { display: none; } }

/* permit signature row + thumbnail */
.pf-sigrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pf-sigthumb { height: 40px; max-width: 160px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* signature pad */
.sig-wrap { display: flex; flex-direction: column; gap: 8px; }
.sig-pad { position: relative; border: 2px dashed var(--line); border-radius: 12px; background: #fff; overflow: hidden; touch-action: none; }
.sig-canvas { display: block; width: 100%; touch-action: none; }
.sig-baseline { position: absolute; left: 6%; right: 6%; bottom: 26%; border-bottom: 2px solid #cdd7e1; pointer-events: none; }

/* ---------- sketch ---------- */
.sketch-mount { margin-top: 6px; }
.sketch-host { display: flex; flex-direction: column; gap: 10px; }
.sketch-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; position: sticky; top: 104px; z-index: 15; }
.tool-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.poly-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #eef5ff; border: 1px solid var(--heb-blue); border-radius: 10px; padding: 8px 12px; }
.poly-count { font-weight: 700; color: var(--heb-blue); margin-right: auto; }
.pen-colors, .pen-widths { display: flex; gap: 6px; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.active { box-shadow: 0 0 0 3px var(--heb-blue); }
.wbtn { width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 8px; display: grid; place-items: center; }
.wbtn span { background: var(--ink); border-radius: 50%; display: block; }
.wbtn.active { border-color: var(--heb-blue); box-shadow: 0 0 0 2px rgba(0,84,166,.2); }

.stamp-palette { display: flex; gap: 14px; overflow-x: auto; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.stamp-group-title { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.stamp-row { display: flex; gap: 6px; }
.stamp-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 8px; width: 72px; }
.stamp-btn span { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.1; }
.stamp-btn:active { background: #eef5ff; }

.stamp-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: #0b2e52; color: #fff; border-radius: 10px; padding: 8px 12px; }
.se-title { font-weight: 800; font-size: 14px; margin-right: 4px; }
.se-labelwrap { display: flex; align-items: center; gap: 6px; }
.se-mini { font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .04em; }
.se-label { border: none; border-radius: 8px; padding: 7px 10px; font-size: 14px; width: 140px; }
.se-colors { display: flex; gap: 5px; }
.se-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); }
.se-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px #fff; }
.se-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.se-btn { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 7px 11px; font-weight: 700; font-size: 14px; }
.se-btn.danger { background: var(--red); border-color: var(--red); }
.se-btn.ghost { background: #fff; color: #0b2e52; }

.stamp-label { position: absolute; left: 50%; bottom: -8px; transform: translate(-50%, 100%); white-space: nowrap; background: rgba(255,255,255,.92); color: #1d2733; border: 2px solid var(--heb-blue); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; pointer-events: none; }

.sketch-stage { position: relative; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; touch-action: none; }
.sketch-canvas { display: block; touch-action: none; }
.sketch-stamps { position: absolute; inset: 0; }
.stamp { position: absolute; touch-action: none; }
.stamp svg { width: 100%; height: 100%; display: block; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.stamp.selected { outline: 2px dashed var(--heb-blue); outline-offset: 2px; }
.stamp-handle { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--heb-blue); color: #fff; display: grid; place-items: center; font-size: 14px; border: 2px solid #fff; box-shadow: var(--shadow); }
.handle-del { top: -13px; right: -13px; background: var(--red); }
.handle-scale { bottom: -13px; right: -13px; }
.handle-rot { bottom: -13px; left: -13px; background: var(--green); }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,30,50,.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-card.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; color: var(--heb-blue); }
.modal-x { border: none; background: #f3f6f9; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; opacity: 0; transition: .25s; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- hazard flow wizard ---------- */
.flow-overlay { position: fixed; inset: 0; background: rgba(10,25,45,.55); display: grid; place-items: center; z-index: 150; padding: 16px; }
.flow-card { background: #fff; border-radius: 18px; width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.35); overflow: hidden; }
.flow-head { background: var(--heb-blue); color: #fff; padding: 18px 20px; position: relative; }
.flow-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; opacity: .85; font-weight: 700; }
.flow-prompt { font-size: 21px; font-weight: 800; margin-top: 4px; }
.flow-hint { font-size: 13px; opacity: .9; margin-top: 8px; line-height: 1.4; }
.flow-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.2); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 15px; }
.flow-body { padding: 20px; overflow: auto; flex: 1; }
.flow-textarea { width: 100%; min-height: 160px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 17px; resize: vertical; }
.flow-textarea:focus { outline: none; border-color: var(--heb-blue); box-shadow: 0 0 0 3px rgba(0,84,166,.15); }
.flow-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.flow-dots { display: flex; gap: 6px; }
.flow-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.flow-dots .dot.on { background: var(--heb-blue); transform: scale(1.25); }
.flow-dots .dot.done { background: var(--green); }

.flow-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.flow-cat { border: 2px solid var(--line); background: #f7f9fb; border-radius: 14px; padding: 22px 10px; font-size: 17px; font-weight: 700; color: var(--muted); }
.flow-cat.active.cat-s { background: var(--heb-blue); border-color: var(--heb-blue); color: #fff; }
.flow-cat.active.cat-q { background: #6f42c1; border-color: #6f42c1; color: #fff; }
.flow-cat.active.cat-e { background: var(--green); border-color: var(--green); color: #fff; }

.flow-scale { display: grid; gap: 10px; }
.flow-scale-btn { display: flex; align-items: center; gap: 14px; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 16px; text-align: left; }
.flow-scale-btn .num { width: 38px; height: 38px; border-radius: 10px; background: #eef2f6; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.flow-scale-btn .lab { font-size: 17px; font-weight: 600; }
.flow-scale-btn.active { border-color: var(--heb-blue); background: #eef5ff; }
.flow-scale-btn.active .num { background: var(--heb-blue); color: #fff; }

.flow-result { display: grid; gap: 16px; place-items: center; text-align: center; }
.result-badge { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; }
.rb-band { font-size: 40px; font-weight: 900; line-height: 1; }
.rb-score { font-size: 18px; font-weight: 700; }
.result-tbl { width: 100%; border-collapse: collapse; }
.result-tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.result-tbl td:first-child { color: var(--muted); font-weight: 700; width: 40%; }

/* ================= PRINT / PDF EXPORT ================= */
#print-root { display: none; }
@media screen { #print-root { display: none !important; } }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  #app, .modal-overlay, .flow-overlay, .toast { display: none !important; }
  #print-root { display: block !important; color: #1d2733; font-size: 11px; }

  .pr-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid var(--heb-blue); padding-bottom: 8px; margin-bottom: 10px; }
  .pr-logo { height: 40px; }
  .pr-headtext h1 { font-size: 18px; margin: 0; color: var(--heb-blue); }
  .pr-ref { font-size: 12px; color: #555; margin-top: 2px; }

  .pr-section { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--heb-blue); padding: 4px 8px; border-radius: 4px; margin: 12px 0 6px; break-after: avoid; }
  .pr-kvgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
  .pr-kv { display: flex; gap: 6px; border-bottom: 1px solid #e3e9ef; padding: 2px 0; break-inside: avoid; }
  .pr-kv.wide { grid-column: 1 / -1; }
  .pr-kv-key { font-weight: 700; color: #555; min-width: 120px; }
  .pr-kv-val { flex: 1; white-space: pre-wrap; }

  .pr-permit { border: 1px solid var(--heb-blue); border-radius: 6px; padding: 6px 8px; margin-bottom: 8px; break-inside: avoid; }
  .pr-permit-title { font-weight: 800; color: var(--heb-blue); margin-bottom: 4px; }
  .pr-permit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }

  .pr-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
  .pr-table th { background: var(--heb-blue); color: #fff; font-size: 10px; text-align: left; padding: 4px 6px; }
  .pr-table td { border: 1px solid #cfd8e3; padding: 4px 6px; vertical-align: top; }

  .pr-sketch { display: block; width: 100%; max-height: 150mm; object-fit: contain; border: 1px solid #cfd8e3; border-radius: 6px; margin-top: 6px; break-inside: avoid; }
  .pr-sig { display: block; height: 16mm; max-width: 60mm; }
  .pr-foot { margin-top: 14px; padding-top: 6px; border-top: 1px solid #cfd8e3; font-size: 9px; color: #888; }
}
