* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Figtree', sans-serif;
    color: #0f1b2d;
    background: #f6f8fa;
}

input, select, button { font-family: 'Figtree', sans-serif; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: #d6dce3;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.is-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f6f8fa;
}

.is-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-bottom: 1px solid #eef1f4;
    background: #fff;
}

.is-header__left { display: flex; align-items: center; gap: 20px; }

.is-back-link {
    text-decoration: none;
    color: #8a94a3;
    font-size: 13px;
    font-weight: 500;
}
.is-back-link:hover { color: #3f5e8c; }

.is-header__divider { width: 1px; height: 22px; background: #eef1f4; }
.is-header__logo { height: 22px; width: auto; display: block; }

.is-header__right { display: flex; align-items: center; gap: 10px; }
.is-header__title { font-size: 15px; font-weight: 600; color: #0f1b2d; }

.is-badge {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #3f5e8c;
    background: #eef2f8;
    padding: 5px 9px;
    border-radius: 999px;
}

.is-root {
    flex: 1;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* Two-column workspace: settings left, previews right */
.is-layout {
    display: grid;
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.is-card {
    background: #fff;
    border: 1px solid #eef1f4;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 16px;
}
.is-card:last-child { margin-bottom: 0; }
.is-col .is-card { margin-bottom: 16px; }
.is-col .is-card:last-child { margin-bottom: 0; }

.is-card__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px;
}

.is-card__sub {
    font-size: 13px;
    color: #6b7585;
    margin: 0 0 16px;
    line-height: 1.45;
}

.is-alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 16px;
}
.is-alert--warn {
    background: #fffbe6;
    border: 1px solid #ffe58f;
    color: #874d00;
}
.is-alert--info {
    background: #f0f5ff;
    border: 1px solid #adc6ff;
    color: #1d39c4;
}
.is-alert--danger {
    background: #fff1f0;
    border: 1px solid #ffccc7;
    color: #a8071a;
}

/* === Buttons === */
.is-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s, opacity .15s, color .15s;
}
.is-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.is-btn--primary {
    background: #3f5e8c;
    color: #fff;
}
.is-btn--primary:hover:not(:disabled) { background: #324c73; }
.is-btn--ghost {
    background: #eef2f8;
    color: #3f5e8c;
}
.is-btn--ghost:hover:not(:disabled) { background: #e0e7f1; }
.is-btn--danger {
    background: #fff1f0;
    color: #a8071a;
}
.is-btn--danger:hover:not(:disabled) { background: #ffe4e1; }
.is-btn--link {
    background: transparent;
    color: #6b7585;
    padding: 8px 10px;
}
.is-btn--link:hover:not(:disabled) { color: #3f5e8c; }
.is-btn--big {
    padding: 13px 24px;
    font-size: 15px;
    width: 100%;
    justify-content: center;
}
.is-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 94, 140, 0.28);
}

/* === Drop zone === */
.is-drop {
    border: 2px dashed #d6dce3;
    border-radius: 14px;
    background: #fafbfc;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.is-drop:hover { border-color: #3f5e8c; background: #f5f8fc; }
.is-drop:focus-visible {
    outline: none;
    border-color: #3f5e8c;
    box-shadow: 0 0 0 3px rgba(63, 94, 140, 0.18);
}
.is-drop--active {
    border-color: #3f5e8c;
    background: #eef2f8;
}
.is-drop--compact {
    padding: 20px 16px;
}
.is-drop__icon {
    color: #3f5e8c;
    margin-bottom: 8px;
}
.is-drop__title {
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.is-drop__hint {
    font-size: 13px;
    color: #6b7585;
    line-height: 1.45;
}
.is-drop__privacy {
    margin-top: 8px;
    font-size: 12px;
    color: #8a94a3;
}

/* === Picture list === */
.is-files {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 220px);
    overflow: auto;
    padding-right: 2px;
}
.is-file {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #eef1f4;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
.is-thumb {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 8px;
    object-fit: cover;
    background: #f6f8fa;
    border: 1px solid #eef1f4;
}
.is-file__main { flex: 1; min-width: 0; }
.is-file__name {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.is-file__meta {
    font-size: 12px;
    color: #6b7585;
    margin-top: 3px;
    font-family: 'Space Mono', monospace;
}
.is-file__warn {
    font-size: 12px;
    color: #874d00;
    margin-top: 4px;
}
.is-file__err {
    font-size: 12px;
    color: #a8071a;
    margin-top: 4px;
}
.is-file__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
}
.is-file__remove {
    border: none;
    background: transparent;
    color: #aeb6c1;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.is-file__remove:hover { color: #a8071a; background: #fff1f0; }

.is-arrow {
    color: #8a94a3;
    font-family: 'Space Mono', monospace;
}
.is-win { color: #237804; font-weight: 700; }

/* === Choice tiles (mode picker) === */
.is-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.is-choice {
    text-align: left;
    border: 1px solid #dfe4ea;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.is-choice:hover { border-color: #b9c6d8; }
.is-choice--on {
    border-color: #3f5e8c;
    background: #f7faff;
    box-shadow: 0 0 0 3px rgba(63, 94, 140, 0.12);
}
.is-choice:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 94, 140, 0.28);
}
.is-choice__title {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f1b2d;
}
.is-choice__desc {
    margin-top: 3px;
    font-size: 12px;
    color: #6b7585;
    line-height: 1.35;
}

/* === Segmented toggle === */
.is-toggle {
    display: inline-flex;
    background: #f0f2f5;
    border-radius: 10px;
    padding: 3px;
    flex: none;
}
.is-toggle--block {
    margin-bottom: 12px;
}
.is-toggle__btn {
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7585;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.is-toggle__btn--on {
    background: #fff;
    color: #0f1b2d;
    box-shadow: 0 1px 3px rgba(15, 27, 45, 0.1);
}
.is-toggle__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 94, 140, 0.28);
}

/* Toggle + checkbox on one row */
.is-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 12px;
}
.is-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #0f1b2d;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.is-check input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: #3f5e8c;
    cursor: pointer;
}

.is-section {
    margin-bottom: 16px;
}
.is-section:last-child { margin-bottom: 0; }
.is-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7585;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 8px;
}

/* === Fields === */
.is-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}
.is-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.is-split .is-field {
    margin-bottom: 0;
    min-width: 0;
}
/* Fixed-height values slot: locked (1 field) and unlocked (2 fields) share the same footprint */
.is-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
    min-height: 66px;
    align-content: start;
}
.is-values .is-field {
    margin-bottom: 0;
    min-width: 0;
}
.is-field--span {
    grid-column: 1 / -1;
}
.is-check--ghost {
    visibility: hidden;
    pointer-events: none;
}
.is-fmt-extra {
    min-height: 46px;
    margin-top: 10px;
}
.is-fmt-extra .is-alert {
    margin-bottom: 0;
}
.is-note-slot {
    min-height: 32px;
    margin-top: 8px;
}
.is-note-slot .is-note {
    margin-top: 0;
}
.is-help--tight {
    margin-bottom: 0;
}
.is-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 120px;
    margin-bottom: 12px;
}
.is-field:last-child { margin-bottom: 0; }
.is-field label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7585;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.is-field input[type="number"],
.is-field input[type="text"] {
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: #fff;
    color: #0f1b2d;
    width: 100%;
}
.is-field input:focus {
    outline: none;
    border-color: #3f5e8c;
    box-shadow: 0 0 0 3px rgba(63, 94, 140, 0.12);
}
.is-field__hint {
    font-size: 12px;
    color: #8a94a3;
    line-height: 1.4;
}
.is-help {
    font-size: 12px;
    color: #6b7585;
    line-height: 1.45;
    margin: 0 0 16px;
    min-height: 1.45em;
}

/* === Quick-pick chips === */
.is-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.is-chip {
    border: 1px solid #dfe4ea;
    background: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #3f5e8c;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.is-chip:hover { background: #eef2f8; border-color: #b9c6d8; }
.is-chip--on {
    background: #3f5e8c;
    border-color: #3f5e8c;
    color: #fff;
}
.is-chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 94, 140, 0.28);
}

.is-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
}
.is-note {
    font-size: 12px;
    color: #8a94a3;
    margin-top: 12px;
    line-height: 1.45;
}
.is-note--warn { color: #874d00; }

/* === Summary chips === */
.is-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.is-stat {
    background: #f6f8fa;
    border: 1px solid #eef1f4;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #3f5e8c;
}

/* === Progress overlay === */
.is-progress-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 45, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 20px;
}
.is-progress {
    background: #fff;
    border-radius: 16px;
    padding: 28px 28px 22px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(15, 27, 45, 0.22);
    text-align: center;
}
.is-progress__spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 3px solid #e8eef6;
    border-top-color: #3f5e8c;
    animation: is-spin .8s linear infinite;
}
@keyframes is-spin {
    to { transform: rotate(360deg); }
}
.is-progress__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}
.is-progress__msg {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7585;
    min-height: 1.4em;
}
.is-progress__track {
    height: 8px;
    background: #eef1f4;
    border-radius: 999px;
    overflow: hidden;
}
.is-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #3f5e8c, #5b7fb5);
    border-radius: 999px;
    transition: width .35s ease;
}
.is-progress__pct {
    margin-top: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #8a94a3;
}

@media (max-width: 860px) {
    .is-layout {
        grid-template-columns: 1fr;
    }
    .is-files {
        max-height: none;
    }
}
