/* === HerLove Agent Cloud Studio Preview === */
.nav-studio {
    border: 1px solid rgba(var(--ai-rgb), 0.28);
    border-radius: 999px;
    padding: 0.42rem 0.78rem;
    color: rgba(255,255,255,0.86);
    background: rgba(var(--ai-rgb), 0.08);
}
.cloud-studio-view {
    justify-content: flex-start;
    align-items: stretch;
    padding: 7.6rem 2rem 1.4rem;
}
.cloud-shell {
    width: min(1180px, calc(100vw - 36px));
    margin: 0 auto;
    display: grid;
    gap: 1rem;
}
.cloud-topbar,
.cloud-panel,
.cloud-card {
    border: 1px solid rgba(255,255,255,0.09);
    background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025));
    box-shadow: 0 20px 52px rgba(0,0,0,0.32);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.cloud-topbar {
    min-height: 76px;
    border-radius: 8px;
    padding: 1rem 1.15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.cloud-kicker,
.cloud-label,
.cloud-tag,
.cloud-state,
.cloud-log-time {
    font-family: var(--mono-font);
    letter-spacing: 0.04em;
}
.cloud-kicker {
    color: var(--ai-color);
    font-size: 0.72rem;
    margin-bottom: 0.24rem;
}
.cloud-title {
    font-size: clamp(1.35rem, 2.2vw, 2.15rem);
    line-height: 1.2;
    color: #fff;
    margin: 0;
}
.cloud-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    max-width: 560px;
    line-height: 1.65;
}
.cloud-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.62rem;
}
.cloud-pill {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 0.48rem 0.75rem;
    color: rgba(255,255,255,0.82);
    background: rgba(0,0,0,0.22);
    font-size: 0.78rem;
    white-space: nowrap;
}
.cloud-pill.live {
    border-color: rgba(var(--ai-rgb),0.42);
    color: #fff;
    box-shadow: 0 0 24px rgba(var(--ai-rgb),0.14);
}
.cloud-layout {
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr) 285px;
    gap: 1rem;
    align-items: stretch;
}
.official-her-card {
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(340px, 1.22fr);
    gap: 1rem;
    border-color: rgba(var(--ai-rgb),0.22);
    background:
        radial-gradient(circle at 18% 18%, rgba(255,218,198,0.12), transparent 28%),
        linear-gradient(135deg, rgba(255,46,147,0.12), rgba(55,72,189,0.13) 58%, rgba(255,255,255,0.035));
}
.official-her-copy {
    display: grid;
    align-content: stretch;
    gap: 0.82rem;
}
.official-her-copy h3 {
    color: #fff;
    font-size: clamp(1.15rem, 2vw, 1.65rem);
    line-height: 1.24;
    margin: 0;
}
.official-her-copy p {
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.65;
    max-width: 520px;
}
.her-presence {
    margin-top: auto;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.85rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    align-items: center;
    background: rgba(255,255,255,0.045);
    min-height: 184px;
    overflow: hidden;
    position: relative;
}
.her-presence-text {
    position: relative;
    z-index: 2;
    width: min(64%, 260px);
}
.her-portrait {
    position: absolute;
    right: -0.45rem;
    top: 0.35rem;
    width: min(60%, 288px);
    height: calc(100% + 8px);
    opacity: 0.92;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.28s ease, filter 0.28s ease;
    z-index: 1;
}
.her-portrait img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 18%;
    filter: drop-shadow(0 18px 40px rgba(var(--ai-rgb), 0.28));
}
.her-portrait.waiting {
    opacity: 0.78;
    transform: translateY(4px) scale(0.985);
    filter: saturate(0.92);
}
.her-portrait::after {
    content: '';
    position: absolute;
    inset: 10% 4% -4%;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.2);
    animation: herPulse 2.6s ease-in-out infinite;
}
@keyframes herPulse {
    0%, 100% { transform: scale(0.96); opacity: 0.35; }
    50% { transform: scale(1.08); opacity: 0.72; }
}
.her-presence strong {
    display: block;
    color: rgba(255,255,255,0.92);
    font-size: 0.9rem;
    margin-bottom: 0.24rem;
}
.her-presence span {
    display: block;
    color: rgba(255,255,255,0.62);
    font-size: 0.78rem;
    line-height: 1.55;
}
.her-chat-box {
    display: grid;
    gap: 0.72rem;
}
.her-chat-input {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.11);
    background: rgba(0,0,0,0.28);
    color: #fff;
    padding: 0.82rem 0.9rem;
    font-family: var(--ui-font);
    font-size: 0.9rem;
    line-height: 1.55;
}
.her-chat-input:focus,
.cloud-form-input:focus {
    border-color: rgba(var(--ai-rgb),0.5);
    box-shadow: 0 0 20px rgba(var(--ai-rgb),0.14);
    outline: none;
}
.her-chat-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}
.her-chat-status {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    opacity: 0.78;
}
.her-chat-reply {
    min-height: 72px;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 8px;
    padding: 0.8rem;
    color: rgba(255,255,255,0.9);
    background: linear-gradient(135deg, rgba(255,244,232,0.08), rgba(167,139,250,0.055));
    font-size: 0.86rem;
    line-height: 1.65;
}
.her-prompt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.her-prompt-chip {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
    color: rgba(255,255,255,0.82);
    padding: 0.42rem 0.66rem;
    font-size: 0.76rem;
    cursor: pointer;
}
.her-prompt-chip:hover {
    border-color: rgba(var(--ai-rgb),0.42);
    color: #fff;
}
.her-understanding {
    display: none;
}
.her-understanding.show {
    display: block;
}
.her-understanding-card {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.82rem;
    background: rgba(255,255,255,0.052);
    display: grid;
    gap: 0.62rem;
}
.her-understanding-card strong {
    display: block;
    color: #fff;
    font-size: 0.86rem;
}
.her-understanding-line {
    display: grid;
    grid-template-columns: 5.2rem 1fr;
    gap: 0.62rem;
    align-items: start;
}
.her-understanding-line em {
    color: #fed7aa;
    font-size: 0.72rem;
    font-style: normal;
    white-space: nowrap;
}
.her-understanding-line span {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.55;
}
.her-chat-primary-cta {
    display: none;
    width: fit-content;
}
.her-chat-primary-cta.show {
    display: inline-flex;
}
.her-memory-sticker {
    display: none;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.055);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 12px 30px rgba(var(--ai-rgb),0.16),
        0 0 26px rgba(255,218,198,0.1);
    vertical-align: middle;
    position: relative;
    transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}
.her-memory-sticker.show {
    display: inline-flex;
    animation: memoryBreathe 3.1s ease-in-out infinite;
}
.her-memory-sticker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.her-cta-cluster:hover .her-memory-sticker.show,
.her-chat-primary-cta:focus-visible + .her-memory-sticker.show {
    border-color: rgba(255,218,198,0.36);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.08) inset,
        0 14px 34px rgba(var(--ai-rgb),0.22),
        0 0 34px rgba(255,218,198,0.24);
    transform: translateY(-1px);
}
@keyframes memoryBreathe {
    0%, 100% { transform: translateY(0); filter: saturate(0.96); }
    50% { transform: translateY(-2px); filter: saturate(1.12); }
}
.her-cta-cluster {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}
.her-failure-actions {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.advanced-cloud-preview {
    display: block;
}
.advanced-cloud-preview:not([open]) .cloud-layout { display: none; }
.advanced-cloud-preview[open] .cloud-layout { margin-top: 1rem; }
.advanced-cloud-preview > summary {
    cursor: pointer;
    list-style: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.82rem 0.95rem;
    color: rgba(255,255,255,0.82);
    background: rgba(0,0,0,0.18);
    font-size: 0.86rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.advanced-cloud-preview > summary::after {
    content: '›';
    color: rgba(255,255,255,0.48);
    font-size: 1.2rem;
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}
.advanced-cloud-preview[open] > summary::after { transform: rotate(-90deg); }
.advanced-summary-sub {
    color: rgba(255,255,255,0.42);
    font-size: 0.72rem;
    margin-left: 0.5rem;
}
.advanced-cloud-preview > summary::-webkit-details-marker {
    display: none;
}
.cloud-form {
    display: grid;
    gap: 0.62rem;
}
.cloud-form-input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.24);
    color: #fff;
    padding: 0.68rem 0.72rem;
    font-size: 0.82rem;
}
.cloud-panel,
.cloud-card {
    border-radius: 8px;
    overflow: hidden;
}
.cloud-panel {
    min-height: 620px;
}
.cloud-sidebar {
    padding: 1rem;
    display: grid;
    align-content: start;
    gap: 0.85rem;
}
.cloud-label {
    color: rgba(255,255,255,0.52);
    font-size: 0.68rem;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}
.agent-row {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    padding: 0.72rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.2);
}
.agent-row.active {
    border-color: rgba(var(--ai-rgb),0.38);
    background: linear-gradient(135deg, rgba(var(--ai-rgb),0.15), rgba(67,56,202,0.12));
}
.agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: radial-gradient(circle at 30% 24%, var(--candy-color), var(--ai-color) 58%, var(--human-color));
    font-weight: 700;
    box-shadow: 0 0 18px rgba(var(--ai-rgb),0.32);
    flex: 0 0 auto;
}
.agent-meta strong {
    display: block;
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.2;
}
.agent-meta span {
    color: var(--text-muted);
    font-size: 0.72rem;
}
.cloud-main {
    display: grid;
    grid-template-rows: auto 1fr auto;
}
.cloud-main-head {
    padding: 1.05rem 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}
.cloud-tabs {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.cloud-tab {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 0.38rem 0.68rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.16);
    font-size: 0.76rem;
    cursor: pointer;
}
.cloud-tab.active {
    color: #fff;
    border-color: rgba(var(--ai-rgb),0.42);
    background: rgba(var(--ai-rgb),0.12);
}
.cloud-tab:disabled,
.cloud-action-disabled {
    opacity: 0.48;
    cursor: not-allowed;
}
.cloud-disclaimer {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.55;
    margin-top: 0.55rem;
}
.cloud-board {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1rem;
}
.workspace-window {
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    background: rgba(2,0,10,0.52);
    min-height: 398px;
    overflow: hidden;
}
.window-bar {
    min-height: 42px;
    padding: 0 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 0.74rem;
}
.window-dots {
    display: flex;
    gap: 0.34rem;
}
.window-dots span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
}
.window-dots span:first-child { background: var(--ai-color); }
.file-tree {
    display: grid;
    grid-template-columns: 155px 1fr;
    min-height: 356px;
}
.tree-pane {
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 0.85rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.9;
}
.tree-pane strong {
    color: #fff;
    font-size: 0.78rem;
}
.code-pane {
    padding: 0.95rem 1rem;
    font-family: var(--mono-font);
    font-size: 0.78rem;
    line-height: 1.85;
    color: rgba(255,255,255,0.82);
}
.code-pane .pink { color: var(--ai-color); }
.code-pane .blue { color: #a5b4fc; }
.code-pane .muted { color: rgba(255,255,255,0.45); }
.cloud-log {
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    background: rgba(0,0,0,0.22);
    padding: 0.95rem;
    display: grid;
    gap: 0.72rem;
    align-content: start;
}
.cloud-log-row {
    display: grid;
    grid-template-columns: 4.4rem 1fr;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.55;
}
.cloud-log-time {
    color: rgba(255,255,255,0.44);
    font-size: 0.68rem;
}
.cloud-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
}
.loop-step {
    min-height: 74px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 0.65rem;
    background: rgba(0,0,0,0.16);
}
.loop-step strong {
    display: block;
    color: #fff;
    font-size: 0.82rem;
    margin-bottom: 0.16rem;
}
.loop-step span {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.45;
    display: block;
}
.cloud-right {
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
    align-content: start;
}
.cloud-card {
    padding: 0.95rem;
    background: rgba(0,0,0,0.18);
}
.cloud-card h3 {
    color: #fff;
    font-size: 0.98rem;
    margin-bottom: 0.52rem;
}
.cloud-card p,
.cloud-card li {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.65;
}
.cloud-card ul {
    list-style: none;
    display: grid;
    gap: 0.36rem;
}
.cloud-card li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-color);
    margin-right: 0.45rem;
    box-shadow: 0 0 10px rgba(var(--ai-rgb),0.65);
}
.cloud-state {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 0.55rem;
    border-radius: 999px;
    padding: 0.32rem 0.55rem;
    color: #fff;
    border: 1px solid rgba(var(--ai-rgb),0.38);
    background: rgba(var(--ai-rgb),0.12);
    font-size: 0.68rem;
}
@media (max-width: 1060px) {
    .official-her-card { grid-template-columns: 1fr; }
    .cloud-layout { grid-template-columns: 1fr; }
    .cloud-panel { min-height: auto; }
    .cloud-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .nav-studio { display: none; }
    .cloud-studio-view { padding-top: 6.8rem; }
    .her-presence {
        padding: 0.58rem 0.72rem;
        grid-template-columns: 88px 1fr;
        min-height: 100px;
        gap: 0.76rem;
    }
    .her-presence-text {
        width: auto;
    }
    .her-portrait {
        position: static;
        width: 88px;
        height: 88px;
        border-radius: 999px;
        overflow: hidden;
        grid-column: 1;
        grid-row: 1;
        border: 1px solid rgba(255,255,255,0.14);
        background: rgba(255,255,255,0.055);
    }
    .her-portrait img {
        width: 88px;
        height: 88px;
        object-fit: cover;
        object-position: center top;
    }
    .her-presence span {
        display: none;
    }
    .cloud-topbar,
    .cloud-main-head { align-items: flex-start; flex-direction: column; }
    .cloud-actions { justify-content: flex-start; }
    .cloud-sidebar,
    .cloud-board,
    .cloud-footer,
    .file-tree { grid-template-columns: 1fr; }
    .tree-pane { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .cloud-log-row { grid-template-columns: 1fr; gap: 0.18rem; }
    .her-understanding-line { grid-template-columns: 1fr; gap: 0.18rem; }
}
