body[data-page="packaging"] {
    --primary: #0F766E;
    --secondary: #2563EB;
    --accent: #F59E0B;
    --accent-soft: #FDF1E9;
    --surface-dark: #0F766E;
    --surface-dark-strong: #0F766E;
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --surface-soft: #F5F9F8;
    --ink: #17324D;
    --muted: #64748B;
    --line: #D5E4E1;
    --navy: #17324D;
    --navy-soft: #F5F9F8;
    --site: #0F766E;
    --site-soft: #F5F9F8;
    --quality: #0F766E;
    --quality-soft: #F5F9F8;
    --danger: #DC2626;
    --danger-soft: #FEF2F2;
    --warning: #F59E0B;
    --warning-soft: #FFF6DC;
    --ok: #15803D;
    --ok-soft: #F0FDF4;
    --success: #15803D;
    --success-soft: #F0FDF4;
    --info: #2563EB;
    --info-soft: #EFF6FF;
    --background: #FFFFFF;
    --text-primary: #17324D;
    --text-secondary: #64748B;
    --border: #D5E4E1;
}

body[data-page="packaging"] .app-footer a {
    color: #0F766E;
}

body[data-page="packaging"] .app-header {
    border-bottom-color: #0F766E;
    background: #0F766E;
}

body[data-page="packaging"] .desktop-nav a:hover {
    background: #2563EB;
}

body[data-page="packaging"] .desktop-nav a::after {
    background: #F59E0B;
}

body[data-page="packaging"] .role-switcher select,
body[data-page="packaging"] .notification-button,
body[data-page="packaging"] .mobile-menu-button {
    border-color: #2563EB;
    background: #2563EB;
}

body[data-page="packaging"] .app-logo,
body[data-page="packaging"] .user-avatar {
    background: #F5F9F8;
    color: #0F766E;
}

.packaging-instruction-page {
    --primary: #0F766E;
    --secondary: #2563EB;
    --accent: #F59E0B;
    --accent-soft: #FDF1E9;
    --surface: #FFFFFF;
    --surface-soft: #F5F9F8;
    --ink: #17324D;
    --muted: #64748B;
    --line: #D5E4E1;
    --danger: #DC2626;
    --danger-soft: #FEF2F2;
    --warning: #F59E0B;
    --success: #15803D;
    --info: #2563EB;
    --instruction-primary: var(--primary);
    --instruction-secondary: var(--secondary);
    --instruction-accent: var(--accent);
    --instruction-surface: var(--surface);
    --instruction-surface-soft: var(--surface-soft);
    --instruction-line: var(--line);
    --instruction-muted: var(--muted);
    --instruction-ink: var(--ink);
    color: var(--instruction-ink);
}

.packaging-instruction-page .button:hover {
    box-shadow: 0 10px 24px rgba(31, 78, 121, .16);
}

.instruction-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 22px 0 18px;
}

.instruction-heading h1 {
    margin: 8px 0 6px;
    color: var(--instruction-ink);
    font-size: 34px;
    line-height: 1.12;
}

.instruction-heading p {
    max-width: 700px;
    margin: 0;
    color: var(--instruction-muted);
}

.instruction-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 9px;
}

.local-save-state {
    color: var(--instruction-muted);
    font-size: 12px;
}

.instruction-toolbar {
    display: grid;
    grid-template-columns: 120px minmax(140px, 1fr) minmax(240px, .8fr);
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
    padding: 12px 16px;
    border: 1px solid var(--instruction-line);
    background: var(--instruction-surface);
}

.instruction-toolbar div:first-child span,
.instruction-toolbar div:first-child strong {
    display: block;
}

.instruction-toolbar div:first-child span,
.instruction-toolbar p {
    color: var(--instruction-muted);
    font-size: 11px;
}

.instruction-toolbar div:first-child strong {
    margin-top: 2px;
    color: var(--instruction-ink);
    font-size: 14px;
}

.instruction-toolbar p {
    margin: 0;
    text-align: right;
}

.progress-track {
    height: 7px;
    overflow: hidden;
    background: var(--instruction-surface-soft);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--instruction-accent);
    transition: width .2s ease;
}

.instruction-workspace {
    display: grid;
    grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
}

.instruction-step-nav,
.instruction-editor {
    min-width: 0;
    border: 1px solid var(--instruction-line);
    background: #fff;
}

.instruction-step-nav {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 14px 10px;
}

.step-nav-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2px 8px 10px;
    border-bottom: 1px solid var(--instruction-line);
}

.step-nav-heading span {
    color: var(--instruction-ink);
    font-size: 14px;
    font-weight: 800;
}

.step-nav-heading small {
    color: var(--instruction-muted);
    font-size: 11px;
}

.instruction-nav-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 6px 8px;
    border: 0;
    border-bottom: 1px solid var(--instruction-line);
    background: var(--instruction-surface);
    color: var(--instruction-ink);
    text-align: left;
    cursor: pointer;
}

.instruction-nav-item:hover,
.instruction-nav-item.is-active {
    background: #EAF5F2;
}

.instruction-nav-item.is-active {
    box-shadow: inset 3px 0 var(--instruction-accent);
    font-weight: 700;
}

.nav-number {
    color: var(--instruction-accent);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.instruction-nav-item > span:nth-child(2) {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.instruction-nav-item b {
    color: var(--instruction-accent);
    font-size: 10px;
}

.instruction-editor {
    min-height: 620px;
    padding: 20px;
}

.editor-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--instruction-line);
}

.editor-heading [data-step-kicker] {
    color: var(--instruction-accent);
    font-size: 11px;
    font-weight: 800;
}

.editor-heading h2 {
    margin: 4px 0 0;
    color: var(--instruction-ink);
    font-size: 22px;
}

.editor-step-state {
    padding: 5px 9px;
    background: var(--instruction-surface-soft);
    color: var(--instruction-muted);
    font-size: 11px;
}

.instruction-section {
    margin-bottom: 20px;
}

.instruction-section > header {
    margin-bottom: 12px;
}

.instruction-section > header > span,
.photo-section-heading > div > span {
    color: var(--instruction-accent);
    font-size: 10px;
    font-weight: 800;
}

.instruction-section > header h3,
.photo-section-heading h3 {
    margin: 4px 0 0;
    color: var(--instruction-ink);
    font-size: 16px;
}

.instruction-section > header p {
    margin: 5px 0 0;
    color: var(--instruction-muted);
    font-size: 12px;
}

.instruction-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.instruction-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.instruction-field > span {
    color: var(--instruction-muted);
    font-size: 11px;
    font-weight: 700;
}

.instruction-field input,
.instruction-field textarea,
.instruction-field select,
.material-editor input {
    width: 100%;
    min-width: 0;
    min-height: 39px;
    padding: 8px 10px;
    border: 1px solid var(--instruction-line);
    border-radius: 4px;
    background: var(--instruction-surface);
    color: var(--instruction-ink);
    font: inherit;
    font-size: 13px;
}

.instruction-field textarea {
    resize: vertical;
    line-height: 1.6;
}

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

.reference-note {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding: 11px 13px;
    border-left: 3px solid var(--instruction-accent);
    background: var(--instruction-surface-soft);
    color: var(--instruction-muted);
    font-size: 12px;
    line-height: 1.6;
}

.reference-note strong {
    flex: 0 0 auto;
    color: var(--instruction-ink);
}

.material-editor-wrap {
    overflow-x: auto;
    border: 1px solid var(--instruction-line);
}

.material-editor,
.print-table {
    width: 100%;
    border-collapse: collapse;
}

.material-editor {
    min-width: 700px;
    table-layout: fixed;
}

.material-editor th:nth-child(1) { width: 52px; }
.material-editor th:nth-child(2) { width: 130px; }
.material-editor th:nth-child(3) { width: 105px; }
.material-editor th:nth-child(4) { width: 84px; }
.material-editor th:nth-child(5) { width: 230px; }
.material-editor th:nth-child(6) { width: 54px; }

.material-editor th,
.material-editor td,
.print-table th,
.print-table td {
    border: 1px solid var(--instruction-line);
    padding: 7px;
    text-align: left;
    vertical-align: middle;
}

.material-editor th {
    background: var(--instruction-surface-soft);
    color: var(--instruction-ink);
    font-size: 11px;
    white-space: nowrap;
}

.material-editor td > input:not([type="file"]) {
    min-width: 74px;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
}

.material-reference-thumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: 4px;
}

.material-reference-thumbs .reference-figure {
    width: 52px;
}

.material-reference-thumbs .reference-figure img {
    height: 40px;
}

.material-reference-thumbs figcaption {
    display: none;
}

.material-photo-cell {
    display: grid;
    min-width: 0;
    justify-items: start;
    gap: 6px;
}

.material-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.material-uploaded-thumb {
    position: relative;
    width: 52px;
    margin: 0;
}

.material-uploaded-thumb img {
    display: block;
    width: 52px;
    height: 40px;
    object-fit: cover;
}

.material-uploaded-thumb button {
    width: 100%;
    padding: 2px;
    border: 1px solid var(--instruction-line);
    background: #fff;
    color: var(--danger);
    cursor: pointer;
    font-size: 10px;
}

.material-photo-upload {
    position: relative;
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 4px;
    padding: 4px 7px;
    border: 1px solid var(--instruction-secondary);
    background: var(--instruction-surface-soft);
    color: var(--instruction-accent);
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.material-photo-upload input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.material-photo-upload:focus-within {
    outline: 2px solid var(--instruction-accent);
    outline-offset: 2px;
}

.material-camera-icon {
    position: relative;
    display: inline-block;
    width: 14px;
    height: 10px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.material-camera-icon::before {
    position: absolute;
    top: -4px;
    left: 3px;
    width: 5px;
    height: 3px;
    border: 1.5px solid currentColor;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
    content: "";
}

.material-camera-icon::after {
    position: absolute;
    top: 2px;
    left: 4px;
    width: 4px;
    height: 4px;
    border: 1px solid currentColor;
    border-radius: 50%;
    content: "";
}

.material-upload-icon {
    display: inline-grid;
    width: 14px;
    height: 14px;
    place-items: center;
    font-size: 15px;
    line-height: 1;
}

.icon-text-button {
    padding: 4px 6px;
    border: 0;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    font-size: 11px;
}

.add-material-button {
    margin-top: 10px;
}

.reference-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.reference-figure,
.uploaded-photo {
    min-width: 0;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--instruction-line);
    background: #fff;
}

.reference-figure img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: contain;
    background: var(--instruction-surface-soft);
}

.reference-figure figcaption,
.uploaded-photo figcaption {
    margin-top: 5px;
    color: var(--instruction-muted);
    font-size: 10px;
    text-align: center;
}

.photo-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--instruction-line);
}

.photo-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.photo-section-heading small {
    color: var(--instruction-muted);
    font-size: 11px;
}

.photo-upload-control {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    min-height: 76px;
    padding: 12px;
    border: 1px dashed var(--instruction-secondary);
    background: var(--instruction-surface-soft);
    cursor: pointer;
}

.photo-upload-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.photo-upload-control:focus-within {
    outline: 2px solid var(--instruction-accent);
    outline-offset: 2px;
}

.photo-upload-icon {
    grid-row: span 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    background: var(--instruction-accent);
    color: #fff;
    font-size: 25px;
}

.photo-upload-control strong {
    color: var(--instruction-ink);
    font-size: 13px;
}

.photo-upload-control small {
    color: var(--instruction-muted);
    font-size: 11px;
}

.uploaded-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 9px;
    margin-top: 10px;
}

.uploaded-photo {
    position: relative;
}

.uploaded-photo img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: contain;
    background: var(--instruction-surface-soft);
}

.uploaded-photo button {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 4px;
    border: 1px solid var(--instruction-line);
    background: #fff;
    color: var(--danger);
    cursor: pointer;
    font-size: 11px;
}

.photo-empty {
    margin: 10px 0 0;
    color: var(--instruction-muted);
    font-size: 11px;
}

.first-check-list {
    border: 1px solid var(--instruction-line);
}

.first-check-row {
    display: grid;
    grid-template-columns: minmax(180px, .9fr) minmax(150px, .55fr) minmax(180px, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px;
    border-bottom: 1px solid var(--instruction-line);
}

.first-check-row:last-child {
    border-bottom: 0;
}

.first-check-row > strong {
    color: var(--instruction-ink);
    font-size: 12px;
}

.instruction-editor .instruction-textarea {
    margin-bottom: 10px;
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--instruction-line);
}

.editor-footer > span {
    color: var(--instruction-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.print-report {
    display: none;
}

.print-report.is-preview {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: block;
    overflow: auto;
    padding: 62px 18px 24px;
    background: rgba(18, 35, 43, .76);
}

.preview-chrome {
    position: fixed;
    z-index: 1;
    inset: 0 0 auto;
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

.preview-chrome strong {
    color: var(--instruction-ink);
    font-size: 13px;
}

.preview-chrome > span {
    flex: 1;
    color: var(--instruction-muted);
    font-size: 12px;
}

.print-page {
    box-sizing: border-box;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 9mm 11mm;
    background: #fff;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .24);
    color: #17324D;
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

.print-page-header > div:first-child,
.print-document-meta,
.print-signatures {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.print-page-header > div:first-child {
    color: var(--instruction-primary);
    font-size: 9pt;
}

.print-document-meta {
    margin-top: 4px;
    color: #64748B;
    font-size: 8pt;
}

.print-page-header {
    padding-bottom: 2mm;
    border-bottom: 1px solid var(--instruction-primary);
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.print-table th,
.print-table td {
    border: 1px solid var(--instruction-line);
    padding: 2px 3px;
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.print-table th {
    background: var(--instruction-surface-soft);
    font-weight: 700;
}

.identity-table {
    margin-top: 2mm;
}

.identity-table th,
.package-table th {
    white-space: nowrap;
}

.aligned-info-table .info-col-1 { width: 16mm; }
.aligned-info-table .info-col-2 { width: 31mm; }
.aligned-info-table .info-col-3 { width: 16mm; }
.aligned-info-table .info-col-4 { width: 31mm; }
.aligned-info-table .info-col-5 { width: 23mm; }
.aligned-info-table .info-col-6 { width: 26mm; }
.aligned-info-table .info-col-7 { width: 16mm; }
.aligned-info-table .info-col-8 { width: 29mm; }

.identity-table td,
.identity-table th,
.package-table td,
.package-table th {
    font-size: 7.2pt;
}

.print-compact-section {
    margin-top: 2mm;
}

.print-compact-section > h2,
.print-bottom-section h2 {
    margin: 0 0 1mm;
    padding-left: 1.5mm;
    border-left: 2px solid var(--instruction-accent);
    color: var(--instruction-primary);
    font-size: 8pt;
    line-height: 1.15;
}

.print-material-list {
    display: grid;
    grid-template-columns: repeat(var(--material-columns, 4), minmax(0, 1fr));
    border-top: 1px solid var(--instruction-line);
    border-left: 1px solid var(--instruction-line);
}

.print-material-item {
    display: grid;
    grid-template-rows: minmax(5mm, auto) 1fr;
    min-width: 0;
    min-height: 27mm;
    margin: 0;
    border-right: 1px solid var(--instruction-line);
    border-bottom: 1px solid var(--instruction-line);
}

.print-material-item figcaption {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 1mm;
    padding: 1px 3px;
    font-size: 5.8pt;
    line-height: 1.1;
}

.print-material-item figcaption b,
.print-material-item figcaption span {
    overflow-wrap: anywhere;
}

.print-material-item figcaption b {
    flex: 1;
    min-width: 0;
}

.print-material-item figcaption span {
    flex: 0 0 auto;
    color: #64748B;
    white-space: nowrap;
}

.print-material-images {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 1px 3px 2px;
}

.print-material-images img {
    display: block;
    width: 100%;
    height: 21mm;
    object-fit: contain;
}

.print-material-no-image {
    color: #64748B;
    font-size: 6pt;
}

.print-text-only-row {
    height: 8mm !important;
}

.print-text-only-row th,
.print-text-only-row td {
    padding-top: .5mm !important;
    padding-bottom: .5mm !important;
}

.photo-note {
    margin: 0;
    color: var(--instruction-muted);
    font-size: 13px;
}

.process-table .print-text-only-row .print-quality-copy {
    text-align: left;
}

.process-table .col-no { width: 7mm; }
.process-table .col-name { width: 17mm; }
.process-table .col-process { width: 45mm; }
.process-table .col-quality { width: 43mm; }
.process-table .col-image { width: 25.33mm; }

.process-table thead th {
    text-align: center;
    font-size: 6.5pt;
    line-height: 1.05;
}

.process-table tbody tr {
    height: 19mm;
    break-inside: avoid;
    page-break-inside: avoid;
}

.process-table tbody th,
.process-table tbody td {
    font-size: 6.2pt;
    line-height: 1.18;
}

.process-table .print-number,
.process-table .print-step-name {
    text-align: center;
}

.process-table .print-image-cell {
    height: 19mm;
    padding: 1px;
    text-align: center;
}

.print-image-cell img {
    display: block;
    width: 100%;
    height: 17mm;
    object-fit: contain;
}

.print-bottom-section {
    margin-top: 2mm;
    padding: 1.5mm;
    border: 1px solid var(--instruction-line);
}

.print-bottom-section p,
.print-bottom-section small {
    display: block;
    margin: 1mm 0 0;
    font-size: 6pt;
    line-height: 1.2;
}

.print-signatures {
    justify-content: flex-start;
    margin-top: 1mm;
    font-size: 6.5pt;
}

.print-revision-line {
    margin-top: 1mm;
    color: #64748B;
    font-size: 5.5pt;
}

@media (max-width: 900px) {
    .instruction-workspace {
        grid-template-columns: minmax(175px, 220px) minmax(0, 1fr);
    }

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

    .instruction-toolbar {
        grid-template-columns: 110px minmax(100px, 1fr);
    }

    .instruction-toolbar p {
        grid-column: 1 / -1;
        text-align: left;
    }

    .material-editor-wrap {
        overflow: visible;
        border: 0;
    }

    .material-editor {
        min-width: 0;
        table-layout: auto;
        border-collapse: separate;
        border-spacing: 0 9px;
    }

    .material-editor thead {
        display: none;
    }

    .material-editor tbody {
        display: grid;
        gap: 2px;
    }

    .material-editor tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        border: 1px solid var(--instruction-line);
        background: #fff;
    }

    .material-editor tbody td {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 4px;
        border: 0;
        padding: 7px;
    }

    .material-editor tbody td::before {
        color: var(--instruction-muted);
        font-size: 10px;
        line-height: 1.2;
    }

    .material-editor tbody td:nth-child(1) { grid-column: 1 / 2; }
    .material-editor tbody td:nth-child(1)::before { content: "序号"; }
    .material-editor tbody td:nth-child(2) { grid-column: 2 / 5; padding-right: 58px; }
    .material-editor tbody td:nth-child(2)::before { content: "物料名称"; }
    .material-editor tbody td:nth-child(3) { grid-column: 1 / 3; }
    .material-editor tbody td:nth-child(3)::before { content: "规格"; }
    .material-editor tbody td:nth-child(4) { grid-column: 3 / 5; }
    .material-editor tbody td:nth-child(4)::before { content: "单位用量"; }
    .material-editor tbody td:nth-child(5) { grid-column: 1 / -1; }
    .material-editor tbody td:nth-child(5)::before { content: "参考图 / 实物照片"; }
    .material-editor tbody td:nth-child(6) {
        position: absolute;
        top: 15px;
        right: 4px;
        display: block;
        padding: 0;
    }

    .material-editor tbody td > input:not([type="file"]) {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
    }

    .material-photo-cell {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .instruction-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .instruction-heading h1 {
        font-size: 28px;
    }

    .instruction-heading-actions {
        justify-content: flex-start;
    }

    .instruction-workspace {
        grid-template-columns: 1fr;
    }

    .instruction-step-nav {
        position: static;
        max-height: none;
        padding: 9px;
    }

    .instruction-step-nav nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-top: 8px;
    }

    .instruction-nav-item {
        display: flex;
        flex: 0 0 auto;
        width: auto;
        min-height: 38px;
        gap: 6px;
        border: 1px solid var(--instruction-line);
    }

    .instruction-nav-item > span:nth-child(2) {
        max-width: 125px;
    }

    .instruction-nav-item b {
        display: none;
    }

    .instruction-editor {
        min-height: 0;
        padding: 15px;
    }

    .instruction-form-grid {
        grid-template-columns: 1fr;
    }

    .first-check-row {
        grid-template-columns: 1fr;
    }

    .instruction-toolbar {
        gap: 10px;
        padding: 11px;
    }

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

@page {
    size: A4 portrait;
    margin: 9mm 11mm;
}

@media print {
    body {
        background: #fff !important;
        color: #17324D !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body > * {
        visibility: hidden !important;
    }

    .app-header,
    .app-footer,
    .notification-panel,
    .toast,
    .modal-backdrop {
        display: none !important;
    }

    #main-content,
    .packaging-instruction-page,
    .print-report,
    .print-report * {
        visibility: visible !important;
    }

    #main-content {
        position: absolute !important;
        inset: 0 !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .packaging-instruction-page {
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .instruction-heading,
    .instruction-toolbar,
    .instruction-workspace {
        display: none !important;
    }

    .preview-chrome {
        display: none !important;
    }

    .print-report,
    .print-report.is-preview {
        position: static !important;
        inset: auto !important;
        display: block !important;
        overflow: visible !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .print-page {
        box-sizing: border-box;
        display: block;
        width: 100%;
        height: 279mm;
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background: #fff;
        box-shadow: none;
        page-break-after: avoid;
        break-after: avoid-page;
        font-size: 7pt;
    }

    .print-operation-row,
    .print-table tr,
    .print-page-header,
    .print-bottom-section,
    .print-revision-line {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .print-table th,
    .print-table td {
        padding: .8mm;
        border: .45pt solid var(--instruction-line);
        font-size: 6.2pt;
    }

    .print-table th {
        background: var(--instruction-surface-soft) !important;
    }

    .print-page-header > div:first-child {
        font-size: 8pt;
    }

    .print-document-meta {
        font-size: 7pt;
    }

    .process-table .print-image-cell {
        height: 19mm;
        padding: .4mm;
    }

    .print-image-cell img {
        height: 17mm;
    }

    .print-bottom-section {
        background: var(--instruction-surface-soft) !important;
    }

    .print-revision-line {
        font-size: 5pt;
    }
}
