.lr-shell {
    width: min(1440px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 56px;
    color: #e5edf7;
}

.lr-shell *,
.lr-shell *::before,
.lr-shell *::after {
    box-sizing: border-box;
}

.lr-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 18px;
}

.lr-hero__copy,
.lr-upload,
.lr-panel,
.lr-summary,
.lr-empty,
.lr-alert {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.9)),
        rgba(15, 23, 42, 0.94);
    box-shadow: 0 18px 55px rgba(2, 6, 23, 0.32);
}

.lr-hero__copy {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    position: relative;
    overflow: hidden;
}

.lr-hero__copy::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 5px;
    background: linear-gradient(90deg, #22c55e, #06b6d4, #f59e0b, #ef4444);
}

.lr-back {
    position: absolute;
    top: 18px;
    left: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #b7c6d8;
    font-size: 13px;
    font-weight: 700;
    transition: color 0.18s ease;
}

.lr-back:hover {
    color: #ffffff;
}

.lr-kicker {
    margin: 0 0 8px;
    color: #7dd3fc;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.lr-hero h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
    color: #ffffff;
}

.lr-hero__lead {
    max-width: 620px;
    margin: 16px 0 0;
    color: #cbd5e1;
    font-size: 17px;
    line-height: 1.65;
}

.lr-upload {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 14px;
    min-height: 250px;
    padding: 18px;
}

.lr-upload input[type="file"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.lr-upload__target {
    min-height: 164px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 18px;
    border: 1px dashed rgba(125, 211, 252, 0.46);
    border-radius: 8px;
    background: rgba(8, 13, 24, 0.55);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.lr-upload__target:hover,
.lr-upload.is-dragging .lr-upload__target {
    border-color: rgba(52, 211, 153, 0.8);
    background: rgba(5, 46, 22, 0.24);
    transform: translateY(-1px);
}

.lr-upload__icon {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #0f172a;
    background: #7dd3fc;
}

.lr-upload__title {
    color: #ffffff;
    font-weight: 900;
    text-align: center;
    word-break: break-word;
}

.lr-upload__meta {
    color: #93a4b8;
    font-size: 13px;
}

.lr-primary,
.lr-icon-btn,
.lr-viewer-actions button,
.lr-view-mode button,
.lr-pagination button {
    border: 0;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
}

.lr-primary {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #062316;
    background: #34d399;
    font-weight: 900;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.lr-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.lr-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.lr-alert--error {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.34);
}

.lr-empty {
    min-height: 340px;
    display: grid;
    grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 24px;
}

.lr-empty__visual {
    min-height: 260px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #101827;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.lr-empty__visual img {
    width: min(180px, 70%);
    height: auto;
    image-rendering: pixelated;
}

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

.lr-empty__grid div {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.045);
}

.lr-empty__grid svg {
    color: #7dd3fc;
}

.lr-empty__grid strong {
    color: #ffffff;
    font-size: 17px;
}

.lr-empty__grid span {
    color: #95a4b8;
    font-size: 13px;
}

.lr-summary {
    padding: 18px;
    margin-bottom: 18px;
}

.lr-title-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.lr-title-card h2,
.lr-panel h2 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
    line-height: 1.18;
    letter-spacing: 0;
}

.lr-title-card p {
    margin: 8px 0 0;
    color: #93a4b8;
    overflow-wrap: anywhere;
}

.lr-title-card__badge,
.lr-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    max-width: 320px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #fde68a;
    background: rgba(120, 53, 15, 0.32);
    border: 1px solid rgba(245, 158, 11, 0.26);
    font-size: 13px;
    font-weight: 800;
}

.lr-title-card__badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lr-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.lr-metrics div,
.lr-step-stats div {
    min-width: 0;
    padding: 13px;
    border-radius: 8px;
    background: rgba(8, 13, 24, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.lr-metrics span,
.lr-step-stats span {
    display: block;
    color: #93a4b8;
    font-size: 12px;
    font-weight: 700;
}

.lr-metrics strong,
.lr-step-stats strong {
    display: block;
    margin-top: 6px;
    color: #ffffff;
    font-size: 20px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.lr-workspace {
    display: grid;
    grid-template-columns: minmax(330px, 0.38fr) minmax(0, 0.62fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.lr-panel {
    min-width: 0;
    padding: 18px;
}

.lr-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.lr-panel__head > div {
    min-width: 0;
}

.lr-panel--steps,
.lr-panel--viewer {
    min-height: 640px;
}

.lr-progress-ring {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#34d399 var(--lr-progress, 0%), rgba(148, 163, 184, 0.16) 0);
}

.lr-progress-ring span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #101827;
    font-size: 12px;
    font-weight: 900;
}

.lr-layer-control {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.lr-icon-btn,
.lr-viewer-actions button,
.lr-pagination button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    color: #d7e2ef;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.lr-icon-btn:hover,
.lr-viewer-actions button:hover,
.lr-pagination button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.13);
    transform: translateY(-1px);
}

.lr-icon-btn:disabled,
.lr-pagination button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.lr-layer-control input[type="range"] {
    width: 100%;
    accent-color: #34d399;
}

.lr-current-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.72), rgba(14, 116, 144, 0.56));
    border: 1px solid rgba(125, 211, 252, 0.2);
}

.lr-current-step span {
    display: block;
    color: #c7fff2;
    font-size: 13px;
    font-weight: 800;
}

.lr-current-step strong {
    display: block;
    margin-top: 3px;
    font-size: 30px;
    line-height: 1;
}

.lr-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lr-check span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ccfbf1;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(204, 251, 241, 0.3);
    cursor: pointer;
}

.lr-check input:checked + span {
    color: #052e1a;
    background: #34d399;
    border-color: #34d399;
}

.lr-step-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.lr-layer-materials {
    display: grid;
    gap: 8px;
    min-height: 180px;
    margin-bottom: 12px;
}

.lr-material-pill {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.lr-material-pill img,
.lr-material-name img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    image-rendering: pixelated;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
}

.lr-material-pill span {
    min-width: 0;
    color: #dbeafe;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lr-material-pill strong {
    color: #7dd3fc;
    font-size: 13px;
}

.lr-layer-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 255px;
    overflow: auto;
    padding-right: 2px;
}

.lr-layer-list button {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.045);
    font: inherit;
    cursor: pointer;
}

.lr-layer-list button.is-active {
    color: #ffffff;
    border-color: rgba(52, 211, 153, 0.52);
    background: rgba(6, 95, 70, 0.38);
}

.lr-layer-list button.is-complete {
    border-color: rgba(52, 211, 153, 0.28);
}

.lr-layer-list span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lr-view-mode {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.lr-view-mode button {
    min-height: 34px;
    padding: 0 10px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.07);
}

.lr-view-mode button.is-active {
    color: #052e1a;
    background: #34d399;
}

.lr-viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.lr-viewer-actions button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 800;
}

.lr-viewer-actions button.is-active {
    color: #052e1a;
    background: #7dd3fc;
}

.lr-viewer {
    position: relative;
    min-height: 520px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: #080d18;
}

.lr-viewer canvas {
    display: block;
    width: 100%;
    height: 520px;
}

.lr-viewer__fallback {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    gap: 8px;
    color: #cbd5e1;
    background: rgba(8, 13, 24, 0.92);
}

.lr-viewer.is-empty .lr-viewer__fallback {
    display: grid;
}

.lr-viewer-meta {
    min-height: 20px;
    margin: 10px 0 0;
    color: #8da0b4;
    font-size: 12px;
}

.lr-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.34fr);
    gap: 18px;
}

.lr-search {
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    min-height: 38px;
    border-radius: 8px;
    color: #93a4b8;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.lr-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    color: #ffffff;
    background: transparent;
    font: inherit;
}

.lr-material-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.lr-material-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 13px;
}

.lr-material-table th,
.lr-material-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    text-align: left;
    vertical-align: middle;
}

.lr-material-table th {
    color: #93a4b8;
    background: rgba(8, 13, 24, 0.78);
    font-size: 12px;
    font-weight: 900;
}

.lr-material-table td {
    color: #dbe6f2;
}

.lr-material-table code {
    display: inline-block;
    max-width: 520px;
    color: #93c5fd;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.lr-material-name {
    display: inline-grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    max-width: 280px;
}

.lr-material-name strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lr-material-name__empty {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.18);
}

.lr-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: #93a4b8;
    font-size: 13px;
}

.lr-pagination button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 800;
}

.lr-region-list {
    display: grid;
    gap: 9px;
}

.lr-region-list details {
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.045);
}

.lr-region-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    cursor: pointer;
}

.lr-region-list summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffffff;
    font-weight: 800;
}

.lr-region-list summary strong {
    color: #7dd3fc;
    font-size: 13px;
}

.lr-region-detail {
    padding: 0 12px 12px;
    color: #9caec2;
    font-size: 13px;
    line-height: 1.6;
}

.lr-region-detail p,
.lr-description p {
    margin: 6px 0 0;
}

.lr-description {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
    font-size: 13px;
}

.lr-description strong {
    color: #ffffff;
}

.lr-muted-state {
    min-height: 118px;
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 18px;
    border-radius: 8px;
    color: #aebdd0;
    text-align: center;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

@media (max-width: 1180px) {
    .lr-hero,
    .lr-workspace,
    .lr-lower-grid {
        grid-template-columns: 1fr;
    }

    .lr-panel--steps,
    .lr-panel--viewer {
        min-height: auto;
    }
}

@media (max-width: 820px) {
    .lr-shell {
        width: min(100% - 20px, 1440px);
        padding-top: 18px;
    }

    .lr-hero__copy {
        min-height: 230px;
        padding: 24px 18px;
    }

    .lr-upload {
        min-height: 220px;
    }

    .lr-empty,
    .lr-empty__grid {
        grid-template-columns: 1fr;
    }

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

    .lr-title-card,
    .lr-panel__head {
        align-items: stretch;
        flex-direction: column;
    }

    .lr-search {
        min-width: 0;
        width: 100%;
    }

    .lr-step-stats {
        grid-template-columns: 1fr;
    }

    .lr-layer-list {
        grid-template-columns: 1fr;
    }

    .lr-viewer,
    .lr-viewer canvas {
        min-height: 420px;
        height: 420px;
    }
}

@media (max-width: 520px) {
    .lr-metrics {
        grid-template-columns: 1fr;
    }

    .lr-view-mode {
        justify-content: flex-start;
    }

    .lr-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .lr-pagination button {
        width: 100%;
    }
}
