
/* ── Grid helpers ────────────────────────────────────────────────────── */
.tw-grid { grid-template-columns: 1fr 1fr; }
.tw-full { grid-column: 1 / -1; }
@media (max-width: 560px) { .tw-grid { grid-template-columns: 1fr; } }

/* ── Text / number inputs ────────────────────────────────────────────── */
.tw-input {
    width: 100%;
    appearance: none;
    background-color: var(--pg-white,#fff);
    border: 1px solid var(--pg-border,#ececec);
    border-radius: 8px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--pg-text,#111111);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.tw-input:focus {
    outline: none;
    border-color: #3680ED;
    box-shadow: 0 0 0 3px rgba(54,128,237,.12);
}
.tw-input::placeholder { color: var(--pg-muted,#888888); }

/* ── Textarea ────────────────────────────────────────────────────────── */
.tw-textarea {
    width: 100%;
    appearance: none;
    background-color: var(--pg-white,#fff);
    border: 1px solid var(--pg-border,#ececec);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--pg-text,#111111);
    line-height: 1.6;
    resize: vertical;
    min-height: 72px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.tw-textarea:focus {
    outline: none;
    border-color: #3680ED;
    box-shadow: 0 0 0 3px rgba(54,128,237,.12);
}
.tw-textarea::placeholder { color: var(--pg-muted,#888888); }

/* ── Toggle switches ─────────────────────────────────────────────────── */
.tw-toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--pg-bg,#fafafa);
    border: 1px solid var(--pg-border,#ececec);
    border-radius: 10px;
    padding: 10px 14px;
}
.tw-toggle-group > label:first-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--pg-secondary,#666666);
    margin: 0;
}
.tw-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.tw-switch input { opacity: 0; width: 0; height: 0; }
.tw-slider {
    position: absolute; inset: 0;
    background: var(--pg-border,#ececec);
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s ease;
}
.tw-slider::before {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--pg-white,#fff);
    box-shadow: 0 1px 4px rgba(15,23,42,.18);
    transition: transform .2s ease;
}
.tw-switch input:checked + .tw-slider            { background: #3680ED; }
.tw-switch input:checked + .tw-slider::before    { transform: translateX(18px); }
.tw-switch input:focus-visible + .tw-slider      { box-shadow: 0 0 0 3px rgba(54,128,237,.25); }

/* ── Range slider (creativity level) ────────────────────────────────── */
.tw-slider-value {
    display: inline-block;
    margin-left: 8px;
    background: #EAF2FD;
    color: #3680ED;
    font-size: 12px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 28px;
    text-align: center;
}
.tw-slider-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.tw-slider-min,
.tw-slider-max {
    font-size: 12px;
    color: var(--pg-muted,#888888);
    flex-shrink: 0;
}
.tw-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 4px;
    background: var(--pg-border,#ececec);
    outline: none;
    cursor: pointer;
}
.tw-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #3680ED;
    border: 2px solid var(--pg-white,#fff);
    box-shadow: 0 1px 4px rgba(15,23,42,.18);
    cursor: pointer;
}
.tw-range::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #3680ED;
    border: 2px solid var(--pg-white,#fff);
    box-shadow: 0 1px 4px rgba(15,23,42,.18);
    cursor: pointer;
}
