/* In-flow footer of .ms-generator-shell (not fixed — avoids clipping/double-scroll with parent overflow) */
.ms-generator-command-wrap {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    z-index: 40;
    padding: 2px 2px calc(6px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.ms-generator-command-bar {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 22px;
    background:
        linear-gradient(125deg, rgba(255, 252, 245, 0.22) 0%, rgba(255, 255, 255, 0.08) 22%, rgba(255, 255, 255, 0.02) 48%, transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 8%, transparent 28%),
        linear-gradient(180deg, rgba(36, 32, 28, 0.38) 0%, rgba(22, 20, 18, 0.52) 55%, rgba(14, 12, 10, 0.58) 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.28) inset,
        0 -1px 0 rgba(0, 0, 0, 0.18) inset,
        0 10px 40px rgba(0, 0, 0, 0.28),
        0 24px 80px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(40px) saturate(1.35);
    -webkit-backdrop-filter: blur(40px) saturate(1.35);
}

.ms-generator-controls-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.ms-generator-controls-row::-webkit-scrollbar {
    display: none;
}

.ms-generator-controls-row > * {
    flex: 0 0 auto;
}

.ms-generator-controls-row #generatorCreateBtn {
    margin-left: auto;
}

.ms-generator-controls-row .ms-generator-cinematic-row {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 42px;
}

.ms-generator-controls-row .ms-generator-cinematic-pill {
    height: 42px;
    padding: 0 26px 0 10px;
}

.ms-generator-controls-row .ms-generator-cinematic-label {
    font-size: 11px;
}

.ms-generator-controls-row .ms-generator-cinematic-select {
    max-width: 120px;
}

.ms-generator-command-bar.is-focused {
    border-color: rgba(236, 210, 150, 0.38);
    box-shadow:
        0 1px 0 rgba(255, 244, 220, 0.35) inset,
        0 -1px 0 rgba(0, 0, 0, 0.2) inset,
        0 10px 44px rgba(0, 0, 0, 0.3),
        0 28px 88px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(212, 184, 120, 0.2),
        0 0 48px rgba(212, 184, 100, 0.1);
}

.ms-generator-switch,
.ms-generator-tool-btn,
.ms-generator-create-btn {
    border: 0;
    border-radius: 20px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ms-generator-switch,
.ms-generator-tool-btn {
    background: rgba(120, 96, 32, 0.12);
    color: #9a7b28;
    border: 1px solid rgba(158, 124, 48, 0.28);
}

.ms-generator-switch,
.ms-generator-tool-btn {
    width: 42px;
    min-width: 42px;
    flex: 0 0 auto;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    align-self: center;
    cursor: pointer;
}

.ms-generator-switch:hover,
.ms-generator-tool-btn:hover {
    background: rgba(220, 196, 110, 0.22);
    color: #e8d898;
    border-color: rgba(230, 210, 140, 0.5);
}

/* Matches .ms-generator-model-card / .is-selected in model picker modal */
.ms-generator-model-bar-btn {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 240px;
    height: 42px;
    padding: 0 14px;
    margin: 0;
    border-radius: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    box-sizing: border-box;
    cursor: pointer;
    font: inherit;
    color: #dcc878;
    background: rgba(210, 184, 90, 0.12);
    border: 1px solid rgba(220, 198, 120, 0.38);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.ms-generator-model-bar-btn:hover {
    background: rgba(220, 198, 110, 0.2);
    color: #f0e0a0;
}

.ms-generator-model-bar-btn.is-selected {
    border-color: rgba(236, 214, 140, 0.65);
    color: #f2e8b8;
    background: linear-gradient(180deg, rgba(220, 190, 100, 0.28), rgba(160, 130, 50, 0.16));
}

.ms-generator-model-bar-btn.is-selected:hover {
    background: linear-gradient(180deg, rgba(230, 200, 110, 0.34), rgba(170, 140, 60, 0.2));
    color: #faf0c8;
}

.ms-generator-model-bar-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    width: 100%;
}

/* Same title weight/tracking as .ms-generator-model-card-title, sized for the bar */
.ms-generator-model-bar-name {
    display: block;
    width: 100%;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    color: var(--ms-gen-accent, inherit);
}

.ms-generator-model-bar-subtitle {
    display: block;
    width: 100%;
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: rgba(240, 230, 200, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.ms-generator-tools {
    display: flex;
    align-items: center;
    align-self: center;
    flex: 0 0 auto;
    gap: 8px;
}

.ms-generator-setting-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    align-self: center;
    flex: 0 1 240px;
    gap: 6px;
    padding-top: 0;
    min-width: 0;
    max-width: 280px;
    min-height: 0;
    max-height: 76px;
    overflow-x: hidden;
    overflow-y: auto;
}

.ms-generator-command-bar > #generatorModelSettingsChips {
    flex: 1 1 100%;
    max-width: none;
    align-self: stretch;
}

.ms-generator-command-bar > .ms-generator-prompt-wrap {
    flex: 1 1 100%;
}

.ms-generator-setting-chips:empty {
    display: none;
}

.ms-generator-setting-chip {
    flex: 0 1 auto;
    max-width: 160px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.35;
    color: rgba(255, 245, 255, 0.95);
    background: rgba(150, 120, 255, 0.22);
    border: 1px solid rgba(180, 155, 255, 0.42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-generator-setting-chip--refs {
    max-width: min(320px, 100%);
    white-space: normal;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    overflow: visible;
    text-overflow: clip;
}

.ms-generator-setting-chip-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.ms-generator-setting-chip-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: #1a1a1a;
}

.ms-generator-prompt-wrap {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    gap: 8px;
}

.ms-generator-prompt-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
}

.ms-generator-prompt-field {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ms-generator-prompt-row .ms-generator-model-bar-btn {
    height: auto;
    min-height: 120px;
    align-self: stretch;
    padding: 12px 14px;
    border-radius: 20px;
    justify-content: flex-start;
    max-width: 320px;
}

.ms-generator-model-bar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
}

.ms-generator-model-bar-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: rgba(255, 248, 220, 0.92);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(220, 198, 120, 0.22);
    white-space: nowrap;
}

.ms-generator-model-bar-badge--accent {
    background: rgba(210, 184, 90, 0.16);
    border-color: rgba(236, 214, 140, 0.35);
}

.ms-generator-cinematic-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 34px;
}

.ms-generator-cinematic-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 28px 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(212, 184, 110, 0.44);
    background: linear-gradient(180deg, rgba(195, 158, 76, 0.24), rgba(115, 90, 34, 0.16));
    color: #e8d18a;
    box-sizing: border-box;
    cursor: pointer;
}

.ms-generator-cinematic-pill:focus-within,
.ms-generator-cinematic-pill:hover {
    border-color: rgba(236, 210, 150, 0.72);
    background: linear-gradient(180deg, rgba(210, 178, 96, 0.28), rgba(130, 100, 42, 0.2));
}

.ms-generator-cinematic-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(242, 230, 190, 0.92);
}

.ms-generator-cinematic-select {
    min-width: 64px;
    max-width: 140px;
    border: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: #ffe6a2;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 0;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-generator-cinematic-select option {
    background: #1c1810;
    color: #e4c878;
}

.ms-generator-cinematic-chevron {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #b89f5a;
    font-size: 10px;
    pointer-events: none;
}

.ms-generator-prompt {
    width: 100%;
    min-width: 0;
    min-height: 120px;
    max-height: 168px;
    overflow-y: auto;
    overflow-x: hidden;
    resize: none;
    padding: 16px 18px;
    box-sizing: border-box;
    border-radius: 20px;
    border: 1px solid rgba(212, 184, 120, 0.22);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 1px 0 rgba(255, 248, 230, 0.06) inset;
    color: #fff;
    font: inherit;
    font-size: 18px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    outline: none;
}

.ms-generator-prompt::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.ms-generator-prompt:focus {
    border-color: rgba(228, 200, 140, 0.38);
    box-shadow: 0 1px 0 rgba(255, 250, 235, 0.1) inset, 0 0 0 1px rgba(212, 184, 120, 0.12);
}

.ms-generator-orientation-wrap {
    cursor: pointer;
    flex: 0 0 100px;
    width: 100px;
    max-width: 100px;
    min-width: 100px;
    border-radius: 999px;
}

.ms-generator-orientation-wrap:hover .ms-generator-bar-capsule-inner,
.ms-generator-orientation-wrap:focus-within .ms-generator-bar-capsule-inner {
    background: rgba(200, 170, 90, 0.26);
    border-color: rgba(220, 198, 130, 0.58);
}

.ms-generator-bar-capsule {
    display: flex;
    align-items: center;
    align-self: center;
    flex-shrink: 0;
    cursor: pointer;
}

label.ms-generator-bar-capsule-inner {
    cursor: pointer;
}

.ms-generator-orientation-wrap .ms-generator-bar-capsule-inner {
    width: 100%;
    min-width: 0;
}

.ms-generator-bar-capsule-inner {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 12px 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(200, 178, 110, 0.48);
    background: rgba(180, 150, 70, 0.16);
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ms-generator-bar-capsule-inner:hover {
    background: rgba(200, 170, 90, 0.26);
    border-color: rgba(220, 198, 130, 0.58);
}

.ms-generator-bar-capsule-inner:focus-within {
    border-color: rgba(236, 210, 150, 0.72);
    box-shadow: 0 0 0 1px rgba(220, 198, 120, 0.28);
}

.ms-generator-bar-capsule-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #d8c070;
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}

.ms-generator-bar-capsule-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: -4px;
    color: #a89850;
    font-size: 10px;
    line-height: 1;
    pointer-events: none;
}

.ms-generator-bar-capsule-select {
    min-width: 0;
    margin: 0;
    padding: 0 4px 0 0;
    border: none;
    background: transparent;
    color: #e0cc70;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

#generatorOrientation.ms-generator-bar-capsule-select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#generatorCount.ms-generator-bar-capsule-select {
    min-width: 28px;
    text-align: center;
    padding-right: 2px;
}

.ms-generator-bar-capsule-select option {
    background: #1c1810;
    color: #e4c878;
    font-weight: 600;
}

.ms-generator-orientation-wrap.is-disabled {
    opacity: 0.38;
    pointer-events: none;
}

.ms-generator-create-btn {
    min-width: 0;
    height: 40px;
    justify-self: end;
    padding: 0 18px;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.02em;
    color: #2e2614;
    background: linear-gradient(145deg, #c4a028 0%, #dcb840 38%, #f0d060 72%, #e8c848 100%);
    box-shadow:
        0 1px 0 rgba(255, 252, 235, 0.45) inset,
        0 10px 28px rgba(140, 110, 30, 0.42);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    align-self: center;
    cursor: pointer;
}

.ms-generator-create-btn:hover {
    transform: translateY(-1px);
    color: #242010;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 12px 36px rgba(120, 95, 28, 0.48);
}

.ms-generator-create-btn i {
    line-height: 1;
    font-size: 16px;
}

.ms-generator-create-btn-label {
    line-height: 1;
    white-space: nowrap;
}

.ms-generator-create-btn-price {
    line-height: 1;
    white-space: nowrap;
}

.ms-generator-create-btn.is-busy {
    opacity: 0.85;
    min-width: 52px;
    padding: 0;
    gap: 0;
}

.ms-generator-controls-row > .ms-generator-bar-capsule,
.ms-generator-controls-row > .ms-generator-create-btn {
    flex: 0 0 auto;
    align-self: center;
}

@media (max-width: 1180px) {
    .ms-generator-setting-chips {
        max-height: none;
    }
}

@media (max-width: 900px) {
    .ms-generator-command-wrap {
        padding-left: 2px;
        padding-right: 2px;
    }

    .ms-generator-setting-chips {
        max-height: none;
    }

    .ms-generator-prompt-row {
        flex-direction: column;
    }

    .ms-generator-prompt-row .ms-generator-model-bar-btn {
        min-height: 52px;
        max-width: none;
    }

    .ms-generator-tool-btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .ms-generator-switch,
    .ms-generator-create-btn {
        height: 44px;
    }

    .ms-generator-bar-capsule-inner {
        height: 44px;
    }

    .ms-generator-create-btn:not(.is-busy) {
        padding: 0 16px;
    }

    .ms-generator-create-btn.is-busy {
        min-width: 48px;
    }

    .ms-generator-prompt {
        min-height: 88px;
        max-height: 140px;
        font-size: 16px;
    }

    .ms-generator-cinematic-row {
        gap: 6px;
    }

    .ms-generator-cinematic-pill {
        height: 30px;
        padding: 0 26px 0 9px;
    }

    .ms-generator-cinematic-select {
        max-width: 112px;
    }
}
