:root {
    --page-bg:
        radial-gradient(circle at top left, rgba(244, 194, 118, 0.26), transparent 28%),
        radial-gradient(circle at top right, rgba(145, 197, 255, 0.16), transparent 28%),
        linear-gradient(180deg, #fffdfa 0%, #f7f0df 100%);
    --text: #2b2116;
    --muted: #6d5b47;
    --accent-strong: #b55e17;
    --line: rgba(142, 106, 52, 0.18);
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--page-bg);
}

.pp-page {
    line-height: 1.5;
}

.pp-app {
    line-height: 1.5;
    font-family: "Source Sans 3", sans-serif;
    color: var(--text);
}

.pp-app h1,
.pp-app h2,
.pp-app h3,
.pp-app button,
.pp-app .pill,
.pp-app .status-chip,
.pp-app .seed-pill,
.pp-app .meta-pill {
    font-family: "Space Grotesk", sans-serif;
}

.pp-app a {
    color: inherit;
}

.pp-app button,
.pp-app input,
.pp-app textarea,
.pp-app select {
    font: inherit;
}

.pp-app button {
    color: inherit;
}

.pp-app code,
.pp-app pre {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.pp-app,
.pp-app *,
.pp-app *::before,
.pp-app *::after {
    box-sizing: border-box;
}

.pp-app [hidden] {
    display: none !important;
}

.app-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.panel {
    background: rgba(255, 252, 245, 0.88);
    border: 1px solid rgba(148, 108, 54, 0.16);
    border-radius: 1.5rem;
    box-shadow: 0 24px 60px rgba(95, 68, 24, 0.08);
    backdrop-filter: blur(16px);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.hero-copy {
    padding: 1rem 0.5rem 0 0;
}

.eyebrow {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
}

.hero-summary {
    max-width: 58rem;
    margin: 1.1rem 0 0;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--muted);
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.pill,
.meta-pill,
.status-chip,
.seed-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-strong);
    background: rgba(242, 153, 74, 0.12);
    border: 1px solid rgba(242, 153, 74, 0.24);
}

.hero-guide {
    padding: 1.35rem 1.4rem 1.3rem;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-head h2,
.panel-head h3 {
    margin: 0;
    font-size: 1.1rem;
}

.compact-head {
    margin-bottom: 0.65rem;
}

.hero-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    line-height: 1.7;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1.5rem;
}

.workspace-left,
.workspace-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.image-panel,
.preview-panel,
.status-panel,
.examples-panel {
    padding: 1.25rem;
}

.drop-zone,
.result-frame,
.model-frame {
    position: relative;
    min-height: 24rem;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px dashed rgba(142, 106, 52, 0.28);
    background:
        radial-gradient(circle at top right, rgba(255, 224, 163, 0.55), transparent 38%),
        linear-gradient(180deg, rgba(255, 247, 231, 0.95), rgba(248, 239, 219, 0.92));
}

.drop-zone.camera {
    border-style: solid;
}

.drop-zone.dragover {
    border-color: rgba(242, 153, 74, 0.6);
    box-shadow: inset 0 0 0 1px rgba(242, 153, 74, 0.18);
}

.drop-zone.paste {
    display: flex;
    align-items: stretch;
}

.drop-zone-body,
.result-frame,
.model-frame {
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-overlay-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.paste-target {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.paste-target small,
.empty-preview small,
.meta-note,
.support-copy,
.controls-card li,
.status-copy,
.hero-list,
.notes-list {
    color: var(--muted);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 2rem;
    text-align: center;
}

.drop-zone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--accent-strong);
    font-size: 1.5rem;
    box-shadow: 0 10px 22px rgba(110, 76, 18, 0.12);
}

.source-toolbar {
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.9rem;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.source-button,
.ghost-action,
.secondary-action,
.download-link,
.support-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(138, 103, 48, 0.18);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.source-button {
    min-height: 2.75rem;
    font-weight: 700;
}

.source-button.active {
    background: linear-gradient(135deg, #f2994a, #f2c94c);
    color: #432f12;
    box-shadow: 0 10px 20px rgba(242, 153, 74, 0.24);
}

.selection-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.meta-note {
    font-size: 0.95rem;
}

.settings-panel {
    padding: 1.15rem 1.25rem 1.25rem;
}

.settings-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    font-size: 1.05rem;
    font-weight: 700;
}

.settings-summary::-webkit-details-marker {
    display: none;
}

.settings-summary-note {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.settings-intro {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
    font-size: 0.96rem;
}

.settings-intro p {
    margin: 0;
    color: var(--muted);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.setting-card {
    padding: 1rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(146, 105, 49, 0.12);
}

.setting-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.setting-head.compact {
    margin-bottom: 0.55rem;
}

.setting-head.secondary {
    margin-top: 0.9rem;
}

.setting-head label {
    display: block;
    margin: 0;
    font-weight: 700;
}

.setting-head small {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
}

.reset-icon {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(242, 153, 74, 0.1);
    color: var(--accent-strong);
    font-size: 1rem;
    cursor: pointer;
}

.setting-card input[type="number"] {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(142, 106, 52, 0.18);
    background: rgba(255, 255, 255, 0.92);
}

.setting-card input[type="range"] {
    width: 100%;
    margin-top: 0.8rem;
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
}

.primary-action,
.secondary-action,
.ghost-action,
.download-link {
    min-height: 3rem;
    padding: 0.75rem 1.3rem;
    font-weight: 700;
    cursor: pointer;
}

.primary-action {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef8d36, #f2c94c);
    color: #372309;
    box-shadow: 0 14px 30px rgba(239, 141, 54, 0.24);
}

.primary-action:disabled,
.secondary-action:disabled,
.ghost-action:disabled,
.source-button:disabled,
.example-card:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.secondary-action,
.ghost-action {
    border: 1px solid rgba(142, 106, 52, 0.18);
    background: rgba(255, 255, 255, 0.78);
}

.status-panel {
    padding: 1.2rem 1.25rem 1.25rem;
}

.action-feedback {
    padding: 1rem 1.15rem;
}

.action-feedback .status-copy {
    margin-top: 0;
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.stage-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(146, 105, 49, 0.12);
    background: rgba(255, 255, 255, 0.66);
}

.stage-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.stage-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.stage-card.pending {
    opacity: 0.75;
}

.stage-card.active {
    border-color: rgba(242, 153, 74, 0.44);
    background: rgba(255, 246, 221, 0.92);
    box-shadow: inset 0 0 0 1px rgba(242, 153, 74, 0.14);
}

.stage-card.complete {
    border-color: rgba(39, 174, 96, 0.28);
    background: rgba(236, 248, 240, 0.95);
}

.stage-card.failed {
    border-color: rgba(211, 76, 84, 0.35);
    background: rgba(255, 240, 240, 0.95);
}

.stage-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--accent-strong);
    font-weight: 800;
}

.status-copy {
    margin: 1rem 0 0;
    line-height: 1.7;
}

.status-alert {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    color: #8d2630;
    background: rgba(252, 227, 230, 0.95);
    border: 1px solid rgba(211, 76, 84, 0.22);
}

.loading-state {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(255, 249, 238, 0.82);
    backdrop-filter: blur(4px);
}

.loading-card {
    width: min(26rem, 100%);
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(146, 105, 49, 0.14);
    box-shadow: 0 20px 40px rgba(95, 68, 24, 0.08);
}

.loading-card strong {
    display: block;
    font-size: 1rem;
}

.loading-card p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.loading-bar {
    margin-top: 0.9rem;
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(242, 153, 74, 0.14);
}

.loading-bar span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #ef8d36, #f2c94c);
    animation: loading-slide 1.25s ease-in-out infinite;
}

.preview-panel {
    padding: 1.25rem;
    min-height: 100%;
}

.model-frame {
    min-height: 34rem;
}

.model-viewer {
    width: 100%;
    height: 34rem;
    background:
        radial-gradient(circle at top, rgba(255, 235, 198, 0.55), transparent 42%),
        linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(248, 239, 219, 0.9));
}

.controls-card {
    margin-top: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 1.05rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(146, 105, 49, 0.12);
}

.controls-card h3 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
}

.controls-card ul,
.notes-list {
    margin: 0;
    padding-left: 1.15rem;
    line-height: 1.7;
}

.examples-panel {
    margin-top: 1.5rem;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0.85rem;
}

.example-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.7rem;
    border-radius: 1rem;
    border: 1px solid rgba(142, 106, 52, 0.14);
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.example-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.8rem;
}

.example-card span {
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
}

.example-card.selected {
    border-color: rgba(242, 153, 74, 0.45);
    box-shadow: 0 14px 24px rgba(242, 153, 74, 0.16);
    transform: translateY(-2px);
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.notes-grid .panel {
    padding: 1.25rem;
}

.support-copy {
    margin: 0;
    line-height: 1.7;
}

.support-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.support-links a,
.download-link {
    padding: 0.7rem 1rem;
    font-weight: 700;
}

.source-button:hover,
.ghost-action:hover,
.secondary-action:hover,
.download-link:hover,
.example-card:hover,
.support-links a:hover,
.primary-action:hover {
    transform: translateY(-1px);
}

@keyframes loading-slide {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(70%);
    }

    100% {
        transform: translateX(180%);
    }
}

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

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

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

@media (max-width: 860px) {
    .app-shell {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .image-grid,
    .settings-grid,
    .stage-grid,
    .notes-grid {
        grid-template-columns: 1fr;
    }

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

    .model-frame,
    .model-viewer {
        min-height: 24rem;
        height: 24rem;
    }
}

@media (max-width: 560px) {
    .app-shell {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }

    .source-toolbar {
        grid-template-columns: 1fr;
    }

    .action-row,
    .selection-meta,
    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

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