:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-soft: #f1f5f2;
  --ink: #16211f;
  --muted: #65706c;
  --line: #d9dfda;
  --green: #2f6f63;
  --green-strong: #24594f;
  --blue: #345f8c;
  --amber: #b87824;
  --danger: #b64242;
  --shadow: 0 12px 30px rgba(28, 42, 38, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 53, 47, 0.92), rgba(47, 111, 99, 0.82)),
    #17352f;
}

.login-card {
  width: min(100%, 390px);
  display: grid;
  gap: 16px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(5, 20, 16, 0.24);
}

.login-card img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
}

.login-card h1 {
  margin: -8px 0 4px;
  font-size: 32px;
  line-height: 1.08;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e3b3ae;
  border-radius: 8px;
  background: #fff1ef;
  color: var(--danger);
  font-size: 13px;
  font-weight: 750;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: #17352f;
  color: #eef7f1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  color: #b8cbc4;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  color: #dbe9e4;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 650;
  font-size: 14px;
}

.nav-list a:hover,
.nav-list a.active {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-logout {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #eef7f1;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.14);
}

.source-box {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.source-kicker,
.eyebrow {
  margin: 0 0 4px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.source-box p {
  margin: 0 0 6px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.source-box small {
  color: #cddbd6;
}

.workspace {
  padding: 28px;
  max-width: 1500px;
  width: 100%;
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.topbar-actions,
.action-stack {
  display: flex;
  gap: 10px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #d8c8a7;
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: #fff8ea;
  color: #4d4435;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading.compact {
  padding-bottom: 14px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef6f3;
  color: var(--green-strong);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.muted {
  color: var(--muted);
  background: #f0f0ee;
}

.form-grid,
.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid {
  padding: 20px;
}

label,
.check-group legend {
  display: grid;
  gap: 7px;
  color: #36413e;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd6d1;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 99, 0.16);
}

.check-group {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.check-group legend {
  padding: 0 6px;
}

.check-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
}

.check-group input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.advanced {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.advanced summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
}

.advanced-grid {
  padding: 0 16px 16px;
}

.wide-field {
  grid-column: 1 / -1;
}

.quality-panel {
  position: sticky;
  top: 20px;
}

.quality-panel .action-stack {
  flex-direction: column;
  padding: 0 20px 20px;
}

.meter {
  height: 8px;
  margin: 0 20px 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ebe8;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--green));
  transition: width 180ms ease;
}

.quality-list {
  display: grid;
  gap: 10px;
  padding: 0 20px 18px;
  margin: 0;
  list-style: none;
}

.quality-list li {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7f8f6;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.quality-list li.ok {
  color: var(--green-strong);
  border-color: #bcd8cf;
  background: #f0f8f5;
}

.quality-list li.warn {
  color: #765219;
  border-color: #e6d0a6;
  background: #fff8ea;
}

.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, background 120ms ease, border 120ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.btn.primary {
  background: var(--green);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--green-strong);
}

.btn.secondary {
  background: #edf3f1;
  border-color: #c7d8d2;
  color: var(--green-strong);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.output-panel {
  margin-top: 20px;
}

.empty-state {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  align-items: center;
  gap: 28px;
  padding: 30px;
  color: var(--muted);
}

.empty-state p {
  max-width: 420px;
  margin: 10px 0 0;
  font-size: 18px;
  color: #3d4945;
}

.empty-mark {
  width: 88px;
  height: 88px;
  opacity: 0.78;
}

.empty-preview {
  min-height: 260px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
}

.empty-preview img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid #d7dfd9;
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(27, 42, 38, 0.12);
  background: #fff;
}

.empty-preview img:nth-child(2) {
  height: 280px;
}

.manual-preview {
  padding: 28px;
  max-width: 1080px;
}

.manual-preview h1,
.manual-preview h2,
.manual-preview h3 {
  letter-spacing: 0;
  line-height: 1.2;
}

.manual-preview h1 {
  margin: 0 0 10px;
  font-size: 34px;
}

.manual-preview h2 {
  margin: 34px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 24px;
}

.manual-preview h3 {
  margin: 22px 0 8px;
  font-size: 18px;
}

.manual-preview p,
.manual-preview li {
  color: #303b38;
}

.manual-preview ul,
.manual-preview ol {
  padding-left: 22px;
}

.manual-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.manual-preview th,
.manual-preview td {
  border: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
  text-align: left;
}

.manual-preview th {
  background: #eef4f2;
}

.manual-preview a {
  color: var(--blue);
}

.manual-document {
  --brand: var(--green);
  --brand-accent: var(--amber);
  display: grid;
  gap: 24px;
  color: #18211f;
  font-family: "Aptos", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

.standalone-manual {
  margin: 0;
  background: #eef2ef;
}

.standalone-manual .manual-document {
  padding: 28px 0;
}

.manual-page {
  position: relative;
  width: min(100%, 210mm);
  height: 297mm;
  margin: 0 auto;
  padding: 22mm 17mm 20mm;
  overflow: hidden;
  border: 1px solid #d8ddd8;
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 78%, #fbfcfb 100%);
  box-shadow: 0 14px 36px rgba(27, 42, 38, 0.13);
  break-after: page;
  page-break-after: always;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.manual-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4mm;
  background: linear-gradient(90deg, var(--brand), var(--brand-accent));
}

.manual-page-header,
.manual-page-footer {
  position: absolute;
  left: 17mm;
  right: 17mm;
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  color: #6d7773;
  font-size: 9.5px;
  font-weight: 750;
  text-transform: uppercase;
}

.manual-page-header {
  top: 10mm;
}

.manual-page-footer {
  bottom: 7mm;
  align-items: center;
  border-top: 1px solid #dfe6e1;
  padding-top: 2.5mm;
  text-transform: none;
  font-weight: 650;
}

.manual-page-footer-section {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-page-number {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 850;
}

.manual-page h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--brand);
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: 0;
}

.manual-page h3 {
  margin: 12px 0 6px;
  color: #1f2b28;
  font-size: 16px;
  line-height: 1.18;
}

.manual-page p {
  font-size: 13px;
  line-height: 1.4;
}

.manual-page ul,
.manual-page ol {
  margin: 7px 0 10px;
  padding-left: 18px;
}

.manual-page li {
  margin: 2px 0;
  font-size: 12px;
  line-height: 1.28;
}

.manual-page table {
  border-color: #d7dfd9;
  margin: 10px 0;
}

.manual-page th {
  color: color-mix(in srgb, var(--brand) 80%, #10201c);
}

.cover-page {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding: 24mm 17mm 20mm;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.16), transparent 32%),
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 88%, #071613), color-mix(in srgb, var(--brand) 56%, #101010)),
    #17352f;
}

.cover-page::before {
  display: none;
}

.cover-page .manual-page-header,
.cover-page .manual-page-footer {
  color: rgba(255, 255, 255, 0.74);
}

.cover-page .manual-page-footer {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.cover-page .manual-page-number {
  color: #f4d99d;
}

.cover-top {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.manual-logo-img,
.manual-logo-fallback {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  object-fit: contain;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 28px;
}

.cover-kicker {
  display: block;
  margin-bottom: 16px;
  color: #f4d99d;
  font-weight: 850;
  text-transform: uppercase;
}

.cover-page h1 {
  max-width: 580px;
  margin: 0;
  color: #fff;
  font-size: 50px;
  line-height: 1.02;
}

.cover-page p {
  max-width: 520px;
  color: #edf8f4;
  font-size: 17px;
}

.cover-company {
  display: grid;
  gap: 8px;
  padding: 0 0 0 22px;
  border-left: 7px solid var(--brand-accent);
}

.cover-company span,
.cover-company small {
  color: #e6f2ee;
}

.cover-company strong {
  font-size: 29px;
  line-height: 1.08;
}

.cover-art {
  min-height: 230px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: end;
  gap: 22px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.cover-art img {
  width: 100%;
  height: 222px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(4, 17, 14, 0.22);
}

.cover-art span,
.cover-art strong {
  display: block;
}

.cover-art span {
  margin-bottom: 6px;
  color: #f4d99d;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.cover-art strong {
  max-width: 330px;
  color: #fff;
  font-size: 25px;
  line-height: 1.08;
}

.cover-infographic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.cover-infographic div,
.info-card,
.toc-grid div,
.method-map div,
.cycle span,
.risk {
  border-radius: 8px;
}

.cover-infographic div {
  min-height: 94px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
}

.cover-infographic strong {
  display: block;
  color: #f4d99d;
  font-size: 26px;
}

.cover-infographic span {
  color: #fff;
  font-weight: 800;
}

.dense-table,
.form-table {
  font-size: 10.5px;
}

.dense-table th,
.dense-table td {
  padding: 5px 6px;
  line-height: 1.24;
}

.form-table td {
  height: 34px;
}

.callout {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 5px solid var(--brand-accent);
  border-radius: 8px;
  background: #fff8ea;
  font-size: 12px;
  line-height: 1.35;
}

.toc-grid,
.method-layout,
.method-map,
.infographic-grid,
.risk-matrix {
  display: grid;
  gap: 12px;
}

.toc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toc-grid div {
  padding: 14px;
  border: 1px solid #dfe6e1;
  background: #f7faf8;
  font-weight: 800;
}

.toc-list {
  display: grid;
  gap: 7px;
  margin: 4mm 0 12mm;
  padding: 0;
  list-style: none;
}

.toc-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, max-content) minmax(24px, 1fr) 34px;
  align-items: end;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #e3e9e5;
}

.toc-number {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.toc-title {
  min-width: 0;
  color: #1f2b28;
  font-size: 14px;
  font-weight: 800;
}

.toc-dots {
  border-bottom: 1px dotted #9aa7a2;
  transform: translateY(-5px);
}

.toc-page {
  color: var(--brand);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

.method-layout,
.method-map {
  grid-template-columns: repeat(4, 1fr);
  margin: 24px 0;
}

.method-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
}

.method-layout p:first-child {
  margin-top: 0;
}

.method-visual {
  margin: 0;
  padding: 10px;
  border: 1px solid #d7dfd9;
  border-radius: 8px;
  background: #f8faf8;
}

.method-visual img {
  display: block;
  width: 100%;
  height: 245px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  background: #fff;
}

.method-visual figcaption {
  margin-top: 8px;
  color: #6b7672;
  font-size: 11px;
}

.method-map div {
  min-height: 140px;
  padding: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 12%, #fff), #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, #dfe6e1);
}

.method-map strong {
  display: block;
  color: var(--brand);
  font-size: 34px;
}

.method-map span {
  font-weight: 850;
}

.principle-hero {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.principle-number {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 38px;
  font-weight: 900;
}

.principle-hero h3 {
  margin: 0 0 4px;
  color: #17211e;
  font-size: 26px;
}

.principle-hero p {
  margin: 0;
  color: #56615d;
}

.infographic-grid {
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0;
}

.info-card {
  min-height: 142px;
  padding: 15px;
  background: #f5f8f6;
  border: 1px solid #dfe6e1;
}

.info-card strong,
.info-card span {
  display: block;
}

.info-card strong {
  margin-bottom: 8px;
  color: var(--brand);
  text-transform: uppercase;
  font-size: 11px;
}

.mini-flow,
.cycle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.cycle {
  grid-template-columns: repeat(6, 1fr);
}

.mini-flow span,
.cycle span {
  position: relative;
  padding: 12px 10px;
  background: var(--brand);
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.risk-matrix {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.risk {
  padding: 18px;
  color: #fff;
  font-weight: 850;
  text-align: center;
}

.risk.low {
  background: #4c8b63;
}

.risk.mid {
  background: #b87824;
}

.risk.high {
  background: #b64242;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.signature-grid span {
  min-height: 54px;
  padding: 10px;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  color: #66716d;
}

.signature-grid.large span {
  min-height: 90px;
}

.calendar-table td:first-child {
  font-weight: 850;
  color: var(--brand);
}

.criterion-layout {
  display: grid;
  grid-template-columns: 48% minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.extracted-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.extracted-image {
  margin: 0;
  padding: 10px;
  border: 1px solid #d7dfd9;
  border-radius: 8px;
  background: #f8faf8;
}

.extracted-image.featured {
  grid-column: 1 / -1;
}

.extracted-image img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.extracted-image.featured img {
  height: 245px;
  object-fit: cover;
}

.asset-note {
  margin-top: 8px;
  color: #6b7672;
  font-size: 11px;
}

.asset-note {
  margin-bottom: 0;
}

.criterion-summary {
  display: grid;
  gap: 14px;
}

.criterion-code {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.criterion-summary h3 {
  margin: 0;
  color: #17211e;
  font-size: 28px;
}

.manual-basis {
  padding: 14px 15px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, #d7dfd9);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 7%, #fff);
}

.manual-basis strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.manual-basis p {
  margin: 0;
  color: #33413d;
  font-size: 13px;
}

.threshold-box {
  padding: 16px;
  border-radius: 8px;
  color: #513912;
  background: #fff3d8;
  border: 1px solid #e4c784;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .quality-panel {
    position: static;
  }

  .sidebar {
    height: auto;
  }

  .layout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .panel-heading,
  .notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-actions .btn {
    width: 100%;
  }

  .form-grid,
  .advanced-grid,
  .check-group {
    grid-template-columns: 1fr;
  }

  .manual-preview {
    padding: 18px;
  }

  .empty-state {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .empty-preview {
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    min-height: auto;
  }

  .empty-preview img,
  .empty-preview img:nth-child(2) {
    height: 170px;
  }

  .manual-page {
    width: 100%;
    height: auto;
    min-height: auto;
    padding: 54px 22px 58px;
  }

  .manual-page-header,
  .manual-page-footer {
    left: 22px;
    right: 22px;
  }

  .cover-top,
  .cover-art,
  .cover-infographic,
  .criterion-layout,
  .extracted-gallery,
  .two-column,
  .toc-grid,
  .method-layout,
  .method-map,
  .infographic-grid,
  .mini-flow,
  .cycle,
  .risk-matrix,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .cover-page h1 {
    font-size: 38px;
  }

  .cover-art img {
    height: 210px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body {
    width: 210mm;
    margin: 0;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .notice,
  #datos,
  #calidad,
  .output-panel > .panel-heading {
    display: none !important;
  }

  .app-shell,
  .layout-grid {
    display: block;
  }

  .workspace {
    padding: 0;
    max-width: none;
  }

  .panel,
  .output-panel {
    border: 0;
    box-shadow: none;
    margin: 0;
  }

  .manual-preview {
    display: block !important;
    max-width: none;
    padding: 0;
  }

  .manual-document {
    display: block;
    gap: 0;
  }

  .standalone-manual .manual-document {
    padding: 0;
  }

  .manual-page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    padding: 22mm 17mm 20mm;
    border: 0;
    box-shadow: none;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
  }

  .manual-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
