.ai-assistant-v4 {
    --ai-v4-panel: var(--octap-surface-deep, #0f1114);
    --ai-v4-panel-strong: var(--octap-surface-strong, #15181d);
    --ai-v4-panel-deep: var(--octap-surface-deep, #090b0e);
    --ai-v4-control-bg: #1a1d20;
    --ai-v4-control-hover-bg: #202327;
    --ai-v4-composer-bg: #151719;
    --ai-v4-composer-card-bg: #151719;
    --ai-v4-composer-card-hover-bg: #1a1d20;
    --ai-v4-border: var(--octap-line-strong, rgba(255, 255, 255, 0.1));
    --ai-v4-border-strong: var(--octap-line-strong, rgba(255, 255, 255, 0.16));
    --ai-v4-text: var(--octap-text, #f5f7fb);
    --ai-v4-muted: var(--octap-muted, #8c95a3);
    --ai-v4-soft: var(--octap-muted, #b9c2d1);
    --ai-v4-accent: var(--octap-ai-accent, #ff9f1c);
    position: fixed;
    z-index: 170;
    color: var(--ai-v4-text);
    background: var(--ai-v4-panel);
    border: 1px solid var(--ai-v4-border);
    box-shadow: -16px 0 44px rgba(0, 0, 0, 0.38);
    font-family: var(--octap-font-family-panel, "Manrope", "Inter var", "Inter", "PingFang SC", "Microsoft YaHei", sans-serif);
    letter-spacing: 0;
}

body[data-theme="light"] .ai-assistant-v4 {
    --ai-v4-control-bg: var(--octap-control-solid-bg, #f7f9fc);
    --ai-v4-control-hover-bg: var(--octap-control-solid-hover-bg, #eef2f7);
    --ai-v4-composer-bg: var(--octap-control-solid-bg, #f7f9fc);
    --ai-v4-composer-card-bg: var(--octap-control-solid-bg, #f7f9fc);
    --ai-v4-composer-card-hover-bg: var(--octap-control-solid-hover-bg, #eef2f7);
}

.ai-assistant-v4.hidden {
    display: none !important;
    pointer-events: none;
}

.ai-assistant-v4[data-panel-layout="dock"] {
    top: 60px;
    right: 0;
    bottom: 0;
    width: min(382px, calc(100vw - 16px));
    display: grid;
    grid-template-rows: auto 1fr auto;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 10px 0 0 0;
}

.ai-assistant-v4[data-panel-layout="float"] {
    display: grid;
    grid-template-rows: auto 1fr auto;
    left: 16px;
    top: 16px;
    right: auto;
    bottom: auto;
    width: min(398px, calc(100vw - 24px));
    height: min(710px, calc(100vh - 24px));
    border-radius: 10px;
    box-shadow: 0 22px 80px rgba(0, 0, 0, 0.46);
}

.chat-float.is-assistant-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.82);
}

.ai-v4-head {
    min-height: 48px;
    padding: 0 10px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px 0 0 0;
    background: var(--ai-v4-panel-deep);
    user-select: none;
}

.ai-assistant-v4[data-panel-layout="float"] .ai-v4-head {
    cursor: move;
    border-radius: 9px 9px 0 0;
}

.ai-v4-title {
    display: flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 650;
}

.ai-v4-head-actions,
.ai-v4-toolbar,
.ai-v4-ref-row,
.ai-v4-prompt-cards,
.ai-v4-preference-head,
.ai-v4-preference-tabs,
.ai-v4-preference-grid,
.ai-v4-model-toggle,
.ai-v4-model-option {
    display: flex;
    align-items: center;
}

.ai-v4-head-actions {
    gap: 6px;
}

.ai-v4-icon-btn,
.ai-v4-icon-inline,
.ai-v4-composer-btn,
.ai-v4-mode-btn,
.ai-v4-execution-btn,
.ai-v4-preference-btn,
.ai-v4-send-btn,
.ai-v4-ref-tile,
.ai-v4-media-upload-card,
.ai-v4-attachment-tile,
.ai-v4-small-btn,
.ai-v4-menu-row,
.ai-v4-preference-option,
.ai-v4-model-toggle,
.ai-v4-auto-toggle {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.ai-v4-icon-btn,
.ai-v4-icon-inline,
.ai-v4-composer-btn,
.ai-v4-send-btn {
    display: grid;
    place-items: center;
}

.ai-v4-icon-btn {
    width: var(--octap-control-sm, 30px);
    height: var(--octap-control-sm, 30px);
    border: 1px solid var(--ai-v4-border);
    border-radius: var(--octap-radius-sm, 8px);
    background: var(--ai-v4-control-bg);
}

.ai-v4-icon-btn:hover,
.ai-v4-composer-btn:hover,
.ai-v4-mode-btn:hover,
.ai-v4-execution-btn:hover,
.ai-v4-preference-btn:hover,
.ai-v4-ref-tile:hover,
.ai-v4-media-upload-card:hover,
.ai-v4-attachment-tile:hover,
.ai-v4-small-btn:hover {
    border-color: var(--ai-v4-border-strong);
    background: var(--ai-v4-control-hover-bg);
}

.ai-v4-icon-btn svg,
.ai-v4-icon-inline svg,
.ai-v4-composer-btn svg,
.ai-v4-mode-btn svg,
.ai-v4-execution-btn svg,
.ai-v4-preference-btn svg,
.ai-v4-send-btn svg,
.ai-v4-ref-tile svg,
.ai-v4-media-upload-card svg,
.ai-v4-attachment-tile svg,
.ai-v4-menu-row svg,
.ai-v4-model-toggle svg,
.ai-v4-msg-avatar svg,
.ai-v4-message-action svg {
    width: var(--octap-icon-sm, 15px);
    height: var(--octap-icon-sm, 15px);
    stroke-width: 1.75;
}

.ai-v4-conversation {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px 14px 0;
}

.ai-v4-welcome {
    margin-top: auto;
    padding-bottom: 10px;
}

.ai-v4-welcome.hidden {
    display: none;
}

.ai-v4-hello {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #cbd3e1;
    font-size: 22px;
    line-height: 1.1;
    margin-bottom: 9px;
}

.ai-v4-hello-mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 0;
    background: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 168, 79, 0.28));
}

.ai-v4-hello-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.ai-v4-welcome h1 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 28px;
    line-height: 1.08;
    font-weight: 850;
    letter-spacing: 0;
}

.ai-v4-prompt-cards {
    gap: 8px;
    overflow: hidden;
}

.ai-v4-prompt-card {
    flex: 1 1 0;
    min-width: 0;
    min-height: 64px;
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--ai-v4-border);
    border-radius: 8px;
    background: var(--ai-v4-composer-card-bg);
    color: #f4f6fb;
    text-align: left;
    font-size: 12px;
    line-height: 1.22;
    font-weight: 700;
    cursor: pointer;
}

.ai-v4-prompt-card:hover {
    border-color: var(--ai-v4-border-strong);
    background: var(--ai-v4-composer-card-hover-bg);
}

.ai-v4-prompt-card svg {
    width: 14px;
    height: 14px;
    color: #7f8795;
}

.ai-v4-thread {
    display: none;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 0;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 150, 0.46) transparent;
}

.ai-v4-thread.is-visible {
    display: grid;
    gap: 10px;
}

.ai-v4-thread::-webkit-scrollbar {
    width: 8px;
}

.ai-v4-thread::-webkit-scrollbar-track {
    background: transparent;
}

.ai-v4-thread::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(126, 136, 150, 0.42);
    background-clip: content-box;
}

.ai-v4-thread::-webkit-scrollbar-button {
    width: 0;
    height: 0;
}

.ai-v4-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    line-height: 1.55;
}

.ai-v4-message.user {
    justify-content: flex-end;
}

.ai-v4-message.has-image-result {
    width: 100%;
}

.ai-v4-message-main {
    max-width: 86%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}

.ai-v4-message.user .ai-v4-message-main {
    align-items: flex-end;
}

.ai-v4-message.has-image-result .ai-v4-message-main {
    flex: 0 1 300px;
    width: 300px;
    max-width: calc(100% - 34px);
}

.ai-v4-message.has-user-reference .ai-v4-message-main {
    flex: 0 1 310px;
    width: min(310px, 94%);
}

.ai-v4-bubble {
    max-width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: #dfe5ee;
}

.ai-v4-message.has-image-result .ai-v4-bubble,
.ai-v4-message.has-user-reference .ai-v4-bubble {
    width: 100%;
    box-sizing: border-box;
}

.ai-v4-message.has-user-reference .ai-v4-bubble {
    padding: 0;
    background: transparent;
}

.ai-v4-message.user .ai-v4-bubble {
    background: rgba(255, 255, 255, 0.07);
    color: #f4f6fb;
}

.ai-v4-message.user.has-user-reference .ai-v4-bubble {
    background: transparent;
}

.ai-v4-user-reference-shell {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.ai-v4-user-reference-media {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0;
    padding-top: 1px;
}

.ai-v4-user-reference {
    position: relative;
    width: 46px;
    margin: 0;
    flex: 0 0 46px;
    color: rgba(244, 246, 251, 0.86);
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
}

.ai-v4-user-reference + .ai-v4-user-reference {
    margin-left: -17px;
}

.ai-v4-user-reference:focus-visible {
    outline: 2px solid rgba(255, 168, 79, 0.78);
    outline-offset: 2px;
}

.ai-v4-user-reference img {
    display: block;
    width: 46px;
    height: 46px;
    border-radius: 7px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #1b2028;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.ai-v4-user-reference-text {
    min-width: 46px;
    max-width: 180px;
    max-height: 38px;
    box-sizing: border-box;
    display: grid;
    align-content: start;
    gap: 3px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 10px;
    background: transparent;
    color: #f4f6fb;
    font-size: 12.5px;
    font-weight: 680;
    line-height: 1.35;
    letter-spacing: 0;
    transition:
        max-height 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
        max-width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.ai-v4-user-reference-shell:hover .ai-v4-user-reference-text,
.ai-v4-user-reference-shell:focus-within .ai-v4-user-reference-text {
    max-width: 218px;
    max-height: 112px;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.ai-v4-user-reference-summary {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-v4-user-reference-summary {
    white-space: nowrap;
}

.ai-v4-user-reference-shell:hover .ai-v4-user-reference-summary,
.ai-v4-user-reference-shell:focus-within .ai-v4-user-reference-summary {
    white-space: normal;
}

.ai-v4-message-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.ai-v4-message:hover .ai-v4-message-actions,
.ai-v4-message:focus-within .ai-v4-message-actions,
.ai-v4-message.is-hovered .ai-v4-message-actions,
.ai-v4-message-main:hover .ai-v4-message-actions,
.ai-v4-message-main:focus-within .ai-v4-message-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ai-v4-message-action {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.055);
    color: #9aa4b4;
    cursor: pointer;
}

.ai-v4-message-action:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.095);
    color: #f2f5fa;
}

.ai-v4-msg-avatar {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #dfe5ee;
    background: rgba(255, 255, 255, 0.08);
}

.ai-v4-composer-wrap {
    position: relative;
    min-width: 0;
    max-width: 100%;
    padding: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: var(--ai-v4-panel);
}

.ai-v4-composer {
    position: relative;
    min-height: 174px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ai-v4-border);
    background: var(--ai-v4-composer-bg);
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.ai-v4-ref-row {
    gap: 8px;
    min-height: 38px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    flex-wrap: nowrap;
    padding-top: 5px;
    margin-top: -5px;
    margin-bottom: 8px;
}

.ai-v4-ref-row.is-empty {
    display: none;
}

.ai-assistant-v4[data-assistant-mode="image"] .ai-v4-ref-row.is-empty,
.ai-assistant-v4[data-assistant-mode="video"] .ai-v4-ref-row.is-empty {
    display: flex;
}

.ai-v4-ref-tile,
.ai-v4-ref-thumb,
.ai-v4-ref-message,
.ai-v4-attachment-tile,
.ai-v4-media-upload-card {
    position: relative;
}

.ai-v4-ref-tile,
.ai-v4-ref-thumb,
.ai-v4-attachment-tile,
.ai-v4-media-upload-card {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 8px;
}

.ai-v4-ref-tile,
.ai-v4-attachment-tile,
.ai-v4-media-upload-card {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #e1e5ec;
}

.ai-v4-ref-canvas-add,
.ai-v4-media-upload-card {
    padding: 0;
}

.ai-v4-ref-tile[hidden] {
    display: none;
}

.ai-v4-ref-message {
    min-width: 0;
    width: auto;
    max-width: min(100%, 360px);
    flex: 0 1 auto;
    align-self: flex-start;
    box-sizing: border-box;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 28px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    color: #dfe5ee;
    overflow: hidden;
}

.ai-v4-ref-message-role {
    flex: 0 0 auto;
    color: #f2f5fa;
    font-size: 11px;
    font-weight: 700;
}

.ai-v4-ref-message-text {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #aeb7c5;
    font-size: 12px;
}

.ai-v4-ref-message .ai-v4-ref-remove {
    right: 8px;
    top: 50%;
    width: 18px;
    height: 18px;
    color: #dfe5ee;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.16);
    font-size: 13px;
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.ai-v4-ref-message .ai-v4-ref-remove:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.24);
}

.ai-v4-media-upload-card {
    display: grid;
    place-items: center;
    border-style: dashed;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.ai-v4-media-upload-card.is-filled {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.2);
}

.ai-v4-attachment-tile {
    display: grid;
    place-items: center;
    overflow: visible;
    background-size: cover;
    background-position: center;
}

.ai-v4-attachment-tile.is-image-preview {
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 -16px 18px rgba(0, 0, 0, 0.32);
}

.ai-v4-attachment-tile.is-draft-reference {
    border-color: rgba(66, 153, 225, 0.34);
}

.ai-v4-attachment-tile.is-image-preview::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, transparent 36%, rgba(0, 0, 0, 0.42));
    pointer-events: none;
}

.ai-v4-attachment-icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    color: #e8edf5;
}

.ai-v4-attachment-kind {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 3px;
    z-index: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 5px;
    padding: 1px 2px;
    background: rgba(5, 7, 10, 0.58);
    color: #f3f6fa;
    font-size: 8px;
    line-height: 1.2;
    text-align: center;
}

.ai-v4-attachment-tile.is-draft-reference .ai-v4-attachment-kind {
    background: rgba(5, 7, 10, 0.68);
    font-size: 7.5px;
    font-weight: 720;
}

.ai-v4-ref-thumb {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background:
        radial-gradient(ellipse at 52% 42%, rgba(231, 194, 173, 0.96) 0 23%, transparent 24%),
        radial-gradient(ellipse at 50% 26%, rgba(183, 142, 117, 0.78) 0 30%, transparent 31%),
        linear-gradient(165deg, #4b3936 0 30%, #75645f 31% 55%, #221f24 56% 100%);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    box-shadow: inset 0 -16px 18px rgba(0, 0, 0, 0.32);
}

.ai-v4-ref-remove {
    position: absolute;
    right: -5px;
    top: -5px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.24);
    font-size: 11px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.82);
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 3;
}

.ai-v4-ref-thumb:hover .ai-v4-ref-remove,
.ai-v4-ref-tile:hover .ai-v4-ref-remove,
.ai-v4-attachment-tile:hover .ai-v4-ref-remove,
.ai-v4-ref-remove:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.ai-v4-ref-preview {
    position: absolute;
    left: -54px;
    bottom: calc(100% + 10px);
    width: 160px;
    border-radius: 9px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    background: #202329;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.44);
    z-index: 30;
}

.ai-v4-ref-thumb:hover .ai-v4-ref-preview {
    opacity: 1;
    transform: translateY(0);
}

.ai-v4-ref-label {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 3px;
    z-index: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 5px;
    padding: 1px 2px;
    background: rgba(5, 7, 10, 0.68);
    color: #f3f6fa;
    font-size: 7.5px;
    font-weight: 720;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
}

.ai-v4-ref-preview-image {
    display: block;
    height: 118px;
    background:
        radial-gradient(ellipse at 49% 39%, rgba(232, 198, 178, 0.96) 0 28%, transparent 29%),
        linear-gradient(135deg, #988078, #24222a);
    background-size: cover;
    background-position: center;
}

.ai-v4-ref-preview-title {
    display: block;
    height: 38px;
    padding: 0 12px;
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 650;
    line-height: 38px;
}

.ai-v4-input-shell {
    position: relative;
    min-height: 82px;
    flex: 1;
}

.ai-v4-composer-hint {
    position: absolute;
    inset: 0 auto auto 0;
    pointer-events: none;
    color: #868f9e;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
}

.ai-v4-composer.has-text .ai-v4-composer-hint {
    display: none;
}

.ai-v4-composer.has-conversation .ai-v4-composer-hint {
    display: none;
}

.ai-v4-input-shell [data-input] {
    width: 100%;
    min-height: 82px;
    max-height: 130px;
    box-sizing: border-box;
    display: block;
    border: 0;
    outline: none;
    background: transparent;
    color: #edf1f7;
    padding: 0 2px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    caret-color: #edf1f7;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 150, 0.46) transparent;
}

.ai-v4-input-shell [data-input]::-webkit-scrollbar {
    width: 8px;
}

.ai-v4-input-shell [data-input]::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(126, 136, 150, 0.46);
    background-clip: padding-box;
}

.ai-v4-input-shell [data-input]::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.ai-v4-input-shell .octap-composer-reference-token {
    display: inline-block;
    box-sizing: border-box;
    min-width: 54px;
    height: 18px;
    margin: 0 3px;
    padding: 0 7px 0 3px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.09);
    color: rgba(248, 252, 255, 0.96);
    font-size: 13px;
    font-weight: 680;
    line-height: 16px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    cursor: default;
}

.ai-v4-input-shell .octap-composer-reference-token-preview {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.14) center / cover no-repeat;
    color: currentColor;
    vertical-align: -2.5px;
}

.ai-v4-input-shell .octap-composer-reference-token.is-video {
    border-color: rgba(255, 168, 79, 0.28);
    background: rgba(255, 168, 79, 0.12);
    color: #ffd19b;
}

.ai-v4-input-shell .octap-composer-reference-token-text {
    display: inline-block;
    vertical-align: top;
}

.ai-v4-reference-mention-menu {
    position: absolute;
    left: var(--ai-v4-reference-menu-left, 10px);
    bottom: calc(100% + 8px);
    z-index: 45;
    display: none;
    width: min(136px, calc(100% - 20px));
    max-height: var(--ai-v4-reference-menu-max-height, 168px);
    overflow-y: auto;
    box-sizing: border-box;
    gap: 3px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    background: rgba(22, 25, 31, 0.98);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
}

.ai-v4-reference-mention-menu.is-open {
    display: grid;
}

.ai-v4-reference-mention-option {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 30px;
    border: 0;
    border-radius: 7px;
    padding: 3px 6px 3px 3px;
    background: transparent;
    color: #e7ebf2;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ai-v4-reference-mention-option:hover,
.ai-v4-reference-mention-option.is-active {
    background: rgba(255, 255, 255, 0.08);
}

.ai-v4-reference-mention-preview {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 6px;
    background:
        radial-gradient(circle at 36% 30%, rgba(255, 196, 116, 0.86), transparent 46%),
        linear-gradient(135deg, #263141, #11151d);
    background-size: cover;
    background-position: center;
    color: #e8edf5;
}

.ai-v4-reference-mention-preview.is-video {
    background:
        radial-gradient(circle at 62% 28%, rgba(126, 190, 255, 0.78), transparent 44%),
        linear-gradient(135deg, #1f2d45, #11151d);
}

.ai-v4-reference-mention-label {
    flex: 0 0 auto;
    color: #f6f8fb;
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
}

.ai-v4-reference-mention-title {
    display: none;
    min-width: 0;
    overflow: hidden;
    color: #9ba6b5;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-v4-toolbar {
    gap: 8px;
    padding-top: 5px;
}

.ai-v4-composer-btn,
.ai-v4-mode-btn,
.ai-v4-execution-btn,
.ai-v4-preference-btn {
    height: 30px;
    border: 1px solid var(--ai-v4-border);
    border-radius: 8px;
    background: var(--ai-v4-control-bg);
    color: #d7dce5;
}

.ai-v4-composer-btn.is-round {
    width: 30px;
    padding: 0;
    border-radius: 999px;
}

.ai-v4-mode-btn,
.ai-v4-execution-btn,
.ai-v4-preference-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.ai-v4-mode-btn {
    max-width: 136px;
}

.ai-v4-preference-btn {
    position: relative;
    width: 30px;
    padding: 0;
}

.ai-v4-execution-btn {
    width: 30px;
    padding: 0;
}

.ai-v4-execution-btn [data-execution-label] {
    display: none;
}

.ai-v4-preference-label {
    display: none;
}

.ai-v4-auto-badge {
    position: absolute;
    right: -6px;
    top: -9px;
    padding: 0 2px;
    border-radius: 2px;
    color: var(--ai-v4-accent);
    background: rgba(9, 11, 14, 0.92);
    font-size: 8px;
    font-weight: 900;
    line-height: 1.1;
}

.ai-v4-toolbar-spacer {
    flex: 1;
}

.ai-assistant-v4[data-assistant-mode="image"] [data-execution-trigger],
.ai-assistant-v4[data-assistant-mode="video"] [data-execution-trigger],
.ai-assistant-v4[data-assistant-mode="image"] [data-execution-menu],
.ai-assistant-v4[data-assistant-mode="video"] [data-execution-menu] {
    display: none !important;
}

.ai-v4-energy {
    height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 4px 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #f2f5fa;
    background: rgba(255, 255, 255, 0.035);
    font-size: 12px;
    font-weight: 750;
}

.ai-v4-energy > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ai-v4-energy svg {
    width: 13px;
    height: 13px;
    color: var(--ai-v4-accent);
    fill: currentColor;
}

.ai-v4-send-btn {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 159, 28, 0.42);
    border-radius: 999px;
    background: transparent;
    color: var(--ai-v4-accent);
}

.ai-v4-send-btn:hover {
    border-color: var(--ai-v4-accent);
    background: rgba(255, 159, 28, 0.12);
    color: #ffb347;
}

.ai-v4-floating-menu {
    position: absolute;
    z-index: 18;
    display: none;
    border: 1px solid var(--ai-v4-border-strong);
    border-radius: 10px;
    background: rgba(18, 22, 29, 0.98);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.ai-v4-floating-menu.is-open {
    display: block;
}

.ai-v4-add-menu {
    left: 8px;
    bottom: 60px;
    width: 228px;
    padding: 5px;
}

.ai-v4-mode-menu {
    left: 52px;
    bottom: 60px;
    width: 278px;
    padding: 5px;
}

.ai-v4-execution-menu {
    right: 70px;
    bottom: 60px;
    width: 230px;
    padding: 5px;
}

.ai-v4-thinking-menu {
    left: 8px;
    bottom: 60px;
    width: 238px;
    padding: 5px;
}

.ai-v4-skill-menu {
    left: 8px;
    bottom: calc(100% + 8px);
    width: 292px;
    max-height: min(340px, calc(100vh - 180px));
    padding: 0;
    overflow: hidden;
}

.ai-v4-menu-row {
    width: 100%;
    min-height: 38px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #f3f6fb;
    padding: 7px 9px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
}

.ai-v4-menu-row:hover,
.ai-v4-menu-row.is-selected {
    background: rgba(255, 255, 255, 0.07);
}

.ai-v4-menu-row.is-selected {
    outline: 1px solid rgba(255, 159, 28, 0.36);
}

.ai-v4-sub {
    display: block;
    margin-top: 2px;
    color: #87909d;
    font-size: 11px;
    font-weight: 520;
    line-height: 1.3;
}

.ai-v4-check {
    color: #f7f9fc;
    font-size: 12px;
}

.ai-v4-menu-divider {
    height: 1px;
    margin: 5px -5px;
    background: rgba(255, 255, 255, 0.08);
}

.ai-v4-menu-foot {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 9px;
    color: #87909d;
    font-size: 11px;
}

.ai-v4-menu-foot button {
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: #f3f6fb;
}

.ai-v4-preference-menu {
    right: 8px;
    bottom: 60px;
    width: min(344px, calc(100% - 16px));
    padding: 10px;
}

.ai-v4-preference-head {
    justify-content: space-between;
    margin-bottom: 8px;
}

.ai-v4-preference-title {
    font-size: 13px;
    font-weight: 780;
}

.ai-v4-auto-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: #dce3ee;
    font-size: 11px;
    font-weight: 650;
}

.ai-v4-toggle-track {
    width: 31px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.075);
    padding: 1px;
    transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.ai-v4-toggle-thumb {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #e5e7eb;
    transition: transform 0.14s ease;
}

.ai-v4-auto-toggle.is-on .ai-v4-toggle-track {
    border-color: rgba(255, 168, 79, 0.42);
    background: rgba(255, 168, 79, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 168, 79, 0.06);
}

.ai-v4-auto-toggle.is-on .ai-v4-toggle-thumb {
    transform: translateX(13px);
    background: #f3f4f6;
    box-shadow: 0 0 0 1px rgba(255, 168, 79, 0.34), 0 0 8px rgba(255, 168, 79, 0.18);
}

.ai-v4-preference-tabs {
    gap: 4px;
    padding: 3px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);
    margin-bottom: 9px;
}

.ai-assistant-v4[data-assistant-mode="image"] .ai-v4-preference-tabs,
.ai-assistant-v4[data-assistant-mode="video"] .ai-v4-preference-tabs {
    display: none;
}

.ai-v4-preference-tab {
    flex: 1;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #8d95a3;
    font-size: 12px;
    font-weight: 760;
    cursor: pointer;
}

.ai-v4-preference-tab.is-active {
    color: #f1f4f9;
    background: rgba(255, 255, 255, 0.085);
}

.ai-v4-preference-section {
    display: none;
}

.ai-v4-preference-section.is-active {
    display: block;
}

.ai-v4-preference-group {
    margin-top: 8px;
}

.ai-v4-group-label {
    display: block;
    margin-bottom: 5px;
    color: #8d95a3;
    font-size: 11px;
    font-weight: 620;
}

.ai-v4-group-label.is-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-v4-current-value {
    color: #ffbd5a;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(255, 168, 79, 0.12);
    font-size: 10px;
    font-weight: 780;
}

.ai-v4-preference-grid {
    flex-wrap: wrap;
    gap: 5px;
}

.ai-v4-preference-option {
    min-width: 44px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.055);
    color: #adb6c5;
    font-size: 11px;
    font-weight: 760;
}

.ai-v4-preference-grid.is-compact .ai-v4-preference-option {
    min-width: 65px;
}

.ai-v4-preference-option:disabled,
.ai-v4-model-toggle:disabled {
    cursor: default;
    opacity: 0.58;
}

.ai-v4-preference-option:not(:disabled):hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
}

.ai-v4-preference-option.is-selected {
    color: #ffbd5a;
    background: rgba(255, 159, 28, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 159, 28, 0.42);
}

.ai-v4-ratio-icon {
    width: 12px;
    height: 9px;
    border: 1px solid currentColor;
    border-radius: 2px;
    opacity: 0.75;
}

.ai-v4-ratio-icon.auto {
    border-radius: 999px;
}

.ai-v4-ratio-icon.square {
    width: 10px;
    height: 10px;
}

.ai-v4-ratio-icon.wide {
    width: 14px;
    height: 7px;
}

.ai-v4-ratio-icon.tall {
    width: 8px;
    height: 14px;
}

.ai-v4-duration-row {
    height: 31px;
    display: flex;
    gap: 0;
    overflow-x: auto;
    overscroll-behavior: contain;
    touch-action: pan-x;
    user-select: none;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    cursor: grab;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.ai-v4-duration-row::-webkit-scrollbar {
    display: none;
}

.ai-v4-duration-row.is-dragging {
    cursor: grabbing;
}

.ai-v4-duration-row:not(.can-scroll-left) {
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
}

.ai-v4-duration-row:not(.can-scroll-right) {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 100%);
}

.ai-v4-duration-row:not(.can-scroll-left):not(.can-scroll-right) {
    -webkit-mask-image: none;
    mask-image: none;
}

.ai-v4-duration-row .ai-v4-preference-option {
    flex: 0 0 auto;
    min-width: 41px;
    min-height: 25px;
    height: 25px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(243, 245, 250, 0.58);
    box-shadow: none;
    font-size: 10.5px;
    font-weight: 690;
}

.ai-v4-duration-row .ai-v4-preference-option:not(:disabled):hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border-color: transparent;
    box-shadow: none;
}

.ai-v4-duration-row .ai-v4-preference-option.is-selected {
    color: #ffbd5a;
    background: rgba(255, 159, 28, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 159, 28, 0.42);
}

.ai-v4-model-list {
    position: relative;
}

.ai-v4-model-toggle {
    width: 100%;
    height: 32px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 7px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.035);
    color: #dbe1eb;
    text-align: left;
    font-size: 11px;
    font-weight: 620;
}

.ai-v4-model-toggle:not(:disabled):hover,
.ai-v4-model-list.is-open .ai-v4-model-toggle {
    border-color: rgba(255, 159, 28, 0.58);
    background: rgba(255, 159, 28, 0.055);
}

.ai-v4-model-current {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-v4-model-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 28;
    display: none;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: #15181d;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.44);
}

.ai-v4-model-list.is-open .ai-v4-model-dropdown {
    display: grid;
    gap: 4px;
}

.ai-v4-model-option {
    width: 100%;
    min-height: 30px;
    justify-content: space-between;
    text-align: left;
}

.ai-v4-model-desc {
    color: #7f8795;
    font-size: 10px;
    font-weight: 520;
}

.ai-v4-auto-note {
    display: none;
}

.ai-v4-skill-head {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-v4-skill-head strong {
    flex: 1;
    font-size: 12px;
}

.ai-v4-small-btn {
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    padding: 0 9px;
    color: #d9dee8;
    font-size: 11px;
    font-weight: 650;
}

.ai-v4-small-btn.primary {
    border-color: rgba(255, 255, 255, 0.26);
    color: #f5f7fb;
}

.ai-v4-small-btn.danger {
    border-color: rgba(255, 107, 107, 0.28);
    color: #ffb4b4;
}

.ai-v4-small-btn.danger:hover {
    border-color: rgba(255, 107, 107, 0.46);
    background: rgba(255, 107, 107, 0.1);
}

.ai-v4-icon-inline {
    width: 25px;
    height: 25px;
    border: 0;
    border-radius: 7px;
    background: transparent;
}

.ai-v4-skill-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 8px 6px;
}

.ai-v4-skill-tabs button {
    flex: 1;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    color: #8d95a3;
    font-size: 11px;
    font-weight: 700;
}

.ai-v4-skill-tabs button:hover {
    color: #f2f5fb;
    background: rgba(255, 255, 255, 0.07);
}

.ai-v4-skill-tabs button.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.ai-v4-skill-tabs button[data-skill-open-library] {
    border-color: rgba(255, 255, 255, 0.08);
    color: #cdd4df;
}

.ai-v4-skill-panel {
    display: grid;
    gap: 4px;
    padding: 0 8px 8px;
}

.ai-v4-skill-list {
    max-height: min(260px, calc(100vh - 300px));
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 151, 0.5) transparent;
}

.ai-v4-skill-list::-webkit-scrollbar {
    width: 6px;
}

.ai-v4-skill-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(126, 136, 151, 0.48);
}

.ai-v4-skill-panel[hidden] {
    display: none;
}

.ai-v4-skill-empty {
    min-height: 40px;
    display: grid;
    place-items: center;
    color: #858d9b;
    font-size: 11px;
}

.ai-v4-skill-row {
    min-height: 40px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #edf2f8;
    padding: 7px 8px;
    text-align: left;
    font-size: 11px;
    cursor: pointer;
}

.ai-v4-skill-row:hover {
    background: rgba(255, 255, 255, 0.07);
}

.ai-v4-skill-row > svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    stroke-width: 1.9;
    color: #e5ebf5;
}

.ai-v4-skill-row.is-active,
.ai-v4-skill-row:focus-visible {
    outline: 0;
    border-color: rgba(72, 180, 164, 0.42);
    background: rgba(72, 180, 164, 0.12);
}

.ai-v4-skill-row.is-disabled {
    opacity: 0.58;
}

.ai-v4-skill-row small {
    display: block;
    margin-top: 2px;
    color: #8d95a3;
}

.ai-v4-skill-title {
    min-width: 0;
}

.ai-v4-skill-title strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-v4-skill-disable {
    min-width: 38px;
    height: 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    color: #aab3c1;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.ai-v4-skill-disable:hover {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.12);
    color: #ffe8bd;
}

.ai-v4-status-badge {
    color: #8992a1;
    font-size: 10px;
}

.ai-v4-manager-overlay {
    position: fixed;
    inset: 60px 0 0;
    z-index: 75;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 34px;
    background: rgba(3, 5, 8, 0.44);
    backdrop-filter: blur(7px);
}

.ai-v4-manager-overlay[hidden] {
    display: none !important;
}

.ai-v4-manager-shell {
    position: relative;
    width: min(980px, calc(100vw - 112px));
    height: min(680px, calc(100vh - 140px));
    max-height: calc(100vh - 112px);
    min-height: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: #0f1217;
    box-shadow: 0 24px 86px rgba(0, 0, 0, 0.5);
}

.ai-v4-manager-head {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 12px 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: #0a0c10;
}

.ai-v4-manager-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-v4-manager-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ai-v4-manager-new-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 1.8;
}

.ai-v4-manager-title {
    display: grid;
    gap: 3px;
}

.ai-v4-manager-title strong {
    font-size: 14px;
    font-weight: 760;
}

.ai-v4-manager-title span {
    color: #8e98a7;
    font-size: 11px;
}

.ai-v4-manager-body {
    min-height: 0;
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    overflow: hidden;
}

.ai-v4-manager-sidebar,
.ai-v4-manager-main,
.ai-v4-manager-detail {
    min-height: 0;
}

.ai-v4-manager-sidebar {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.018);
}

.ai-v4-manager-tabs {
    display: grid;
    gap: 7px;
}

.ai-v4-manager-tabs button,
.ai-v4-manager-filter button {
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: #dce3ee;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ai-v4-manager-tabs button {
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
    text-align: left;
}

.ai-v4-manager-tabs button.is-active,
.ai-v4-manager-filter button.is-active {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.ai-v4-manager-tabs svg {
    width: 14px;
    height: 14px;
    color: #9aa3b1;
    stroke-width: 1.7;
}

.ai-v4-manager-filter {
    display: grid;
    gap: 8px;
}

.ai-v4-manager-filter > span,
.ai-v4-manager-caption {
    color: #9aa3b1;
    font-size: 11px;
    font-weight: 650;
}

.ai-v4-manager-filter div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.ai-v4-manager-filter button {
    height: 28px;
    min-width: 0;
    justify-content: center;
    overflow: hidden;
    padding: 0 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-v4-manager-main {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 8px;
    overflow: hidden;
    padding: 14px 16px;
}

.ai-v4-manager-search input,
.ai-v4-manager-custom input,
.ai-v4-manager-custom textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: #171b22;
    color: #eef3fa;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    outline: none;
}

.ai-v4-manager-search input {
    height: 34px;
    padding: 0 12px;
}

.ai-v4-manager-search input:focus,
.ai-v4-manager-custom input:focus,
.ai-v4-manager-custom textarea:focus {
    border-color: rgba(255, 159, 28, 0.58);
}

.ai-v4-manager-custom {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
}

.ai-v4-manager-custom[hidden] {
    display: none;
}

.ai-v4-manager-custom input {
    height: 34px;
    padding: 0 10px;
}

.ai-v4-manager-custom textarea {
    min-height: 66px;
    resize: none;
    padding: 9px 10px;
}

.ai-v4-manager-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, 235px);
    gap: 8px;
    align-content: start;
    justify-content: start;
    overflow: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 151, 0.6) transparent;
}

.ai-v4-manager-grid::-webkit-scrollbar {
    width: 6px;
}

.ai-v4-manager-grid::-webkit-scrollbar-track {
    background: transparent;
}

.ai-v4-manager-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(126, 136, 151, 0.48);
}

.ai-v4-manager-card {
    min-height: 126px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #f3f6fb;
    padding: 10px;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.ai-v4-manager-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.ai-v4-manager-card.is-selected {
    border-color: rgba(255, 159, 28, 0.58);
    background: rgba(255, 159, 28, 0.055);
}

.ai-v4-manager-card.is-disabled {
    opacity: 0.62;
}

.ai-v4-manager-card:focus-visible {
    outline: 2px solid rgba(255, 159, 28, 0.52);
    outline-offset: 2px;
}

.ai-v4-manager-card-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    color: #aeb8c7;
}

.ai-v4-manager-card-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
}

.ai-v4-manager-card-body,
.ai-v4-manager-card-title {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.ai-v4-manager-card-title strong {
    font-size: 12.5px;
    line-height: 1.18;
}

.ai-v4-manager-card-title span {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ai-v4-manager-card-title em {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 1px 6px;
    color: #d9e0eb;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.ai-v4-manager-card small {
    color: #8f98a8;
    font-size: 10.5px;
}

.ai-v4-manager-card-desc {
    display: -webkit-box;
    overflow: hidden;
    color: #aeb8c7;
    font-size: 11.5px;
    line-height: 1.36;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ai-v4-manager-card-actions {
    display: flex;
    gap: 5px;
    margin-top: 2px;
    padding-top: 2px;
}

.ai-v4-manager-card-actions button {
    flex: 1;
    min-width: 0;
    height: 23px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    color: #dce3ee;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.ai-v4-manager-card-actions button:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ai-v4-manager-empty {
    display: grid;
    place-items: center;
    min-height: 160px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    color: #8f98a8;
    font-size: 12px;
}

.ai-v4-manager-detail {
    display: none;
    align-content: start;
    gap: 12px;
    padding: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.022);
}

.ai-v4-manager-detail > strong {
    color: #f6f8fb;
    font-size: 15px;
    line-height: 1.25;
}

.ai-v4-manager-detail p {
    margin: 0;
    color: #aeb8c7;
    font-size: 12px;
    line-height: 1.48;
}

.ai-v4-manager-detail dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.ai-v4-manager-detail dl div {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
    align-items: center;
}

.ai-v4-manager-detail dt {
    color: #8f98a8;
    font-size: 11px;
}

.ai-v4-manager-detail dd {
    margin: 0;
    color: #f2f5fa;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.ai-v4-manager-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}

.ai-v4-manager-actions .ai-v4-small-btn {
    min-width: 82px;
}

.ai-v4-small-btn:disabled {
    cursor: default;
    opacity: 0.52;
}

.ai-v4-skill-context-menu {
    position: absolute;
    z-index: 86;
    width: 148px;
    display: grid;
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(15, 18, 24, 0.98);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(14px);
}

.ai-v4-skill-context-menu[hidden] {
    display: none !important;
}

.ai-v4-skill-context-menu button {
    height: 29px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #dce3ee;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
    padding: 0 9px;
    cursor: pointer;
}

.ai-v4-skill-context-menu button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.ai-v4-skill-context-menu button[data-context-action="delete"] {
    color: #ff9f9f;
}

.ai-v4-skill-context-menu button[data-context-action="delete"]:hover {
    background: rgba(255, 80, 80, 0.08);
}

.ai-v4-skill-editor {
    position: absolute;
    inset: 0;
    z-index: 84;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(3, 5, 8, 0.52);
    backdrop-filter: blur(6px);
}

.ai-v4-skill-editor[hidden] {
    display: none !important;
}

.ai-v4-skill-editor-shell {
    width: min(520px, 100%);
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: #11151b;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.52);
}

.ai-v4-skill-editor-shell header,
.ai-v4-skill-editor-shell footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-v4-skill-editor-shell footer {
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 0;
}

.ai-v4-skill-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

.ai-v4-skill-editor-grid label,
.ai-v4-skill-editor-tags {
    display: grid;
    gap: 7px;
    color: #9aa3b1;
    font-size: 11px;
    font-weight: 700;
}

.ai-v4-skill-command-field {
    display: none !important;
}

.ai-v4-skill-editor-grid .is-wide {
    grid-column: 1 / -1;
}

.ai-v4-skill-editor-grid input,
.ai-v4-skill-editor-grid textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: #171b22;
    color: #eef3fa;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    outline: none;
}

.ai-v4-skill-editor-grid input {
    height: 36px;
    padding: 0 10px;
}

.ai-v4-skill-editor-grid textarea {
    min-height: 86px;
    resize: vertical;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 9px 10px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 150, 0.46) transparent;
}

.ai-v4-skill-editor-grid textarea::-webkit-scrollbar {
    width: 8px;
}

.ai-v4-skill-editor-grid textarea::-webkit-scrollbar-track {
    background: transparent;
}

.ai-v4-skill-editor-grid textarea::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(126, 136, 150, 0.46);
    background-clip: padding-box;
}

.ai-v4-skill-editor-grid textarea::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.ai-v4-skill-editor-grid input:focus,
.ai-v4-skill-editor-grid textarea:focus {
    border-color: rgba(255, 159, 28, 0.58);
}

.ai-v4-skill-editor-tags > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 7px;
}

.ai-v4-skill-editor-tags button {
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: #dce3ee;
    min-width: 0;
    overflow: hidden;
    padding: 0 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.ai-v4-skill-editor-tags button.is-selected {
    border-color: rgba(255, 159, 28, 0.52);
    color: #ffbd5a;
    background: rgba(255, 159, 28, 0.1);
}

.ai-v4-tag-add {
    max-width: 210px;
}

@media (max-width: 1120px) {
    .ai-v4-manager-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ai-v4-history-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 3, 5, 0.62);
    backdrop-filter: blur(9px);
}

.ai-v4-history-overlay.is-open {
    display: flex;
}

.ai-v4-history-panel {
    width: min(720px, 92vw);
    max-height: 78vh;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: #0f1217;
    box-shadow: 0 24px 86px rgba(0, 0, 0, 0.5);
}

.ai-v4-history-panel header {
    height: 50px;
    padding: 0 12px 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: #0a0c10;
}

.ai-v4-history-panel h2 {
    margin: 0;
    font-size: 15px;
}

.ai-v4-history-body {
    display: grid;
    gap: 8px;
    padding: 12px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 136, 150, 0.46) transparent;
}

.ai-v4-history-body::-webkit-scrollbar {
    width: 8px;
}

.ai-v4-history-body::-webkit-scrollbar-track {
    background: transparent;
}

.ai-v4-history-body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(126, 136, 150, 0.42);
    background-clip: content-box;
}

.ai-v4-history-body::-webkit-scrollbar-button {
    width: 0;
    height: 0;
    display: none;
}

.ai-v4-history-body article {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    min-height: 68px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.095);
    border-radius: 8px;
    background: #14171d;
}

.ai-v4-history-copy {
    min-width: 0;
}

.ai-v4-history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 310px;
}

.ai-v4-history-actions .ai-v4-small-btn {
    min-width: 50px;
}

.ai-v4-history-body article:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: #171a20;
}

.ai-v4-history-body strong,
.ai-v4-history-title {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.ai-v4-history-title {
    width: min(420px, 100%);
    padding: 0;
    border: 0;
    background: transparent;
    color: #f5f7fb;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: text;
}

.ai-v4-history-title:hover {
    color: #ffffff;
}

.ai-v4-history-title:focus-visible {
    outline: 1px solid rgba(255, 159, 28, 0.58);
    outline-offset: 3px;
    border-radius: 5px;
}

.ai-v4-history-title-input {
    display: block;
    width: min(420px, 100%);
    height: 28px;
    margin: 0 0 4px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(10, 12, 16, 0.96);
    color: #f5f7fb;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ai-v4-history-title-input:focus {
    border-color: rgba(255, 159, 28, 0.62);
    box-shadow: 0 0 0 2px rgba(255, 159, 28, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-v4-history-body span {
    color: #8992a1;
    font-size: 12px;
}

.ai-v4-history-empty {
    min-height: 120px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    color: #8992a1;
    font-size: 12px;
}

.ai-v4-toast {
    position: absolute;
    right: calc(100% + 14px);
    bottom: 26px;
    z-index: 60;
    display: none;
    max-width: 260px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(24, 28, 36, 0.96);
    color: #dce2ec;
    padding: 10px 12px;
    font-size: 12px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.ai-v4-toast.is-visible {
    display: block;
}

.ai-v4-resize-handle {
    position: absolute;
    left: -7px;
    top: 0;
    bottom: 0;
    width: 14px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
}

.ai-v4-resize-handle::after {
    content: "";
    width: 3px;
    height: 42px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.3);
    opacity: 0;
    transition: height 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.ai-assistant-v4:hover .ai-v4-resize-handle::after,
.ai-v4-resize-handle:hover::after,
.ai-assistant-v4.is-resizing .ai-v4-resize-handle::after {
    height: 54px;
    opacity: 0.82;
}

.ai-assistant-v4[data-panel-layout="float"] .ai-v4-resize-handle {
    display: none;
}

.ai-v4-floating-resize {
    position: absolute;
    z-index: 12;
    display: none;
    background: transparent;
}

.ai-assistant-v4[data-panel-layout="float"] .ai-v4-floating-resize {
    display: block;
}

.ai-v4-floating-resize-bottom {
    left: 58px;
    right: 58px;
    bottom: -12px;
    height: 20px;
    cursor: ns-resize;
}

.ai-v4-floating-resize-bottom-left,
.ai-v4-floating-resize-bottom-right {
    bottom: -16px;
    width: 34px;
    height: 34px;
}

.ai-v4-floating-resize-bottom-left {
    left: -16px;
    cursor: nesw-resize;
}

.ai-v4-floating-resize-bottom-right {
    right: -16px;
    cursor: nwse-resize;
}

.ai-v4-floating-resize::after {
    content: "";
    position: absolute;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.ai-v4-floating-resize-bottom::after {
    left: 50%;
    bottom: 8px;
    width: 66px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
}

.ai-v4-floating-resize:hover::after {
    opacity: 1;
}

body.ai-v4-picking-reference .placeholder-node.ai-v4-reference-target {
    outline: 1px solid rgba(255, 159, 28, 0.78);
    box-shadow: 0 0 0 4px rgba(255, 159, 28, 0.12), 0 0 22px rgba(255, 159, 28, 0.22);
    cursor: crosshair;
}

@media (max-width: 720px) {
    .ai-assistant-v4[data-panel-layout="dock"],
    .ai-assistant-v4[data-panel-layout="float"] {
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: 10px !important;
        width: auto !important;
        height: min(620px, calc(100vh - 20px)) !important;
        border-radius: 10px;
    }

    .ai-v4-welcome h1 {
        font-size: 24px;
    }

    .ai-v4-prompt-cards {
        gap: 6px;
    }

    .ai-v4-prompt-card {
        min-height: 58px;
        padding: 8px;
    }

    .ai-v4-preference-menu,
    .ai-v4-mode-menu,
    .ai-v4-skill-menu {
        left: 8px;
        right: 8px;
        width: auto;
    }

    .ai-v4-manager-overlay {
        inset: 0;
        padding: 12px;
    }

    .ai-v4-manager-shell {
        width: 100%;
        height: min(760px, calc(100vh - 24px));
        min-height: 0;
    }

    .ai-v4-manager-body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        overflow: auto;
    }

    .ai-v4-manager-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .ai-v4-manager-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ai-v4-manager-tabs button {
        justify-content: center;
        padding: 0 8px;
    }

    .ai-v4-manager-main {
        min-height: 420px;
    }

    .ai-v4-manager-grid {
        grid-template-columns: 1fr;
    }

    .ai-v4-manager-detail {
        display: none;
    }

    .ai-v4-skill-editor-grid {
        grid-template-columns: 1fr;
    }
}
