:root {
    color-scheme: dark;
    --bg: #070814;
    --panel: rgba(255, 255, 255, 0.08);
    --panel-strong: rgba(255, 255, 255, 0.13);
    --line: rgba(255, 255, 255, 0.16);
    --text: #f7f8ff;
    --muted: rgba(247, 248, 255, 0.68);
    --accent: #8a7cff;
    --accent-2: #31d9ff;
    --gold: #f8d58c;
    --danger: #ff6b8a;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
            radial-gradient(circle at 12% 12%, rgba(138, 124, 255, 0.25), transparent 34%),
            radial-gradient(circle at 82% 18%, rgba(49, 217, 255, 0.18), transparent 30%),
            linear-gradient(135deg, #070814 0%, #10142a 48%, #090a13 100%);
    color: var(--text);
}

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

.page-shell {
    position: relative;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 56px;
    overflow: hidden;
}

.ambient {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(78px);
    opacity: 0.38;
    pointer-events: none;
}

.ambient-one {
    top: -120px;
    left: -100px;
    background: #8a7cff;
}

.ambient-two {
    right: -130px;
    bottom: 100px;
    background: #31d9ff;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 58px;
}

.brand,
.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: 21px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    box-shadow: 0 0 36px rgba(138, 124, 255, 0.55);
}

.nav-pill {
    border: 1px solid var(--line);
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(18px);
}

.hero-grid {
    display: grid;
    gap: 30px;
    align-items: center;
}

.intro-row {
    grid-template-columns: 1fr;
    max-width: 960px;
    margin-bottom: 24px;
}

.hero-copy h1 {
    margin: 14px 0 20px;
    font-size: clamp(46px, 7vw, 82px);
    line-height: 0.95;
    letter-spacing: -0.08em;
}

.hero-copy p {
    width: min(610px, 100%);
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.eyebrow {
    display: inline-flex;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 12px;
    font-weight: 800;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: min(580px, 100%);
    margin-top: 34px;
}

.hero-stats div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.055);
}

.hero-stats strong,
.hero-stats span {
    display: block;
}

.hero-stats strong {
    font-size: 22px;
}

.hero-stats span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.glass-card {
    border: 1px solid var(--line);
    border-radius: 34px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px);
}

.form-card {
    padding: 28px;
}

.input-card {
    margin-top: 24px;
}

.input-head {
    align-items: center;
    margin-bottom: 18px;
}

.input-card form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.input-card form > label:nth-of-type(1),
.input-card form > label:nth-of-type(2),
.input-card .quick-row,
.input-card .field-grid,
.input-card input[type="hidden"],
.input-card #submitBtn,
.input-card .safe-note {
    grid-column: 1 / -1;
}

.input-card #submitBtn {
    max-width: 360px;
    width: 100%;
    justify-self: center;
}

form {
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 10px;
}

label span {
    color: rgba(247, 248, 255, 0.84);
    font-size: 14px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    outline: none;
    border-radius: 18px;
    background: rgba(7, 8, 20, 0.62);
    color: var(--text);
    padding: 15px 16px;
    transition: 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 154px;
    line-height: 1.7;
}

.reference-upload small {
    color: rgba(247, 248, 255, 0.58);
    font-size: 12px;
    line-height: 1.5;
}

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

.reference-file-input {
    display: none;
}

.reference-add-btn,
.reference-clear-btn {
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 800;
}

.reference-clear-btn {
    color: rgba(247, 248, 255, 0.72);
    background: rgba(7, 8, 20, 0.45);
}

.reference-preview {
    display: block;
    min-height: 180px;
    padding: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(7, 8, 20, 0.28);
}

.reference-preview-empty {
    display: grid;
    place-items: center;
    min-height: 156px;
    color: rgba(247, 248, 255, 0.52);
    font-size: 13px;
}

.reference-preview-item {
    margin: 0;
    overflow: hidden;
}

.reference-preview-carousel {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

.reference-preview-item img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(7, 8, 20, 0.58);
}

.reference-preview-caption {
    max-width: 100%;
    margin-top: 10px;
    color: rgba(247, 248, 255, 0.68);
    font-size: 12px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reference-preview-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: var(--text);
    background: rgba(7, 8, 20, 0.7);
    transform: translateY(-50%);
}

.reference-preview-nav[data-reference-direction="-1"] {
    left: 10px;
}

.reference-preview-nav[data-reference-direction="1"] {
    right: 10px;
}

.reference-preview-nav:disabled {
    cursor: not-allowed;
    opacity: 0.28;
}

.reference-preview-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    background: rgba(7, 8, 20, 0.68);
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(49, 217, 255, 0.66);
    box-shadow: 0 0 0 4px rgba(49, 217, 255, 0.11);
}

.field-grid {
    display: grid;
    gap: 14px;
}

.field-grid.two {
    grid-template-columns: 1fr 1fr;
}

.field-grid.three {
    grid-template-columns: repeat(3, 1fr);
}

.field-grid.four {
    grid-template-columns: repeat(4, 1fr);
}

.polish-grid {
    grid-template-columns: minmax(220px, 320px) 1fr;
    align-items: end;
}

.polish-tip {
    min-height: 52px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(49, 217, 255, 0.16);
    border-radius: 18px;
    padding: 13px 16px;
    color: rgba(247, 248, 255, 0.68);
    font-size: 13px;
    line-height: 1.55;
    background: rgba(49, 217, 255, 0.055);
}

button {
    border: 0;
    cursor: pointer;
}

.quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-row button,
.prompt-tabs button,
.template-card,
.ghost-btn {
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quick-row button:hover,
.template-card:hover,
.ghost-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.quick-row button {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    padding: 9px 12px;
    color: rgba(247, 248, 255, 0.86);
    background: rgba(255, 255, 255, 0.07);
}

#submitBtn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    border-radius: 20px;
    color: #080a16;
    font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff, #a7efff 42%, #a99eff);
    box-shadow: 0 20px 48px rgba(49, 217, 255, 0.22);
}

#submitBtn:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(8, 10, 22, 0.2);
    border-top-color: #080a16;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading .btn-text {
    display: none;
}

.loading .loader {
    display: inline-block;
}

.safe-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.inspiration-card {
    margin-top: 24px;
    padding: 20px;
    overflow: hidden;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.compact-head {
    align-items: center;
    margin-bottom: 14px;
}

.section-head h2 {
    margin: 8px 0 0;
    font-size: 30px;
    letter-spacing: -0.05em;
}

.section-head p {
    max-width: 410px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.slider-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider-buttons {
    display: flex;
    gap: 8px;
}

.slider-buttons button {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    transition: 0.2s ease;
}

.slider-buttons button:hover {
    transform: translateY(-2px);
    border-color: rgba(49, 217, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
}

.template-slider-wrap {
    position: relative;
}

.template-slider-wrap::before,
.template-slider-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 42px;
    pointer-events: none;
}

.template-slider-wrap::before {
    left: 0;
    background: linear-gradient(90deg, rgba(16, 20, 42, 0.92), transparent);
}

.template-slider-wrap::after {
    right: 0;
    background: linear-gradient(270deg, rgba(16, 20, 42, 0.92), transparent);
}

.template-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 285px);
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 42px 10px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
}

.template-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    align-content: start;
    gap: 10px;
    min-height: 168px;
    padding: 16px;
    scroll-snap-align: start;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 24px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
}

.template-card:hover {
    border-color: rgba(49, 217, 255, 0.38);
    background: rgba(255, 255, 255, 0.085);
}

.template-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    width: auto;
    max-width: 100%;
    min-height: 26px;
    line-height: 1;
    border: 1px solid rgba(248, 213, 140, 0.34);
    border-radius: 999px;
    padding: 0 10px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    background: rgba(248, 213, 140, 0.08);
}

.template-card strong {
    font-size: 19px;
    letter-spacing: -0.04em;
}

.template-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 13px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    margin-top: 24px;
}

.result-card,
.prompt-card {
    padding: 26px;
}

.result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.result-head h2,
.prompt-card h2 {
    margin: 8px 0 0;
    font-size: 28px;
    letter-spacing: -0.05em;
}

.ghost-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 11px 15px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.ghost-btn:disabled {
    cursor: not-allowed;
    color: var(--muted);
}

.empty-state,
.image-wrap {
    min-height: 520px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    background: rgba(0, 0, 0, 0.18);
}

.empty-state {
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    padding: 28px;
}

.preview-orb {
    width: 128px;
    height: 128px;
    border-radius: 38px;
    background:
            radial-gradient(circle at 28% 24%, #fff, transparent 22%),
            linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 34px 90px rgba(138, 124, 255, 0.38);
    transform: rotate(-8deg);
}

.empty-state h3 {
    margin: 28px 0 8px;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.empty-state p,
.prompt-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.image-wrap {
    overflow: hidden;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px;
}

.result-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 438px;
    border-radius: 22px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.result-carousel img {
    width: 100%;
    height: 100%;
    min-height: 438px;
    object-fit: contain;
    display: block;
}

.result-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: var(--text);
    background: rgba(7, 8, 20, 0.7);
    transform: translateY(-50%);
    backdrop-filter: blur(14px);
}

.result-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
}

.result-nav:disabled {
    cursor: not-allowed;
    opacity: 0.32;
}

#resultPrev {
    left: 16px;
}

#resultNext {
    right: 16px;
}

.image-counter {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    background: rgba(7, 8, 20, 0.72);
    backdrop-filter: blur(14px);
}

.thumbnail-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.26) transparent;
}

.thumbnail-btn {
    position: relative;
    flex: 0 0 78px;
    width: 78px;
    height: 78px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

.thumbnail-btn.active {
    border-color: rgba(49, 217, 255, 0.86);
    box-shadow: 0 0 0 4px rgba(49, 217, 255, 0.12);
}

.thumbnail-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-btn span {
    position: absolute;
    right: 6px;
    bottom: 5px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #080a16;
    font-size: 12px;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff, #a7efff 52%, #a99eff);
}

.prompt-card {
    align-self: start;
    position: sticky;
    top: 24px;
}

.prompt-card p {
    margin-top: 18px;
    max-height: 280px;
    overflow: auto;
    word-break: break-word;
}

.prompt-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
}

.prompt-tabs button {
    border-radius: 999px;
    padding: 9px 12px;
    color: var(--muted);
    background: transparent;
}

.prompt-tabs button.active {
    color: #080a16;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff, #a7efff 52%, #a99eff);
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.meta-grid div {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.055);
}

.meta-grid span,
.meta-grid strong {
    display: block;
}

.meta-grid span {
    color: var(--muted);
    font-size: 12px;
}

.meta-grid strong {
    margin-top: 6px;
    font-size: 14px;
}

.hidden {
    display: none;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    max-width: min(560px, calc(100% - 40px));
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    color: var(--text);
    background: rgba(16, 20, 42, 0.88);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: 0.22s ease;
    backdrop-filter: blur(18px);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-color: rgba(255, 107, 138, 0.52);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

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

    .field-grid.four {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .prompt-card {
        position: static;
    }

    .template-grid {
        grid-auto-columns: minmax(250px, 30vw);
    }
}

@media (max-width: 860px) {
    .field-grid.two,
    .field-grid.three,
    .field-grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .page-shell {
        width: min(100% - 28px, 1180px);
        padding: 24px 0 42px;
    }

    .nav {
        margin-bottom: 38px;
    }

    .hero-copy h1 {
        font-size: clamp(40px, 12vw, 64px);
    }

    .hero-copy p {
        font-size: 16px;
    }

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

    .form-card,
    .result-card,
    .prompt-card,
    .inspiration-card {
        border-radius: 28px;
        padding: 22px;
    }

    .input-card {
        margin-top: 18px;
    }

    .result-head,
    .section-head {
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    .page-shell {
        width: 100%;
        padding: 16px 12px 34px;
    }

    .ambient {
        width: 260px;
        height: 260px;
        filter: blur(58px);
        opacity: 0.28;
    }

    .nav {
        margin-bottom: 28px;
    }

    .brand {
        font-size: 18px;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    .nav-pill {
        display: none;
    }

    .hero-grid {
        gap: 18px;
    }

    .hero-copy h1 {
        margin: 10px 0 14px;
        font-size: clamp(34px, 13vw, 48px);
        line-height: 1.02;
        letter-spacing: -0.06em;
    }

    .hero-copy p {
        font-size: 15px;
        line-height: 1.72;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 22px;
    }

    .hero-stats div {
        padding: 14px 16px;
        border-radius: 18px;
    }

    .hero-stats strong {
        font-size: 19px;
    }

    .field-grid.two,
    .field-grid.three,
    .field-grid.four,
    .section-head,
    .result-head,
    .slider-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .form-card,
    .result-card,
    .prompt-card,
    .inspiration-card {
        border-radius: 24px;
        padding: 16px;
    }

    form {
        gap: 14px;
    }

    input,
    textarea,
    select {
        min-height: 48px;
        border-radius: 15px;
        padding: 13px 14px;
        font-size: 16px;
    }

    textarea {
        min-height: 132px;
    }

    .quick-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .quick-row::-webkit-scrollbar {
        display: none;
    }

    .quick-row button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    #submitBtn {
        min-height: 54px;
        border-radius: 17px;
    }

    .inspiration-card,
    .input-card,
    .workspace {
        margin-top: 16px;
    }

    .input-card #submitBtn {
        max-width: none;
    }

    .section-head {
        gap: 12px;
        margin-bottom: 12px;
    }

    .section-head h2,
    .result-head h2,
    .prompt-card h2 {
        font-size: 24px;
    }

    .slider-actions {
        gap: 10px;
    }

    .slider-actions p {
        font-size: 13px;
    }

    .slider-buttons {
        justify-content: flex-start;
    }

    .template-grid {
        grid-auto-columns: minmax(230px, 82vw);
        gap: 12px;
        padding: 2px 22px 10px;
    }

    .template-slider-wrap::before,
    .template-slider-wrap::after {
        width: 22px;
    }

    .template-card {
        min-height: 150px;
        border-radius: 20px;
        padding: 14px;
    }

    .result-head {
        gap: 12px;
    }

    .ghost-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 15px;
    }

    .empty-state,
    .image-wrap {
        min-height: 360px;
        border-radius: 22px;
    }

    .image-wrap {
        gap: 12px;
        padding: 10px;
    }

    .result-carousel,
    .result-carousel img {
        min-height: 280px;
    }

    .result-carousel {
        border-radius: 18px;
    }

    .result-nav {
        width: 38px;
        height: 38px;
    }

    #resultPrev {
        left: 10px;
    }

    #resultNext {
        right: 10px;
    }

    .image-counter {
        right: 10px;
        bottom: 10px;
        padding: 7px 10px;
    }

    .thumbnail-strip {
        gap: 8px;
    }

    .thumbnail-btn {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
        border-radius: 15px;
    }

    .prompt-tabs {
        border-radius: 18px;
    }

    .prompt-tabs button {
        padding: 10px 8px;
    }

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

    .toast {
        bottom: 16px;
        max-width: calc(100% - 24px);
        border-radius: 16px;
    }
}

@media (max-width: 380px) {
    .page-shell {
        padding-inline: 10px;
    }

    .hero-copy h1 {
        font-size: 32px;
    }

    .form-card,
    .result-card,
    .prompt-card,
    .inspiration-card {
        padding: 14px;
    }

    .template-grid {
        grid-auto-columns: minmax(210px, 84vw);
    }

    .result-carousel,
    .result-carousel img {
        min-height: 250px;
    }
}
