:root {
    --bg: #d9dee3;
    --bg-secondary: #eef1f4;
    --surface: #dbe0e5;
    --panel: rgba(244, 246, 248, 0.9);
    --panel-strong: rgba(252, 253, 254, 0.96);
    --ink: #22262b;
    --muted: #68717a;
    --line: rgba(34, 38, 43, 0.12);
    --line-strong: rgba(34, 38, 43, 0.22);
    --blueprint: #d26a1b;
    --blue-soft: #f0a25d;
    --shadow: none;
    --shadow-soft: none;
    --radius-lg: 0px;
    --conveying: #8f9ba7;
    --kneading: #cf7a37;
    --reverse: #4a5560;
    --mixing: #a7b09a;
    --screw-track-height: 48px;
    --screw-track-border: 2px;
    --sleeve-shell-height: 10px;
    --stage-top-band-height: 136px;
    --stage-middle-band-height: 80px;
    --stage-bottom-band-height: 116px;
    --stage-insert-duration: 500ms;
}

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

body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", sans-serif;
    color: var(--ink);
    overflow: hidden;
    background: var(--surface);
}

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

button {
    border: none;
    background: none;
}

.app-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 100vh;
    background: var(--surface);
}

.sidebar {
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(238, 241, 244, 0.92) 0%, rgba(231, 235, 239, 0.9) 100%);
    backdrop-filter: blur(18px) saturate(120%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0;
    border-bottom: none;
}

.eyebrow,
.panel-label,
.section-copy,
.stage-instructions span {
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--blueprint);
}

.brand h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.page-header p,
.selected-summary,
.selection-copy p,
.history-meta,
.management-meta,
.section-copy {
    color: var(--muted);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-item {
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 0;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    border-color: rgba(210, 106, 27, 0.16);
    background: rgba(255, 251, 246, 0.78);
    color: #9a5118;
    box-shadow: none;
    transform: translateY(-1px);
}

.main-content {
    padding: 24px;
    height: calc(100vh - 95px);
    overflow: hidden;
    background: var(--surface);
}

.page {
    display: none;
}

.page.active {
    display: block;
    min-height: 100%;
}

#home.page.active {
    height: 100%;
    overflow: hidden;
}

#screw-settings.page.active,
#system-settings.page.active,
#screw-library.page.active,
#screw-blocks.page.active,
#history.page.active {
    height: 100%;
    overflow: hidden;
}

#system-settings.page.active {
    overflow: auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    margin-top: 8px;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.workspace-grid,
.management-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1.5fr);
    gap: 22px;
}

.management-grid {
    grid-template-columns: minmax(560px, 0.5fr) minmax(0, 1.5fr);
}

.workspace-grid {
    --library-width: clamp(420px, 36vw, 520px);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, var(--library-width)) minmax(0, 1fr);
    gap: 22px;
    height: 100%;
    overflow: hidden;
    align-items: stretch;
    transition: grid-template-columns 0.5s ease, gap 0.5s ease;
}

.workspace-grid.library-collapsed {
    --library-width: 0px;
    gap: 0;
}

.block-library-card {
    width: 100%;
    min-width: 0;
    transition:
        opacity 0.5s ease,
        padding 0.5s ease,
        border-color 0.5s ease,
        margin 0.5s ease;
    transform-origin: left center;
}

.workspace-grid.library-collapsed .block-library-card {
    margin: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
}

.management-grid {
    height: 100%;
    align-items: stretch;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(560px, 0.5fr) minmax(0, 1.5fr);
    gap: 22px;
    align-items: start;
    height: 100%;
}

.settings-grid .settings-card:last-child {
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
}

.settings-grid .settings-card:last-child .sleeve-editor {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.settings-grid .settings-card:last-child .settings-form {
    display: grid;
    gap: 12px;
}

.settings-grid .settings-card:last-child .settings-form > label {
    display: grid;
    gap: 8px;
}

.settings-grid .settings-card:last-child .sleeve-field {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 14px;
    padding: 10px 12px;
}

.settings-grid .settings-card:last-child .sleeve-field-label {
    min-width: 0;
}

.settings-grid .settings-card:last-child .sleeve-field-label input {
    width: 100%;
}

.settings-grid .settings-card:last-child .sleeve-toggle {
    justify-self: end;
    white-space: nowrap;
    align-self: end;
    display: grid;
    justify-items: center;
    gap: 0;
}

.card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: none;
    backdrop-filter: blur(18px) saturate(115%);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.section-heading h3 {
    margin-top: 6px;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.section-copy {
    margin-top: 10px;
}

.search-input {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.search-input:focus {
    outline: 2px solid rgba(210, 106, 27, 0.12);
    border-color: rgba(210, 106, 27, 0.24);
}

.section-actions,
.toolbar-actions,
.save-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.screw-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.metric-pill {
    display: grid;
    gap: 4px;
    min-width: 132px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: rgba(252, 253, 254, 0.72);
}

.metric-label {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--blueprint);
}

.metric-pill strong {
    font-size: 16px;
    font-weight: 700;
    color: #4f5963;
}

.metric-input-group {
    display: grid;
    gap: 6px;
}

.metric-input {
    width: 100%;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: #4f5963;
    font: inherit;
}

.metric-input:focus {
    outline: 2px solid rgba(210, 106, 27, 0.12);
    border-color: rgba(210, 106, 27, 0.24);
}

.btn {
    padding: 11px 16px;
    border: 1px solid rgba(156, 83, 24, 0.16);
    border-radius: 0;
    background: linear-gradient(180deg, #dc823b, #c96a1c);
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

.btn.secondary,
.btn.ghost {
    background: rgba(252, 253, 253, 0.9);
    color: #6b4e37;
    box-shadow: none;
}

.btn.danger {
    color: #c9342f;
    border-color: rgba(201, 52, 47, 0.1);
    background: rgba(255, 245, 245, 0.94);
}

.toolbar-select {
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.toolbar-select:focus {
    outline: 2px solid rgba(210, 106, 27, 0.12);
    border-color: rgba(210, 106, 27, 0.24);
}

.block-library {
    display: grid;
    align-content: start;
    gap: 10px;
    margin-top: 18px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.block-library-card,
.screw-stage-card,
.management-card {
    height: 100%;
    min-height: 0;
}

.block-library-card {
    display: flex;
    flex-direction: column;
}

.screw-stage-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.management-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.settings-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

#history .card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#history .search-input {
    margin-top: 0;
    margin-bottom: 16px;
    min-height: 46px;
}

.library-item,
.management-item,
.history-item {
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel-strong);
    box-shadow: none;
}

.management-item.is-removing,
.history-item.is-removing {
    pointer-events: none;
    transition:
        transform 0.24s ease,
        opacity 0.24s ease;
    opacity: 0;
}

.management-item.is-removing[data-remove-style="collapse"],
.history-item.is-removing[data-remove-style="collapse"] {
    overflow: hidden;
    transform-origin: top center;
    transition:
        transform 0.24s ease,
        opacity 0.24s ease,
        max-height 0.24s ease,
        margin 0.24s ease,
        padding-top 0.24s ease,
        padding-bottom 0.24s ease,
        border-width 0.24s ease;
    transform: scaleY(0.92);
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
}

.management-item.is-removing[data-remove-style="slide-right"],
.history-item.is-removing[data-remove-style="slide-right"] {
    transform: translateX(48px);
}

.management-item.is-removing[data-remove-style="fade-scale"],
.history-item.is-removing[data-remove-style="fade-scale"] {
    transform: scale(0.92);
}

.library-item {
    display: grid;
    align-self: start;
    gap: 8px;
    padding: 12px;
    cursor: default;
    transition: 0.16s ease;
    background:
        linear-gradient(180deg, rgba(252, 253, 254, 0.98), rgba(241, 244, 246, 0.96));
}

.library-item:hover,
.library-item.selected {
    border-color: rgba(210, 106, 27, 0.2);
    transform: translateY(-1px);
    box-shadow: none;
}

.library-item.selected {
    box-shadow: none;
}

.library-item.disabled {
    background:
        linear-gradient(180deg, rgba(242, 245, 247, 0.98), rgba(233, 237, 240, 0.98));
    border-color: rgba(108, 118, 128, 0.34);
    border-style: dashed;
    opacity: 0.78;
}

.library-item.disabled:hover {
    transform: none;
    border-color: rgba(108, 118, 128, 0.18);
}

.library-item.disabled .library-name {
    color: #7d8791;
}

.chip.disabled {
    background: rgba(108, 118, 128, 0.14);
    color: #6e7882;
}

.library-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "topline topline"
        "meta preview";
    align-items: center;
    gap: 10px 18px;
}

.library-topline {
    grid-area: topline;
}

.library-topline,
.management-topline,
.history-topline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 0;
    background: rgba(210, 106, 27, 0.1);
    color: #9a5118;
    font-size: 12px;
    letter-spacing: 0.06em;
}

.library-name,
.management-name,
.history-name {
    font-weight: 700;
    font-size: 18px;
}

.pattern-bar {
    height: 52px;
    border: 1px solid rgba(34, 38, 43, 0.12);
    border-radius: 0;
    position: relative;
    background-size: auto;
    box-shadow: none;
}

.pattern-bar::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.pattern-bar[data-type="conveying"] {
    background: repeating-linear-gradient(135deg, rgba(143, 155, 167, 0.18) 0 7px, rgba(143, 155, 167, 0.58) 7px 14px);
}

.pattern-bar[data-type="kneading"] {
    background: repeating-linear-gradient(90deg, rgba(207, 122, 55, 0.18) 0 4px, rgba(207, 122, 55, 0.58) 4px 8px);
}

.pattern-bar[data-type="reverse"] {
    background: repeating-linear-gradient(-45deg, rgba(74, 85, 96, 0.24) 0 5px, rgba(74, 85, 96, 0.62) 5px 10px);
}

.pattern-bar[data-type="mixing"] {
    background: repeating-linear-gradient(135deg, rgba(167, 176, 154, 0.2) 0 5px, rgba(167, 176, 154, 0.58) 5px 9px, rgba(255, 255, 255, 0.45) 9px 12px);
}

.library-item .management-meta {
    margin-top: 0;
}

.library-meta-row {
    grid-area: meta;
    display: grid;
    align-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 74px;
}

.library-item .management-meta,
.library-meta-row .management-meta {
    font-size: 13px;
    line-height: 1.45;
    color: #5f6870;
}

.library-preview {
    grid-area: preview;
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0;
    margin-top: 0;
    min-height: 74px;
}

.library-slot-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--slot-width, 72px);
    min-width: var(--slot-width, 72px);
    max-width: 100%;
    min-height: 74px;
}

.library-slot-shell.disabled {
    opacity: 0.42;
}

.library-quantity-text {
    color: #5f6870;
    font-variant-numeric: tabular-nums;
}

.library-quantity-text.disabled {
    color: #8c97a2;
}

.library-status-text {
    font-size: 12px;
    color: #4f8a55;
}

.library-status-text.disabled {
    color: #b05a32;
    font-weight: 600;
}

.library-slot-module {
    flex: none;
    cursor: grab;
}

.library-slot-module.disabled {
    cursor: not-allowed;
    filter: grayscale(0.7) brightness(1.02);
    opacity: 0.65;
}

.library-slot-module::before {
    display: none;
}

.library-slot-module:active {
    cursor: grabbing;
}

.stage-instructions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 16px 0 18px;
    padding: 12px 14px;
    border-left: 3px solid var(--blueprint);
    background: rgba(210, 106, 27, 0.06);
}

.screw-stage-wrap {
    flex: 1;
    min-height: calc(var(--stage-top-band-height) + var(--stage-middle-band-height) + var(--stage-bottom-band-height) + 28px);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--stage-top-band-height) var(--stage-middle-band-height) var(--stage-bottom-band-height);
    align-content: center;
    align-items: stretch;
    justify-items: stretch;
    row-gap: 0;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-left: var(--screw-head-width, 26px);
    padding-right: var(--screw-tail-width, 12px);
    padding-top: 14px;
    padding-bottom: 8px;
}

.delete-dropzone {
    display: flex;
    visibility: hidden;
    position: absolute;
    left: 24px;
    right: 24px;
    top: calc(50% + 88px);
    min-height: 92px;
    padding: 18px;
    border: 1px dashed rgba(201, 52, 47, 0.28);
    color: #8f4b3c;
    background: rgba(255, 244, 240, 0.72);
    text-align: center;
    font-size: 14px;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.04em;
    z-index: 20;
    pointer-events: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.delete-dropzone.visible {
    visibility: visible;
}

.delete-dropzone.active {
    border-color: rgba(201, 52, 47, 0.52);
    background: rgba(255, 231, 226, 0.92);
    color: #a73630;
}

.delete-dropzone.disabled {
    border-color: rgba(108, 118, 128, 0.26);
    background: rgba(244, 246, 247, 0.9);
    color: #7a848e;
}

.machine-shell {
    grid-row: 1;
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    align-content: end;
    gap: 0;
    height: 100%;
    width: var(--screw-body-width);
    min-width: var(--screw-body-width);
    margin-left: auto;
    margin-bottom: 0;
    padding: 0;
    overflow: visible;
    z-index: 2;
}

.machine-shell.is-hidden,
.sleeve-stage-overlay.is-hidden {
    display: none;
}

.machine-zone {
    position: relative;
    min-height: 0;
    height: 100%;
    overflow: visible;
}

.machine-zone::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 1px;
    height: 14px;
    background: var(--line-strong);
    transform: translateX(-50%);
}

.machine-zone-head {
    position: absolute;
    left: 50%;
    bottom: 14px;
    writing-mode: vertical-rl;
    text-orientation: sideways;
    font-size: 13px;
    color: #2f353b;
    transform: translateX(-50%) rotate(180deg);
}

.sleeve-stage-overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: calc(var(--screw-track-height) + (var(--sleeve-shell-height) * 2));
    transform: translateY(-50%);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    pointer-events: none;
    z-index: 0;
}

.sleeve-stage-zone {
    position: relative;
    overflow: visible;
}

.sleeve-stage-shell {
    position: absolute;
    left: 0;
    width: 100%;
    height: var(--sleeve-shell-height);
    box-sizing: border-box;
    border: 1px solid rgba(34, 38, 43, 0.45);
    background: linear-gradient(180deg, rgba(188, 191, 195, 0.95), rgba(144, 150, 156, 0.9));
}

.sleeve-stage-shell.top {
    top: 0;
}

.sleeve-stage-shell.bottom {
    bottom: 0;
}

.sleeve-stage-hole {
    position: absolute;
    left: 50%;
    top: 0;
    width: 26px;
    height: var(--sleeve-shell-height);
    transform: translateX(-50%);
    border-left: 1px solid rgba(66, 73, 80, 0.42);
    border-right: 1px solid rgba(66, 73, 80, 0.42);
    border-bottom: 1px solid rgba(66, 73, 80, 0.42);
    border-radius: 0 0 2px 2px;
    background: linear-gradient(180deg, rgba(235, 238, 241, 0.96), rgba(198, 204, 210, 0.94));
    z-index: 2;
}

.sleeve-stage-hole::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 1px;
    width: 10px;
    height: calc(100% - 3px);
    transform: translateX(-50%);
    border-radius: 0 0 999px 999px;
    background: linear-gradient(180deg, rgba(108, 118, 128, 0.16), rgba(71, 80, 88, 0.28));
}

.sleeve-stage-hole::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: var(--panel);
}

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

.settings-subtitle {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #835331;
}

.settings-subtitle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.settings-subtitle-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.settings-subtitle-row .settings-subtitle {
    margin-bottom: 0;
}

.settings-subtitle-row .settings-subtitle-hint {
    font-size: 12px;
    color: #c9342f;
    white-space: nowrap;
}

.sleeve-apply-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sleeve-apply-actions select {
    min-width: 180px;
    padding: 10px 12px;
    min-height: 42px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.sleeve-apply-actions select:focus {
    outline: 2px solid rgba(210, 106, 27, 0.12);
    border-color: rgba(210, 106, 27, 0.24);
}

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

.sleeve-field {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    background: rgba(255, 255, 255, 0.48);
}

.sleeve-field-label {
    display: grid;
    gap: 8px;
}

.sleeve-field span {
    font-size: 13px;
    color: var(--muted);
}

.sleeve-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.sleeve-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 13px;
    color: var(--muted);
}

.sleeve-toggle input {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    max-width: 42px;
    max-height: 42px;
    aspect-ratio: 1 / 1;
    flex: 0 0 42px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid rgba(60, 60, 67, 0.18);
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    position: relative;
    transition: 0.18s ease;
}

.sleeve-toggle input:checked {
    background: rgba(210, 106, 27, 0.08);
    border-color: rgba(210, 106, 27, 0.5);
}

.sleeve-toggle input:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 15px;
    border: solid #d26a1b;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -58%) rotate(45deg);
}

.sleeve-toggle input:focus-visible {
    outline: 2px solid rgba(210, 106, 27, 0.18);
    outline-offset: 2px;
}

.annotation {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0;
    width: var(--screw-body-width);
    min-width: var(--screw-body-width);
    margin-left: auto;
    padding: 0;
}

.annotation-top {
    align-items: flex-end;
    min-height: 64px;
}

.annotation-bottom {
    grid-row: 3;
    align-items: flex-start;
    align-self: start;
    min-height: 0;
    height: 100%;
    margin-top: 0;
}

.annotation-item {
    display: flex;
    flex: 0 0 var(--slot-width, 72px);
    justify-content: center;
    position: relative;
    width: var(--slot-width, 72px);
    min-width: var(--slot-width, 72px);
}

.annotation-top .annotation-item::after {
    content: "";
    position: absolute;
    bottom: -6px;
    width: 1px;
    height: 18px;
    background: var(--line-strong);
}

.annotation-bottom .annotation-item::before {
    content: "";
    position: absolute;
    top: -10px;
    width: 1px;
    height: 24px;
    background: var(--line-strong);
}

.annotation-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: var(--annotation-font-size, 13px);
    letter-spacing: 0.08em;
    color: #40464d;
}

.annotation-bottom .annotation-label {
    color: var(--muted);
    writing-mode: vertical-lr;
}

.screw-stage {
    grid-row: 2;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    height: 100%;
    width: var(--screw-body-width);
    min-width: var(--screw-body-width);
    margin-left: auto;
    margin-top: 0;
    margin-bottom: 0;
    padding: 16px 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    z-index: 1;
}

.screw-stage::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--screw-track-height);
    box-sizing: border-box;
    border: var(--screw-track-border) solid rgba(108, 118, 128, 0.48);
    border-radius: 0;
    transform: translateY(-50%);
    background:
        linear-gradient(180deg, rgba(251, 252, 252, 0.98), rgba(214, 219, 223, 0.94)),
        repeating-linear-gradient(135deg, transparent 0 8px, rgba(96, 104, 112, 0.11) 8px 10px);
    box-shadow: none;
}

.stage-cap {
    position: absolute;
    top: 50%;
    width: 12px;
    height: var(--screw-track-height);
    background: #767f88;
    transform: translateY(-50%);
}

.stage-cap.left {
    left: calc(var(--screw-head-width, 26px) * -1);
    width: var(--screw-head-width, 26px);
    height: var(--screw-track-height);
    box-sizing: border-box;
    background:
        repeating-linear-gradient(135deg, rgba(86, 93, 100, 0.92) 0 5px, rgba(205, 210, 214, 0.95) 5px 10px);
    clip-path: polygon(0 50%, 58% 0, 100% 0, 100% 100%, 58% 100%);
    border: 1px solid rgba(70, 76, 82, 0.7);
}

.stage-cap.right {
    right: -12px;
}

.slot {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 var(--slot-width, 72px);
    justify-content: center;
    align-items: center;
    width: var(--slot-width, 72px);
    min-width: var(--slot-width, 72px);
    cursor: pointer;
    overflow: hidden;
    transition:
        flex-basis var(--stage-insert-duration, 500ms) ease,
        width var(--stage-insert-duration, 500ms) ease,
        min-width var(--stage-insert-duration, 500ms) ease,
        transform var(--stage-insert-duration, 500ms) ease,
        opacity 0.18s ease,
        margin var(--stage-insert-duration, 500ms) ease;
}

.screw-stage .slot {
    overflow: visible;
}

body.slot-dragging {
    user-select: none;
    cursor: grabbing;
}

.slot.selected .slot-module {
    transform: none;
}

.slot.drag-floating {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9999;
    flex: none;
    pointer-events: none;
    overflow: visible;
    opacity: 0.96;
    filter: drop-shadow(0 10px 24px rgba(29, 36, 43, 0.24));
    transition: none;
    will-change: transform;
}

.slot.insert-left {
    margin-left: var(--insert-preview-width, 72px);
}

.slot.insert-right {
    margin-right: var(--insert-preview-width, 72px);
}

.slot.insert-left::before,
.slot.insert-right::after {
    content: "";
    position: absolute;
    top: 50%;
    width: var(--insert-preview-width, 72px);
    height: var(--screw-track-height);
    border: 1px dashed rgba(210, 106, 27, 0.4);
    background: rgba(210, 106, 27, 0.08);
    transform: translateY(-50%);
    pointer-events: none;
    box-sizing: border-box;
}

.slot.insert-left::before {
    left: calc(var(--insert-preview-width, 72px) * -1);
}

.slot.insert-right::after {
    right: calc(var(--insert-preview-width, 72px) * -1);
}

.slot-module {
    position: relative;
    width: 100%;
    height: var(--screw-track-height);
    box-sizing: border-box;
    border: 1px solid rgba(34, 38, 43, 0.12);
    border-radius: 0;
    box-shadow: none;
    transition: 0.18s ease;
}

.slot:hover .slot-module {
    border-color: rgba(210, 106, 27, 0.55);
    box-shadow: 0 0 0 1px rgba(210, 106, 27, 0.16);
}

.slot-module::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255, 255, 255, 0.56);
    border-radius: 0;
}

.slot-module[data-type="conveying"] {
    background: repeating-linear-gradient(135deg, rgba(143, 155, 167, 0.18) 0 7px, rgba(143, 155, 167, 0.58) 7px 14px);
}

.slot-module[data-type="kneading"] {
    background: repeating-linear-gradient(90deg, rgba(207, 122, 55, 0.18) 0 4px, rgba(207, 122, 55, 0.58) 4px 8px);
}

.slot-module[data-type="reverse"] {
    background: repeating-linear-gradient(45deg, rgba(74, 85, 96, 0.24) 0 5px, rgba(74, 85, 96, 0.62) 5px 10px);
}

.slot-module[data-type="mixing"] {
    background: repeating-linear-gradient(135deg, rgba(167, 176, 154, 0.2) 0 5px, rgba(167, 176, 154, 0.58) 5px 9px, rgba(255, 255, 255, 0.45) 9px 12px);
}

.selection-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--line-strong);
}

.selection-copy {
    flex: 1;
    min-width: 0;
}

.metric-pill-action {
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-width: 150px;
}

.metric-pill-action .btn {
    width: 100%;
}

.toolbar-actions {
    align-items: flex-start;
    align-self: flex-start;
}

.toolbar-actions .btn {
    padding: 10px 14px;
    min-height: 42px;
}

.selection-toolbar .toolbar-actions {
    display: flex;
}

.management-grid {
    align-items: start;
}

.management-list,
.history-list {
    display: grid;
    align-content: start;
    gap: 14px;
}

.management-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overflow-anchor: none;
    padding-right: 4px;
    margin-top: 18px;
}

.history-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.management-item,
.history-item {
    padding: 18px;
}

.history-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 18px;
}

.management-meta,
.history-meta {
    margin-top: 10px;
    font-size: 14px;
}

.management-actions,
.history-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.history-item .history-topline,
.history-item .history-meta {
    grid-column: 1 / 2;
}

.history-item .form-actions {
    grid-column: 2 / 3;
    grid-row: 1 / 4;
    align-self: center;
    justify-self: end;
    margin-top: 0;
}

.history-item .history-topline {
    justify-content: flex-start;
}

.settings-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.settings-form .form-actions {
    flex-wrap: nowrap;
}

.settings-form label {
    display: grid;
    gap: 8px;
}

.settings-inline-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.settings-inline-fields label {
    min-width: 0;
}

.settings-form span {
    font-size: 14px;
    color: #835331;
}

.settings-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.settings-form input:focus {
    outline: 2px solid rgba(210, 106, 27, 0.12);
    border-color: rgba(210, 106, 27, 0.24);
}

.system-settings-card {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 30px 32px;
}

.system-settings-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(280px, 360px);
    gap: 22px;
    align-items: start;
    margin-top: 18px;
}

.system-settings-main {
    min-width: 0;
    margin-top: 0;
}

.system-settings-layout {
    display: grid;
    gap: 18px;
}

.system-settings-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(60, 60, 67, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 249, 0.95));
}

.system-settings-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.system-settings-fields label:first-child {
    grid-column: 1 / -1;
}

.system-settings-fields input {
    min-height: 48px;
}

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

.system-choice-card {
    position: relative;
    display: grid;
    gap: 6px;
    min-height: 104px;
    padding: 16px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.system-choice-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.system-choice-card:hover {
    border-color: rgba(210, 106, 27, 0.26);
    transform: translateY(-1px);
}

.system-choice-card:has(input:checked) {
    border-color: rgba(210, 106, 27, 0.42);
    background: rgba(210, 106, 27, 0.12);
}

.system-choice-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.system-choice-copy {
    font-size: 13px;
    line-height: 1.5;
    color: #66707a;
}

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

.system-toggle-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    gap: 12px;
    min-height: 96px;
    padding: 16px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.system-toggle-card:hover {
    border-color: rgba(210, 106, 27, 0.22);
    transform: translateY(-1px);
}

.system-toggle-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.system-toggle-copy {
    display: grid;
    gap: 6px;
}

.system-toggle-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.system-toggle-note {
    font-size: 13px;
    line-height: 1.5;
    color: #66707a;
}

.system-toggle-indicator {
    position: relative;
    justify-self: end;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.88);
}

.system-toggle-indicator::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 8px;
    width: 10px;
    height: 18px;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg);
    transition: border-color 0.18s ease;
}

.system-toggle-card:has(input:checked) {
    border-color: rgba(210, 106, 27, 0.42);
    background: rgba(210, 106, 27, 0.12);
}

.system-toggle-card:has(input:checked) .system-toggle-indicator {
    border-color: rgba(210, 106, 27, 0.38);
    background: rgba(255, 244, 236, 0.96);
}

.system-toggle-card:has(input:checked) .system-toggle-indicator::after {
    border-color: #cf6a1b;
}

.system-settings-aside {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 0;
}

.system-settings-aside-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(210, 106, 27, 0.14);
    background: linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(248, 242, 236, 0.96));
}

.system-settings-aside-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b06a34;
}

.system-settings-aside-card h4 {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    color: var(--ink);
}

.system-settings-aside-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #5f6973;
}

.system-migration-panel {
    display: grid;
    gap: 14px;
}

.system-migration-actions {
    display: grid;
    gap: 12px;
}

.import-data-summary {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    background: rgba(247, 249, 250, 0.92);
}

.import-data-summary-label {
    font-size: 13px;
    color: #835331;
}

.import-data-summary strong {
    font-size: 16px;
    color: var(--ink);
}

.import-data-summary p {
    margin: 0;
}

.export-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.export-option-card {
    position: relative;
    display: grid;
    gap: 6px;
    min-height: 96px;
    padding: 16px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.export-option-card:hover {
    border-color: rgba(210, 106, 27, 0.22);
    transform: translateY(-1px);
}

.export-option-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.export-option-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.export-option-copy {
    font-size: 13px;
    line-height: 1.5;
    color: #66707a;
}

.export-option-card:has(input:checked) {
    border-color: rgba(210, 106, 27, 0.42);
    background: rgba(210, 106, 27, 0.12);
}

.settings-summary {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.settings-summary .metric-pill {
    min-width: 0;
}

.settings-note {
    margin-top: 6px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(25, 31, 36, 0.28);
    backdrop-filter: blur(6px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(100%, 520px);
    padding: 24px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: none;
}

.modal-heading h3 {
    margin-top: 6px;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.modal-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.save-mode-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.save-mode-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    min-height: 72px;
    padding: 12px 16px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.save-mode-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.save-mode-option span {
    font-size: 14px;
    line-height: 1.2;
    color: inherit;
}

.save-mode-option:has(input:checked) {
    background: rgba(210, 106, 27, 0.14);
    border-color: rgba(210, 106, 27, 0.48);
    color: #a75a20;
}

.save-mode-option:hover {
    border-color: rgba(210, 106, 27, 0.28);
}

.print-preview-card {
    width: min(96vw, 1400px);
    max-height: min(92vh, 980px);
    display: grid;
    gap: 16px;
}

.print-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.print-preview-meta:empty {
    display: none;
}

.print-preview-meta .print-meta-item {
    min-width: 150px;
    padding: 10px 14px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    display: grid;
    gap: 6px;
}

.print-preview-meta .print-meta-label {
    font-size: 13px;
    color: #835331;
}

.print-preview-meta .print-meta-value {
    font-size: 16px;
    font-weight: 700;
    color: #22262b;
}

.print-preview-stage {
    min-height: 320px;
    max-height: calc(92vh - 220px);
    overflow: auto;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: #ffffff;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-preview-stage img {
    display: block;
    max-width: 100%;
    height: auto;
}

.modal-form label {
    display: grid;
    gap: 8px;
}

.modal-form span {
    font-size: 14px;
    color: #835331;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 10px 12px;
    min-height: 44px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.modal-form textarea {
    min-height: 120px;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    outline: 2px solid rgba(210, 106, 27, 0.12);
    border-color: rgba(210, 106, 27, 0.24);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.app-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1300;
    min-width: 240px;
    max-width: 360px;
    padding: 12px 16px;
    border: 1px solid rgba(156, 83, 24, 0.16);
    background: linear-gradient(180deg, rgba(252, 253, 254, 0.98), rgba(241, 244, 246, 0.96));
    color: #6b4e37;
    box-shadow: none;
}

.app-toast[hidden] {
    display: none;
}

.management-actions {
    display: none;
}

.management-item.selected {
    border-color: rgba(210, 106, 27, 0.22);
    box-shadow: none;
}

.block-form {
    display: grid;
    gap: 16px;
}

#delete-current-block:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.block-form label {
    display: grid;
    gap: 8px;
}

.block-style-row {
    --block-style-control-height: 52px;
    display: grid;
    grid-template-columns: 160px 120px minmax(240px, 1.2fr);
    gap: 14px;
    align-items: end;
}

.block-style-row > label,
.block-style-row > .block-preview-panel {
    min-width: 0;
}

.block-preview-panel {
    display: grid;
    gap: 10px;
    justify-content: start;
}

.block-style-row select,
.block-style-row input[type="color"] {
    height: var(--block-style-control-height);
}

.block-style-row input[type="color"] {
    padding: 6px;
}

.block-form span {
    font-size: 14px;
    color: #835331;
}

.block-form input,
.block-form select,
.block-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
}

.block-form input:focus,
.block-form select:focus,
.block-form textarea:focus {
    outline: 3px solid rgba(210, 106, 27, 0.12);
    border-color: rgba(210, 106, 27, 0.24);
}

.block-preview-stage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--block-style-control-height);
    height: var(--block-style-control-height);
    width: fit-content;
    padding: 0;
    border: none;
    background: transparent;
}

.block-preview-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--slot-width, 72px);
    min-width: var(--slot-width, 72px);
}

.block-preview-slot .slot-module {
    width: 100%;
}

.block-preview-slot .slot-module::before {
    display: none;
}

.screw-stage .slot-module::before {
    display: none;
}

.empty-state {
    padding: 28px;
    border: 1px dashed var(--line-strong);
    border-radius: 0;
    color: var(--muted);
    text-align: center;
}

.card,
.sidebar,
.section-heading,
.stage-instructions,
.annotation,
.screw-stage-wrap,
.selection-toolbar,
.management-actions,
.history-actions {
    border-radius: 0;
}

@media (max-width: 1440px) {
    :root {
        --stage-top-band-height: 128px;
        --stage-middle-band-height: 80px;
        --stage-bottom-band-height: 104px;
    }

    .screw-stage-wrap {
        justify-content: center;
        padding-top: 14px;
    }
}

@media (max-width: 960px) {
    .app-shell,
    .workspace-grid,
    .management-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    body {
        overflow: auto;
    }

    .main-content,
    #home.page.active,
    .workspace-grid {
        height: auto;
        overflow: visible;
    }

    .block-library {
        overflow: visible;
        min-height: auto;
    }

    .block-library-card,
    .screw-stage-card {
        height: auto;
    }

    .workspace-grid.library-collapsed .block-library-card {
        height: 0;
        min-height: 0;
        max-height: 0;
        border-width: 0;
    }

    .screw-stage-wrap {
        min-height: calc(var(--stage-top-band-height) + var(--stage-middle-band-height) + var(--stage-bottom-band-height) + 28px);
        padding-top: 14px;
    }
}

@media (max-width: 980px) {
    .system-settings-shell,
    .system-settings-fields,
    .system-choice-group,
    .system-toggle-grid,
    .export-options-grid {
        grid-template-columns: 1fr;
    }

    .system-settings-aside {
        position: static;
    }
}

@media (max-width: 720px) {
    .sidebar {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-inline-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --stage-top-band-height: 112px;
        --stage-middle-band-height: 76px;
        --stage-bottom-band-height: 88px;
    }

    .main-content {
        padding: 18px;
    }

    .card,
    .sidebar {
        padding: 18px;
    }

    .brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .section-heading,
    .selection-toolbar {
        flex-direction: column;
    }

    .annotation {
        padding: 0 36px;
    }

    .screw-stage {
        padding: 30px 36px;
    }

    .slot,
    .slot-module,
    .annotation-item {
        min-width: 76px;
        width: 76px;
    }

    .annotation-item {
        flex-basis: 76px;
    }
}

@page {
    size: landscape;
    margin: 10mm;
}

@media print {
    html,
    body {
        overflow: visible !important;
        background: #ffffff !important;
        width: 100% !important;
        height: 100% !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body * {
        visibility: hidden !important;
    }

    #print-stage-root,
    #print-stage-root * {
        visibility: visible !important;
    }

    body,
    .app-shell {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .app-shell,
    .sidebar,
    .brand,
    .nav-menu,
    .main-content,
    .page,
    .workspace-grid,
    .block-library-card,
    .screw-stage-card,
    .section-heading,
    .selection-toolbar,
    .delete-dropzone,
    .toast,
    .modal-backdrop {
        display: none !important;
    }

    #print-stage-root {
        position: fixed !important;
        inset: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 10mm !important;
        background: #ffffff !important;
        overflow: hidden !important;
    }

    .print-stage-frame {
        width: fit-content !important;
        max-width: none !important;
        zoom: var(--print-stage-scale, 1);
        transform-origin: center center !important;
        background: #ffffff !important;
    }

    .print-stage-image {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
    }
}
