:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #66717d;
  --line: #d8dee5;
  --line-dark: #aeb7c1;
  --soft: #f3f5f7;
  --paper: #ffffff;
  --red: #d92d28;
  --red-dark: #b8201c;
  --teal: #087f72;
  --amber: #a36500;
  --navy: #182633;
  --navy-2: #263746;
  --shadow: 0 16px 40px rgba(23, 33, 43, 0.09);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #edf0f3; color: var(--ink); font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  padding: 12px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; gap: 14px; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: 184px; max-height: 40px; object-fit: contain; object-position: left center; }
.brand-copy { display: grid; line-height: 1.08; }
.brand-copy b { font-size: 0.95rem; }
.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.header-actions { display: flex; gap: 10px; align-items: center; }
.save-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.82rem; margin-right: 6px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #d6f0eb; }
.save-state.saving i { background: var(--amber); box-shadow: 0 0 0 3px #fff0cb; }

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 15px;
  font-weight: 750;
  transition: 0.18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .category-tab:focus-visible, .phase-button:focus-visible, .icon-button:focus-visible {
  outline: 3px solid rgba(217, 45, 40, 0.25);
  outline-offset: 2px;
}
.button-primary { background: var(--red); color: white; box-shadow: 0 8px 18px rgba(217, 45, 40, 0.2); }
.button-primary:hover { background: var(--red-dark); }
.button-ghost { color: var(--ink); background: white; border-color: var(--line); }
.button-secondary { background: var(--navy); color: white; margin-left: auto; }
.button-line { color: white; background: #06c755; border-color: #06c755; }
.button-line:hover { background: #05ad49; }
.button-large { min-height: 48px; padding-inline: 22px; }
.text-action { margin-left: auto; color: var(--red-dark); background: none; border: 0; font-weight: 750; }

.workspace { width: min(1220px, calc(100% - 36px)); margin: 0 auto; padding: 32px 0 72px; }
.overview { display: grid; grid-template-columns: minmax(280px, 1fr) auto; align-items: end; gap: 36px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; color: var(--red); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.05; letter-spacing: -0.04em; }
.overview p:last-child { color: var(--muted); margin: 8px 0 0; }
.metrics { min-width: 430px; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--navy); color: white; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.metrics article { min-width: 0; padding: 16px 18px; border-right: 1px solid rgba(255, 255, 255, 0.12); }
.metrics article:last-child { border-right: 0; }
.metrics span { display: block; font: 760 1.45rem/1 Arial, sans-serif; }
.metrics small { display: block; margin-top: 6px; color: #b9c2cb; white-space: nowrap; }

.panel { margin-top: 18px; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 18px rgba(22, 32, 43, 0.04); }
.section-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.step { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: #fcebea; color: var(--red); font: 800 0.83rem/1 Arial, sans-serif; }
.section-heading h2 { margin: 0; font-size: 1.12rem; }
.section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.section-count { margin-left: auto; padding: 5px 10px; color: var(--muted); background: var(--soft); border-radius: 20px; font-size: 0.78rem; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 20px; }
label { display: grid; gap: 7px; min-width: 0; }
label > span, .field-label { font-size: 0.82rem; font-weight: 750; color: #46515c; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #cfd5dc; border-radius: 7px; outline: none; }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(24, 38, 51, 0.09); }
.span-2 { grid-column: span 2; }

.category-tabs { display: flex; gap: 7px; padding: 18px 0; overflow-x: auto; }
.category-tab { white-space: nowrap; min-height: 40px; padding: 7px 12px; color: #4d5863; background: var(--soft); border: 1px solid transparent; border-radius: 7px; }
.category-tab b { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 6px; padding: 0 6px; color: #69737c; background: white; border-radius: 10px; font-size: 0.72rem; }
.category-tab.active { color: white; background: var(--navy); }
.category-tab.active b { color: var(--navy); }
.empty-state { padding: 44px 20px; text-align: center; border: 1px dashed var(--line-dark); border-radius: 10px; background: #fbfcfd; }
.empty-state strong { display: block; font-size: 1.02rem; }
.empty-state p { margin: 6px 0 17px; color: var(--muted); }

.equipment-card { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.equipment-card:first-child { margin-top: 0; }
.equipment-card[open] { box-shadow: 0 10px 24px rgba(23, 33, 43, 0.07); border-color: #c7cfd7; }
.equipment-summary { list-style: none; display: grid; grid-template-columns: 46px minmax(150px, 1fr) minmax(130px, 0.7fr) auto 34px; align-items: center; gap: 12px; padding: 14px 16px; background: #fafbfc; cursor: pointer; }
.equipment-summary::-webkit-details-marker { display: none; }
.equipment-summary:hover { background: #f5f7f9; }
.equipment-index { color: #929ca6; font: 800 1.25rem/1 Arial, sans-serif; }
.equipment-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipment-summary small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-status { justify-self: end; padding: 5px 9px; border-radius: 20px; font-size: 0.74rem; font-weight: 800; }
.summary-status.complete { color: #08675d; background: #d9f1ed; }
.summary-status.pending { color: #875800; background: #fff0c9; }
.summary-status.issue { color: #a11c18; background: #fde3e1; }
.summary-chevron { font-size: 1.15rem; transform: rotate(90deg); transition: transform 0.16s ease; }
.equipment-card[open] .summary-chevron { transform: rotate(270deg); }
.equipment-body { padding: 18px; border-top: 1px solid var(--line); }
.equipment-meta { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr) minmax(130px, 0.55fr) auto; gap: 14px; align-items: end; margin-bottom: 18px; }
.icon-button { width: 44px; height: 44px; color: #a52521; background: #fff4f3; border: 1px solid #f0cfcc; border-radius: 7px; font-weight: 800; }
.check-section { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.check-section h3 { margin: 0; padding: 10px 13px; background: #eef1f4; font-size: 0.9rem; }
.check-row { display: grid; grid-template-columns: minmax(250px, 1fr) 190px minmax(180px, 0.75fr); gap: 12px; align-items: center; min-height: 56px; padding: 7px 12px; border-top: 1px solid #e3e7eb; }
.check-row:first-of-type { border-top: 0; }
.check-row > span { line-height: 1.3; }
.check-row small { display: block; margin-top: 2px; color: var(--muted); }
.check-row input, .check-row select { min-height: 38px; padding-block: 7px; }
.check-row.is-issue { background: #fff8f7; }
.check-row.is-issue select { color: #a11c18; border-color: #efb9b5; }
.result-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.result-button { min-height: 38px; padding: 6px 8px; color: #51606c; background: #fff; border: 1px solid #cfd5dc; border-radius: 6px; font-weight: 750; }
.result-button:hover { border-color: #8d99a4; }
.result-button.active-pass { color: #08675d; background: #e2f4ef; border-color: #89c9bc; }
.result-button.active-fix { color: #a11c18; background: #fde9e7; border-color: #e9aaa5; }
.result-evidence { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; min-height: 20px; color: #78828b; font-size: 0.7rem; }
.result-evidence.ready { color: #087f72; }
.equipment-note { margin-top: 15px; }

.photo-toolbar { display: grid; grid-template-columns: minmax(250px, 1fr) auto; align-items: end; gap: 18px; padding-top: 18px; }
.phase-picker { margin: 0; padding: 0; border: 0; }
.phase-picker legend { margin-bottom: 7px; font-size: 0.82rem; font-weight: 750; color: #46515c; }
.phase-button { min-height: 42px; padding: 8px 16px; color: #53606c; background: var(--soft); border: 1px solid var(--line); }
.phase-button:first-of-type { border-radius: 7px 0 0 7px; }
.phase-button:last-of-type { border-radius: 0 7px 7px 0; }
.phase-button + .phase-button { margin-left: -1px; }
.phase-button.active { position: relative; z-index: 1; color: white; background: var(--navy); border-color: var(--navy); }
.dropzone { margin-top: 16px; min-height: 132px; place-items: center; align-content: center; gap: 4px; text-align: center; background: #fafbfc; border: 1px dashed #aeb8c1; border-radius: 10px; cursor: pointer; transition: 0.16s ease; }
.dropzone:hover, .dropzone.dragging { background: #f3f6f8; border-color: var(--navy); }
.dropzone.disabled { opacity: 0.58; cursor: not-allowed; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone small { color: var(--muted); }
.upload-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 4px; color: white; background: var(--navy); border-radius: 50%; font-size: 1.2rem; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.photo-card { position: relative; margin: 0; overflow: hidden; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-card figcaption { padding: 7px 9px; color: var(--muted); font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-remove { position: absolute; top: 7px; right: 7px; width: 30px; height: 30px; color: white; background: rgba(22, 32, 43, 0.82); border: 0; border-radius: 50%; font-weight: 800; }
.photo-empty { grid-column: 1 / -1; margin: 0; padding: 10px 0 0; color: var(--muted); font-size: 0.88rem; }

.issues-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.issues-table th { padding: 10px; text-align: left; color: #4f5a65; background: var(--soft); font-size: 0.78rem; }
.issues-table td { padding: 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.issues-table td:first-child { width: 38px; color: var(--muted); }
.issues-table input { min-height: 38px; }
.issue-source strong, .issue-source small { display: block; }
.issue-source small { margin-top: 2px; color: var(--muted); }
.issue-name { color: #a11c18; font-weight: 750; }
.issues-empty { padding: 32px 12px 16px; text-align: center; color: var(--muted); }
.issues-empty strong { display: block; margin-bottom: 4px; color: var(--teal); }

.signoff-grid { grid-template-columns: repeat(4, 1fr); }
.esign-panel { margin-top: 18px; padding: 18px; background: #f7faf9; border: 1px solid #bfd9d3; border-radius: 10px; transition: 0.18s ease; }
.esign-panel.locked { background: #f6f7f8; border-color: var(--line); }
.esign-heading, .esign-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.esign-heading h3 { margin: 0; font-size: 1rem; }
.esign-heading p { margin: 3px 0 0; color: var(--muted); font-size: 0.82rem; }
.esign-status { flex: 0 0 auto; padding: 5px 10px; color: #875800; background: #fff0c9; border-radius: 20px; font-size: 0.76rem; font-weight: 800; }
.esign-status.signed { color: #08675d; background: #d9f1ed; }
.signature-pad-wrap { position: relative; margin-top: 14px; overflow: hidden; background: white; border: 1px dashed #8da49f; border-radius: 8px; }
.signature-canvas { display: block; width: 100%; height: 210px; touch-action: none; cursor: crosshair; }
.signature-canvas:focus-visible { outline: 3px solid rgba(8, 127, 114, 0.2); outline-offset: -3px; }
.signature-lock { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #6f7880; background: rgba(246, 247, 248, 0.94); font-size: 0.86rem; }
.esign-panel:not(.locked) .signature-lock { display: none; }
.esign-actions { margin-top: 11px; }
.esign-actions small { color: var(--muted); }
.esign-actions .button:disabled { opacity: 0.48; cursor: not-allowed; transform: none; }
.work-order-upload { position: relative; }
.work-order-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.work-order-upload b { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; color: #4d5964; background: #fafbfc; border: 1px dashed #aeb8c1; border-radius: 7px; cursor: pointer; font-size: 0.83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-order-preview { margin-top: 16px; }
.work-order-preview figure { display: flex; align-items: center; gap: 14px; margin: 0; padding: 10px; background: var(--soft); border-radius: 8px; }
.work-order-preview img { width: 76px; height: 76px; object-fit: cover; border-radius: 5px; }
.work-order-preview figcaption { flex: 1; }
.work-order-preview button { color: #a11c18; background: transparent; border: 0; font-weight: 750; }

.finish-bar { position: sticky; bottom: 18px; z-index: 15; display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 15px 17px; color: white; background: var(--navy); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; box-shadow: 0 18px 36px rgba(20, 29, 37, 0.2); }
.finish-bar > div { flex: 1; display: grid; }
.finish-bar span { margin-top: 2px; color: #bdc6ce; font-size: 0.8rem; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 80; max-width: 360px; padding: 12px 16px; color: white; background: var(--navy); border-radius: 8px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: 0.2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.inspection-dialog { width: min(520px, calc(100% - 24px)); max-width: none; padding: 0; color: var(--ink); background: white; border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(10, 18, 25, 0.28); }
.inspection-dialog::backdrop { background: rgba(11, 20, 28, 0.68); backdrop-filter: blur(3px); }
.inspection-modal { padding: 24px; }
.inspection-modal-head { display: flex; align-items: center; justify-content: space-between; }
.inspection-state { padding: 5px 10px; color: #08675d; background: #dff3ee; border-radius: 20px; font-size: 0.76rem; font-weight: 800; }
.inspection-state.issue { color: #a11c18; background: #fde4e2; }
.modal-close { width: 36px; height: 36px; color: #596670; background: #f1f3f5; border: 0; border-radius: 50%; font-size: 1.3rem; }
.inspection-modal h2 { margin: 18px 0 4px; font-size: 1.35rem; }
.inspection-modal > p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.abnormal-field { margin-bottom: 14px; }
.abnormal-field[hidden] { display: none; }
.camera-action { min-height: 150px; place-items: center; align-content: center; gap: 4px; text-align: center; background: #f7f9fa; border: 1px dashed #99a7b3; border-radius: 10px; cursor: pointer; }
.camera-action input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.camera-action small { color: var(--muted); }
.camera-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 4px; color: white; background: var(--navy); border: 5px solid #d9e0e6; border-radius: 50%; font-size: 0.8rem; }
.inspection-preview { margin-top: 12px; }
.inspection-preview figure { display: grid; grid-template-columns: 82px 1fr; gap: 12px; align-items: center; margin: 0; padding: 8px; background: #eef6f4; border: 1px solid #c6e2dc; border-radius: 8px; }
.inspection-preview img { width: 82px; height: 68px; object-fit: cover; border-radius: 5px; }
.inspection-preview strong, .inspection-preview small { display: block; }
.inspection-preview small { margin-top: 3px; color: var(--muted); }
.inspection-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.inspection-actions .button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.report-dialog { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; background: #d9dde1; }
.report-dialog::backdrop { background: rgba(10, 17, 24, 0.65); }
.report-toolbar { position: sticky; top: 0; z-index: 5; min-height: 66px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px clamp(16px, 4vw, 48px); color: white; background: #101a23; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); }
.report-toolbar > div { margin-right: auto; display: grid; }
.report-toolbar span { color: #aeb8c0; font-size: 0.78rem; }
.report-download { margin-left: 0; background: #2b4152; }
.report-stage { min-height: calc(100vh - 66px); padding: 28px 20px 70px; overflow: auto; }
#reportRoot { display: grid; justify-content: center; gap: 24px; }

.report-page { position: relative; width: 794px; min-height: 1123px; padding: 52px 50px 45px; background: white; color: #15191d; box-shadow: 0 10px 32px rgba(20, 29, 37, 0.14); font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif; font-size: 11px; }
.report-page.landscape { width: 1123px; min-height: 794px; padding: 36px 38px 34px; }
.report-page h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.report-page p { margin: 0; }
.report-accent-title { position: relative; padding-left: 12px; }
.report-accent-title::before { content: ""; position: absolute; left: 0; top: 2px; width: 4px; height: 18px; background: var(--red); }
.report-kicker { margin-top: 3px !important; color: #7c838a; font-size: 9px; }
.report-footer { position: absolute; left: 50px; right: 50px; bottom: 16px; display: flex; justify-content: space-between; color: #858b91; font-size: 8px; letter-spacing: 0.02em; }
.report-page.landscape .report-footer { left: 38px; right: 38px; }

.cover-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 13px; border-bottom: 2px solid var(--red); }
.cover-logo { display: block; width: 230px; max-height: 48px; object-fit: contain; object-position: left center; }
.cover-report-name { text-align: right; }
.cover-report-name strong { display: block; font-size: 14px; }
.cover-report-name small { color: var(--red); font-size: 8px; letter-spacing: 0.22em; text-transform: uppercase; }
.cover-branch { margin: 38px 0 30px; }
.cover-branch h1 { margin: 0; font-size: 34px; letter-spacing: -0.03em; }
.cover-branch p { margin-top: 4px; color: #7c838a; }
.cover-details { width: 100%; border-collapse: collapse; }
.cover-details tr { border-bottom: 1px solid #e1e4e7; }
.cover-details th, .cover-details td { padding: 11px 3px; vertical-align: top; text-align: left; }
.cover-details th { width: 34%; color: #858b91; font-weight: 500; }
.cover-details td { font-weight: 650; }
.cover-status { color: #1b695f; }
.cover-footnote { margin-top: 9px !important; color: #8b9197; font-size: 8px; }

.checklist-head { display: flex; align-items: end; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #d9dde1; }
.checklist-meta { text-align: right; color: #777f86; font-size: 9px; }
.report-table { width: 100%; margin-top: 10px; border-collapse: collapse; table-layout: fixed; }
.report-table th, .report-table td { padding: 5px 6px; border: 1px solid #aeb4b9; text-align: center; vertical-align: middle; overflow-wrap: anywhere; }
.report-table th { background: #f1f2f3; }
.report-table th:first-child, .report-table td:first-child { width: 30%; text-align: left; }
.report-table.freezer th:first-child, .report-table.freezer td:first-child { width: 22%; }
.report-table .section-row td { padding-block: 4px; background: #f3f4f5; font-weight: 800; }
.result-pass { color: #16765f; font-weight: 800; }
.result-fix { color: #c32622; font-weight: 800; }
.result-na { color: #92989e; }
.checklist-notes { margin-top: 8px; padding: 8px 10px; border: 1px solid #aeb4b9; }
.checklist-notes strong { display: block; margin-bottom: 3px; }
.checklist-notes ul { margin: 0; padding-left: 18px; }

.photo-report-head { margin-bottom: 14px; }
.photo-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-report-card { margin: 0; overflow: hidden; background: #f1f2f3; border: 1px solid #d6dade; border-radius: 6px; }
.photo-report-card img { display: block; width: 100%; height: 276px; object-fit: contain; background: #eeeeef; }
.photo-report-card figcaption { padding: 6px 8px; color: #5f676e; font-size: 8px; }
.photo-report-card figcaption b { color: #1d252c; }

.issue-report-table { width: 100%; margin-top: 18px; border-collapse: collapse; table-layout: fixed; }
.issue-report-table th, .issue-report-table td { padding: 8px; border: 1px solid #9ea5ab; text-align: left; vertical-align: top; }
.issue-report-table th { background: #f0f1f2; text-align: center; }
.issue-report-table th:first-child, .issue-report-table td:first-child { width: 6%; text-align: center; }
.issue-report-table th:nth-child(2) { width: 23%; }
.issue-report-table th:nth-child(3) { width: 31%; }
.issue-report-table td small { display: block; color: #8a9096; }
.report-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin-top: 30px; }
.report-signature { min-height: 118px; padding: 12px; text-align: center; border: 1px solid #d4d8dc; border-radius: 6px; }
.report-signature img { display: block; width: 100%; height: 66px; object-fit: contain; }
.report-signature-blank { height: 66px; }
.report-signature-line { padding-top: 6px; border-top: 1px solid #262c31; }
.report-signature-line strong, .report-signature-line span { display: block; }
.report-signature-line span { margin-top: 2px; color: #767d84; font-size: 8px; }
.work-order-page img { display: block; width: 100%; max-height: 900px; margin-top: 18px; object-fit: contain; object-position: top center; }
.report-empty-image { display: grid; place-items: center; min-height: 760px; margin-top: 18px; color: #899097; background: #f4f5f6; border: 1px dashed #bdc3c8; }

@media (max-width: 900px) {
  .save-state, .desktop-action { display: none; }
  .workspace { width: min(100% - 24px, 720px); padding-top: 22px; }
  .overview { grid-template-columns: 1fr; gap: 18px; }
  .metrics { min-width: 0; width: 100%; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .equipment-meta { grid-template-columns: 1fr 1fr; }
  .equipment-meta .icon-button { justify-self: end; }
  .equipment-summary { grid-template-columns: 42px 1fr auto 30px; }
  .equipment-summary small { display: none; }
  .check-row { grid-template-columns: minmax(220px, 1fr) 160px; }
  .check-row input:last-child { grid-column: 1 / -1; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .report-stage { justify-content: flex-start; }
  #reportRoot { justify-content: start; }
}

@media (max-width: 620px) {
  .app-header { min-height: 66px; padding: 10px 14px; }
  .brand-logo { width: 130px; }
  .brand-copy { display: none; }
  .button { min-height: 40px; padding: 8px 11px; }
  .overview { align-items: stretch; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n + 2) { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
  .panel { padding: 17px; border-radius: 11px; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .section-heading .button-secondary { order: 3; width: 100%; margin-left: 0; }
  .text-action { width: 100%; margin-left: 56px; text-align: left; }
  .form-grid, .signoff-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .equipment-summary { grid-template-columns: 38px minmax(0, 1fr) 30px; }
  .summary-status { grid-column: 2; justify-self: start; }
  .summary-chevron { grid-row: 1 / span 2; grid-column: 3; }
  .equipment-meta { grid-template-columns: 1fr; }
  .equipment-meta .icon-button { justify-self: stretch; width: 100%; }
  .check-row { grid-template-columns: 1fr; align-items: start; padding-block: 11px; }
  .check-row input:last-child { grid-column: auto; }
  .photo-toolbar { grid-template-columns: 1fr; align-items: start; }
  .phase-button { padding-inline: 11px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .issues-table { display: block; overflow-x: auto; }
  .finish-bar { bottom: 8px; flex-wrap: wrap; }
  .finish-bar > div { flex-basis: 100%; }
  .finish-bar .button { flex: 1; }
  .report-toolbar { flex-wrap: wrap; }
  .report-toolbar > div { flex-basis: 100%; }
  .report-toolbar .button { flex: 1 1 auto; }
}

@page report-portrait { size: A4 portrait; margin: 0; }
@page report-landscape { size: A4 landscape; margin: 0; }

@media print {
  body { background: white; }
  body > *:not(.report-dialog), .report-toolbar { display: none !important; }
  .report-dialog { position: static; display: block !important; width: auto; height: auto; overflow: visible; background: white; }
  .report-stage { padding: 0; overflow: visible; }
  #reportRoot { display: block; }
  .report-page { width: 210mm; min-height: 297mm; padding: 14mm 13mm 12mm; box-shadow: none; page: report-portrait; break-after: page; }
  .report-page.landscape { width: 297mm; min-height: 210mm; padding: 10mm; page: report-landscape; }
  .report-page:last-child { break-after: auto; }
  .photo-report-card img { height: 73mm; }
}
