.favicon-page {
    width: min(1460px, calc(100% - 32px));
    margin: 32px auto 48px;
}

.tool-intro {
    padding: 2px 24px 12px;
    text-align: center;
}

.tool-intro h1 {
    margin: 0 0 10px;
    color: #391020;
    font-size: clamp(28px, 3vw, 38px);
}

.tool-intro p {
    margin: 0;
    color: #6f5260;
    line-height: 1.8;
}

.tool-unavailable,
.upload-start,
.options-panel,
.preview-workspace {
    background: #ffffff;
    border: 1px solid #ead4dd;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(80, 30, 50, 0.06);
}

.tool-unavailable {
    margin-top: 22px;
    padding: 32px;
}

.upload-start {
    margin-top: 22px;
    padding: 18px;
}

.drop-zone {
    min-height: 320px;
    padding: 40px 24px;
    border: 2px dashed #d69ab0;
    border-radius: 18px;
    background: #fff9fb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.is-dragover {
    border-color: #9f1239;
    background: #fff2f6;
}

.drop-zone p {
    margin: 14px 0 8px;
}

.drop-zone small {
    color: #80616d;
    line-height: 1.65;
}

.upload-feedback,
.process-message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #efd6df;
    background: #fff7f9;
    color: #7e314c;
}

.upload-feedback.is-success,
.process-message.is-success {
    background: #f2fbf4;
    border-color: #bfe2c8;
    color: #245c34;
}

.editor-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 24px;
    margin-top: 22px;
    align-items: start;
}

.options-panel {
    overflow: hidden;
}

.options-panel__sticky {
    position: sticky;
    top: var(--header-height);
    padding: 22px;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.options-panel h2 {
    margin: 0 0 18px;
    color: #431326;
    font-size: 1.2rem;
}

.option-section {
    border: 1px solid #f0dde4;
    border-radius: 16px;
    overflow: hidden;
    background: #fffdfd;
}

.option-section + .option-section {
    margin-top: 16px;
}

.option-heading {
    padding: 12px 16px;
    background: #fff4f7;
    border-bottom: 1px solid #f2dfe7;
    font-weight: 700;
    color: #5b1f36;
}

.option-body,
.source-summary {
    padding: 16px;
}

.source-summary {
    color: #5e4350;
    line-height: 1.65;
    word-break: break-word;
}

.field-row,
.field-stack {
    margin-bottom: 14px;
}

.field-row:last-child,
.field-stack:last-child {
    margin-bottom: 0;
}

.field-row label,
.field-label {
    display: block;
    margin-bottom: 6px;
    color: #523441;
    font-size: .94rem;
    font-weight: 600;
}

.field-row input[type="text"],
.field-row input[type="number"],
.field-row select,
.field-stack input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d7c1cb;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-size: .95rem;
}

.field-inline,
.color-input-wrap,
.button-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-inline input[type="range"] {
    flex: 1 1 auto;
    min-width: 90px;
}

.field-inline input[type="number"] {
    width: 82px;
}

.field-inline span {
    color: #735866;
    white-space: nowrap;
}

.color-input-wrap input[type="color"] {
    width: 52px;
    min-width: 52px;
    height: 42px;
    padding: 0;
    border: 1px solid #d7c1cb;
    border-radius: 10px;
    background: #fff;
}

.color-input-wrap input[type="text"] {
    flex: 1 1 auto;
}

.check-option,
.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #543844;
    cursor: pointer;
    user-select: none;
}

.radio-option {
    margin-bottom: 10px;
}

.check-option {
    margin-bottom: 14px;
}

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

.check-option__mark {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid #c9a9b8;
    background: #fff;
    position: relative;
    flex-shrink: 0;
}

.check-option input:checked + .check-option__mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 4px;
    background: #9f1239;
}

.process-button {
    width: 100%;
    justify-content: center;
    margin-top: 18px;
}

.preview-workspace {
    padding: 20px;
    min-width: 0;
}

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

.source-meta {
    margin-left: 10px;
    color: #826573;
    font-size: .9rem;
}

.main-preview-card,
.output-files-card,
.html-snippet-card {
    border: 1px solid #ead4dd;
    border-radius: 18px;
    background: #fffdfd;
}

.main-preview-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-preview-stage {
    width: min(520px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-preview-stage canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.main-preview-caption {
    margin-top: 10px;
    color: #745865;
    font-size: .9rem;
}

.checkerboard {
    background:
        linear-gradient(45deg, #f1dfe6 25%, transparent 25%, transparent 75%, #f1dfe6 75%),
        linear-gradient(45deg, #f1dfe6 25%, transparent 25%, transparent 75%, #f1dfe6 75%),
        #fff;
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
}

.generated-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.generated-card {
    padding: 14px;
    border: 1px solid #ead4dd;
    border-radius: 16px;
    background: #fff;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
}

.generated-card__preview {
    grid-row: 1 / span 2;
    width: 76px;
    height: 76px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #ead4dd;
}

.generated-card__preview canvas {
    image-rendering: auto;
    max-width: 60px;
    max-height: 60px;
}

.generated-card strong {
    color: #4a1a2e;
}

.generated-card span {
    color: #7c606c;
    font-size: .82rem;
    word-break: break-all;
}

.output-files-card,
.html-snippet-card {
    margin-top: 18px;
    padding: 18px;
}

.output-files-card h3,
.html-snippet-card h3 {
    margin: 0;
    color: #4a1a2e;
    font-size: 1rem;
}

.output-files-list {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.output-files-list span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff2f6;
    color: #6d2a44;
    font-size: .82rem;
}

.html-snippet-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.html-snippet-card textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #d7c1cb;
    border-radius: 12px;
    background: #faf7f8;
    color: #432b36;
    font-family: Consolas, Monaco, monospace;
    font-size: .86rem;
    line-height: 1.6;
    resize: vertical;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 1180px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .options-panel__sticky {
        position: static;
        max-height: none;
    }
}

@media (max-width: 850px) {
    .generated-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .favicon-page {
        width: min(100%, calc(100% - 24px));
        margin: 20px auto 32px;
    }

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

    .generated-card {
        grid-template-columns: 68px minmax(0, 1fr);
    }

    .generated-card__preview {
        width: 68px;
        height: 68px;
    }

    .field-inline,
    .button-row,
    .workspace-toolbar,
    .html-snippet-card__header {
        flex-wrap: wrap;
    }
}

.option-section > .button-row {
    padding: 0 16px 16px;
}

.generated-card__preview canvas {
    width: 60px;
    height: 60px;
}
