:root {
    --primary: #4f883d;
    --primary-dark: #355d29;
    --primary-soft: #edf6ea;
    --ink: #203042;
    --muted: #6d7887;
    --panel-border: #dfe5ec;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --preview-bg: #e9edf4;
    --shadow: 0 24px 60px rgba(24, 39, 75, 0.12);
    --radius: 5px;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Nunito", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 211, 163, 0.45), transparent 28%),
        radial-gradient(circle at right center, rgba(150, 204, 180, 0.35), transparent 24%),
        linear-gradient(180deg, #f4f7fb 0%, #edf1f7 100%);
}

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 390px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
}

.app-header {
    grid-column: 1 / -1;
    padding: 18px 28px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(223, 229, 236, 0.9);
    box-shadow: 0 10px 28px rgba(24, 39, 75, 0.06);
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--primary);
}

.app-header h1 {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.header-copy {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 820px;
}

.panel {
    background: rgba(255, 255, 255, 0.94);
    border-right: 1px solid var(--panel-border);
    overflow-y: auto;
}

.section {
    padding: 18px 20px;
    border-bottom: 1px solid #eef2f6;
}

.section-title {
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary);
    margin-bottom: 14px;
}

.form-group,
.option-group,
.actions-section,
.checks-grid {
    display: grid;
    gap: 12px;
}

.option-group + .option-group {
    margin-top: 18px;
}

.option-group.compact {
    margin-top: 18px;
}

label,
.option-label {
    display: block;
    font-weight: 800;
    color: var(--ink);
}

select,
.file-input {
    width: 100%;
    border: 1px solid #d5dde8;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font: inherit;
    padding: 12px 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

select:focus,
.file-input:focus {
    outline: none;
    border-color: rgba(79, 136, 61, 0.75);
    box-shadow: 0 0 0 4px rgba(79, 136, 61, 0.12);
}

.helper-text {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

.toolbar-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.92rem;
}

.counter-row strong {
    min-width: 42px;
    text-align: right;
    color: var(--primary-dark);
    font-size: 1rem;
}

.choice-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 2px solid #dfe5ec;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.choice-btn:hover,
.check-card:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-tertiary:hover,
.asset-tile:hover,
.upload-chip:hover {
    transform: translateY(-1px);
}

.choice-btn input,
.check-card input,
.asset-tile input {
    accent-color: var(--primary);
    margin: 0;
}

.choice-btn:has(input:checked) {
    border-color: var(--primary);
    background: linear-gradient(180deg, #f7fff4 0%, #edf6ea 100%);
    box-shadow: 0 10px 18px rgba(79, 136, 61, 0.12);
}

.symbols-info {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #f4f8ff 0%, #edf3fb 100%);
    border: 1px solid #d8e3f0;
    color: #325173;
    font-size: 0.88rem;
    line-height: 1.45;
}

.check-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface-soft);
    border: 1px solid #e3e9f1;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.check-card:has(input:checked) {
    border-color: rgba(79, 136, 61, 0.45);
    box-shadow: 0 8px 16px rgba(79, 136, 61, 0.08);
}

.info-box,
#info {
    border-radius: var(--radius);
    padding: 14px 16px;
    background: #f5f7fa;
    border: 1px solid #e0e6ed;
    color: var(--muted);
    line-height: 1.45;
}

.info-warning {
    background: #fff1ef;
    border-color: #f6c8bf;
    color: #8b3b30;
}

.info-success {
    background: #eef9ee;
    border-color: #cde8cb;
    color: #2f6e3d;
}

button {
    font: inherit;
}

.btn-primary,
.btn-secondary,
.btn-tertiary {
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    font-weight: 800;
    transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease, background 0.14s ease;
}

.btn-primary {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(180deg, #5c9d47 0%, #4f883d 100%);
    color: #fff;
    box-shadow: 0 14px 26px rgba(79, 136, 61, 0.2);
}

.btn-secondary {
    width: 100%;
    padding: 13px 16px;
    background: #fff;
    color: var(--primary-dark);
    border: 2px solid rgba(79, 136, 61, 0.25);
}

.btn-tertiary {
    padding: 10px 12px;
    background: #eef3f8;
    color: var(--ink);
    box-shadow: none;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-tertiary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

#downloadSection {
    display: none;
    gap: 10px;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px;
}

.asset-grid.empty {
    display: block;
    max-height: none;
    padding: 18px;
    border-radius: var(--radius);
    background: #f7f9fc;
    border: 1px dashed #d8e0ea;
    color: var(--muted);
    line-height: 1.45;
}

.asset-tile {
    position: relative;
    display: block;
    padding: 8px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    border: 2px solid #dfe5ec;
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.asset-tile input {
    position: absolute;
    top: 10px;
    right: 10px;
}

.asset-tile:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 12px 20px rgba(79, 136, 61, 0.14);
    background: linear-gradient(180deg, #fbfff9 0%, #eef8ea 100%);
}

.asset-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 8px;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top left, rgba(255, 216, 165, 0.34), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
    border: 1px solid #e2e8f0;
}

.asset-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upload-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.upload-list.empty {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: #f7f9fc;
    border: 1px dashed #d8e0ea;
    color: var(--muted);
}

.upload-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: #f4f8ff;
    border: 1px solid #d8e3f0;
    color: #325173;
    font-weight: 700;
}

.upload-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-chip button {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: var(--radius);
    border: none;
    background: rgba(50, 81, 115, 0.1);
    color: inherit;
    cursor: pointer;
    box-shadow: none;
}

.preview-area {
    padding: 24px 26px 32px;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.48)),
        radial-gradient(circle at top right, rgba(255, 228, 167, 0.45), transparent 24%),
        linear-gradient(180deg, #eff3f9 0%, #e7edf5 100%);
}

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

.preview-label {
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #6f7b8f;
    margin-bottom: 8px;
}

.preview-head h2 {
    margin: 0;
    font-size: 1.55rem;
    letter-spacing: -0.04em;
}

.preview-head p {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 560px;
}

.preview-stats {
    flex-shrink: 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(223, 229, 236, 0.9);
    color: var(--primary-dark);
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(24, 39, 75, 0.07);
}

.preview-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 32px;
    border-radius: var(--radius);
    border: 2px dashed rgba(79, 136, 61, 0.25);
    background: rgba(255, 255, 255, 0.56);
    color: var(--muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.preview-empty.hidden {
    display: none;
}

.preview-empty-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 92px;
    padding: 10px 18px;
    margin-bottom: 12px;
    border-radius: var(--radius);
    background: #fff;
    color: var(--primary-dark);
    font-family: "Baloo 2", "Nunito", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 14px 28px rgba(79, 136, 61, 0.12);
}

.preview-empty h3 {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.preview-empty p {
    margin: 0;
}

#preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    gap: 24px;
    justify-content: flex-start;
}

#preview.has-cards {
    margin-top: 8px;
}

.preview-render {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
}

@media (max-width: 1080px) and (min-width: 841px) {
    .app {
        grid-template-columns: minmax(330px, 360px) minmax(0, 1fr);
    }

    .app-header {
        padding: 16px 20px;
    }

    .section {
        padding: 16px;
    }

    .preview-area {
        padding: 18px 18px 24px;
    }

    .preview-head {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 16px;
    }

    .preview-stats {
        width: 100%;
    }

    #preview {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        justify-items: center;
    }

    .preview-render {
        max-width: 290px;
    }
}

@media (max-width: 840px) {
    .app {
        grid-template-columns: 1fr;
    }

    .panel {
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }

    .preview-area {
        padding-top: 20px;
    }
}

@media (max-width: 720px) {
    .app-header {
        padding: 18px 18px 16px;
    }

    .section,
    .preview-area {
        padding-left: 16px;
        padding-right: 16px;
    }

    .choice-row,
    .toolbar-row {
        grid-template-columns: 1fr;
    }

    .preview-head {
        flex-direction: column;
        align-items: stretch;
    }

    .preview-stats {
        width: 100%;
    }

    #preview {
        grid-template-columns: 1fr;
        justify-content: center;
    }
}

@media print {
    body {
        background: #fff;
    }

    .app {
        display: block;
    }

    .app-header,
    .panel,
    .preview-head,
    .preview-empty {
        display: none !important;
    }

    .preview-area {
        padding: 0;
        background: #fff;
    }

    #preview {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8mm;
    }
}
