/* WEXEL - AI studio (app-style screen) */
.studio .tag {
    display: inline-block;
    font: 700 12px var(--body);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 5px 12px;
    margin-bottom: 18px
}

.wrap.wide {
    max-width: 1360px
}

.btn.sm {
    min-height: 38px;
    padding: 0 18px;
    font-size: 14px
}

.app {
    display: grid;
    grid-template-columns: 1fr 410px;
    height: min(820px, calc(100vh - 110px));
    min-height: 580px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden
}

/* canvas (left) */
.canvas {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background-color: var(--bg);
    background-image: radial-gradient(#252b33 1px, transparent 1px);
    background-size: 22px 22px
}

.ctop {
    display: flex;
    align-items: center;
    padding: 14px 16px
}

.seg {
    display: inline-flex;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px
}

.seg button,
.tabsm button {
    background: none;
    border: 0;
    color: var(--muted);
    font: 700 13px var(--body);
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer
}

.seg button.on,
.tabsm button.on {
    background: var(--accent);
    color: var(--on-accent)
}

.stage {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0 18px 20px
}

.empty {
    align-self: center;
    border: 1px dashed var(--line);
    border-radius: 16px;
    padding: 34px 38px;
    color: var(--muted);
    text-align: center;
    max-width: 340px;
    background: rgba(14, 17, 20, .7)
}

.empty[hidden],
.frame[hidden] {
    display: none
}

.frame {
    width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
    transition: max-width .3s
}

.frame.m {
    max-width: 390px
}

.frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0
}

/* chat (right) */
.side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-inline-start: 1px solid var(--line);
    background: var(--panel)
}

.shead {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line)
}

.shead b {
    font-family: var(--head);
    font-size: 16px
}

.sp {
    flex: 1
}

.ib {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1
}

.ib:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.shead .btn[hidden] {
    display: none
}

.cl {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px
}

.m {
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere
}

.m.bot {
    align-self: stretch
}

.m.me {
    align-self: flex-end;
    max-width: 86%;
    background: #1a1f26;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 14px
}

.m.note {
    align-self: stretch;
    color: var(--muted);
    font-size: 13px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 10px 14px
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.chip {
    background: none;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    font: 700 14px var(--body);
    cursor: pointer;
    transition: border-color .2s, color .2s
}

.chip:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.chip.on {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent)
}

.chip.main {
    border-color: var(--accent);
    color: var(--accent)
}

.chip.ghost {
    color: var(--muted)
}

.dots {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    height: 24px
}

.dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    animation: dt 1s infinite ease-in-out
}

.dots i:nth-child(2) {
    animation-delay: .15s
}

.dots i:nth-child(3) {
    animation-delay: .3s
}

@keyframes dt {

    0%,
    80%,
    100% {
        opacity: .3
    }

    40% {
        opacity: 1
    }
}

.composer {
    margin: 0 14px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 8px 8px 8px 16px;
    padding-inline: 16px 8px;
    transition: border-color .2s
}

.composer:focus-within {
    border-color: var(--accent)
}

.composer textarea {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: 0;
    resize: none;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    max-height: 140px;
    padding: 8px 0
}

.send {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--accent);
    color: var(--on-accent);
    display: grid;
    place-items: center;
    cursor: pointer
}

.send:disabled,
.composer textarea:disabled {
    opacity: .45;
    cursor: default
}

.fine {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 10px 14px 14px
}

.tabsm {
    display: none
}

@media(max-width:900px) {
    .app {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: min(760px, calc(100vh - 100px))
    }

    .tabsm {
        display: flex;
        gap: 4px;
        padding: 10px;
        border-bottom: 1px solid var(--line);
        justify-content: center
    }

    .app[data-v=chat] .canvas {
        display: none
    }

    .app[data-v=pv] .side {
        display: none
    }

    .side {
        border-inline-start: 0
    }
}
