:root {
    --ink: #18222d;
    --muted: #6c7884;
    --line: #dbe1e6;
    --paper: #f7f8f6;
    --panel: #fff;
    --accent: #1f6f63;
    --accent-dark: #15564e;
    --warm: #e9a35a;
    --danger: #a3483f;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font:
        15px/1.5 Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
}
.topbar {
    min-height: 72px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 760;
    letter-spacing: 0.02em;
}
.brand-mark {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
}
.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.usage-badge {
    font-size: 12px;
    color: var(--muted);
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
}
.ghost-btn,
.secondary-btn,
.icon-btn,
.link-btn {
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.ghost-btn {
    font-weight: 650;
}
.vip-btn {
    border: 1px solid #c9812b;
    background: #fff4df;
    color: #965713;
    padding: 8px 13px;
    font-weight: 750;
    cursor: pointer;
}
.vip-btn:hover {
    background: #ffe8bd;
}
.shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 52px 24px 42px;
}
.site-footer {
    padding: 20px 24px 28px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 13px;
}
.site-footer a {
    color: var(--muted);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.hero {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: flex-end;
    margin-bottom: 38px;
}
.eyebrow,
.kicker {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 11px;
    letter-spacing: 0.18em;
    font-weight: 800;
}
.hero h1 {
    margin: 0 0 11px;
    max-width: 620px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.sub {
    max-width: 580px;
    color: var(--muted);
    font-size: 16px;
    margin: 0;
}
.hero-stats {
    display: flex;
    gap: 26px;
    flex-shrink: 0;
}
.hero-stats div {
    display: grid;
    gap: 1px;
}
.hero-stats strong {
    font-size: 25px;
}
.hero-stats span {
    font-size: 12px;
    color: var(--muted);
}
.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 18px;
}
.dropzone {
    min-height: 460px;
    border: 1.5px dashed #b8c5c4;
    background: #f1f5f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px;
    position: relative;
    overflow: hidden;
    transition: 0.2s;
}
.dropzone.drag {
    border-color: var(--accent);
    background: #e7f1ed;
}
.dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.dropzone.has-preview {
    padding: 18px;
    justify-content: flex-start;
}
.drop-icon {
    width: 54px;
    height: 54px;
    border: 1px solid #adc2bb;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-size: 25px;
    margin: 0 auto 16px auto;
}
.dropzone h2 {
    font-size: 19px;
    margin: 0 0 5px;
}
.dropzone p {
    color: var(--muted);
    margin: 0;
}
.preview-canvas {
    display: block;
    max-width: 100%;
    max-height: 385px;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 8px 22px rgba(18, 35, 39, 0.13);
    background: #fff;
}
.file-meta {
    margin-top: 20px;
    padding: 9px 12px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: 13px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.panel {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 25px 27px;
    box-shadow: 0 8px 30px rgba(18, 35, 39, 0.04);
}
.panel-head,
.dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}
.panel h2,
.dialog-head h2 {
    margin: 0;
    font-size: 24px;
}
.icon-btn {
    width: 30px;
    height: 30px;
    font-size: 23px;
    color: var(--muted);
}
.ai-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: #f8f5ec;
    border: 1px solid #eee3ce;
    padding: 14px 15px;
    margin: 24px 0;
}
.ai-copy {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
}
.spark {
    color: #b87a2c;
    font-size: 20px;
}
.ai-copy strong,
.ai-copy small {
    display: block;
}
.ai-copy small {
    color: var(--muted);
    font-size: 12px;
}
.secondary-btn {
    border: 1px solid #c6d4d0;
    padding: 8px 13px;
    color: var(--accent);
    font-weight: 700;
    background: #fff;
    white-space: nowrap;
}
.ai-inline {
    display: flex;
    gap: 9px;
    margin: -12px 0 22px;
}
.ai-inline textarea {
    flex: 1;
    min-width: 0;
    height: 58px;
    padding: 10px;
    resize: vertical;
    border: 1px solid #cfd7dc;
    font: inherit;
    font-size: 14px;
}
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px 15px;
}
.form-grid label {
    min-width: 0;
}
.form-grid label,
.dialog-head + form label {
    display: grid;
    gap: 7px;
    color: #44515d;
    font-size: 12px;
    font-weight: 700;
}
.form-grid input,
.form-grid select,
.dialog-head + form input,
.dialog-head + textarea,
textarea {
    height: 42px;
    min-width: 0;
    border: 1px solid #cfd7dc;
    background: #fff;
    padding: 0 11px;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    outline: 0;
}
.form-grid input:focus,
.form-grid select:focus,
input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 111, 99, 0.1);
}
.input-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.input-pair span {
    text-align: center;
    color: var(--muted);
}
.size-pair {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 0.75fr);
}
.warning {
    margin-top: 18px;
    background: #fff4e8;
    border: 1px solid #f1d1a9;
    color: #8b5a1d;
    padding: 10px 12px;
    font-size: 13px;
}
.primary-btn {
    margin-top: 23px;
    width: 100%;
    height: 48px;
    border: 0;
    background: var(--accent);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-weight: 750;
    cursor: pointer;
}
.primary-btn:hover {
    background: var(--accent-dark);
}
.primary-btn:disabled,
.secondary-btn:disabled,
.vip-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.loading {
    position: relative;
}
.loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-left: 8px;
}
.primary-btn.loading::after {
    color: #fff;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.result {
    margin-top: 13px;
    padding: 11px 12px;
    color: var(--accent);
    background: #edf6f1;
    font-size: 13px;
}
.info-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-top: 38px;
}
.info-strip > div {
    display: flex;
    gap: 11px;
    padding: 18px 8px;
}
.info-icon {
    color: var(--accent);
    font-size: 21px;
}
.info-strip strong,
.info-strip span {
    display: block;
}
.info-strip span {
    font-size: 12px;
    color: var(--muted);
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 20px);
    background: var(--ink);
    color: #fff;
    padding: 11px 16px;
    opacity: 0;
    pointer-events: none;
    transition: 0.25s;
}
.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
dialog {
    border: 1px solid var(--line);
    padding: 25px;
    width: min(420px, calc(100% - 32px));
    box-shadow: 0 20px 70px rgba(18, 35, 39, 0.18);
}
dialog::backdrop {
    background: rgba(18, 35, 39, 0.35);
}
dialog form {
    display: grid;
    gap: 16px;
    margin-top: 23px;
}
dialog textarea {
    width: 100%;
    height: auto;
    padding: 12px;
    resize: vertical;
    margin-top: 24px;
}
.dialog-hint {
    color: var(--muted);
    font-size: 12px;
    margin: 10px 0 0;
}
.link-btn {
    color: var(--accent);
    font-size: 13px;
    margin-top: 15px;
    padding: 0;
}
.hidden {
    display: none !important;
}
.code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}
.code-row .secondary-btn {
    min-width: 108px;
}
.code-row input {
    width: 100%;
}
.vip-plan {
    margin: 17px 0 0;
    padding: 10px 12px;
    border: 1px solid #eee3ce;
    background: #fff8e9;
    color: #8b5a1d;
    font-size: 14px;
    font-weight: 750;
}
.payment-options {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}
.payment-option {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 13px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.payment-option:hover {
    border-color: var(--accent);
    background: #f5faf8;
}
.payment-option strong,
.payment-option small {
    display: block;
}
.payment-option small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}
.payment-logo {
    width: 38px;
    height: 38px;
    display: block;
    object-fit: contain;
}
@media (max-width: 800px) {
    .topbar {
        height: auto;
        min-height: 72px;
        padding: 14px 18px;
        gap: 12px;
        align-items: flex-start;
    }
    .top-actions {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .hero {
        display: block;
    }
    .hero h1 {
        font-size: clamp(32px, 9vw, 48px);
    }
    .hero-stats {
        margin-top: 25px;
        gap: 20px;
    }
    .workspace {
        grid-template-columns: 1fr;
    }
    .dropzone {
        min-height: 300px;
    }
    .preview-canvas {
        max-height: 255px;
    }
    .panel {
        padding: 21px 18px;
    }
    .info-strip {
        grid-template-columns: 1fr;
    }
    .info-strip > div {
        padding: 14px 3px;
    }
    .ai-inline {
        display: grid;
        grid-template-columns: 1fr;
    }
    .ai-inline .secondary-btn {
        width: 100%;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .usage-badge {
        display: none;
    }
    .shell {
        padding: 32px 16px 30px;
    }
}
