.dwc-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 56px;
    height: 56px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    appearance: none;
    border-radius: 50%;
    border: 1px solid rgba(15, 118, 110, 0.24);
    background: linear-gradient(140deg, #0f766e, #0ea5e9);
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.34);
    z-index: 1200;
}

.dwc-ai-fab {
    position: fixed;
    right: 86px;
    bottom: 22px;
    width: 56px;
    height: 56px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    appearance: none;
    border-radius: 50%;
    border: 1px solid rgba(79, 70, 229, 0.3);
    background: linear-gradient(140deg, #2563eb, #4f46e5);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.34);
    z-index: 1200;
}

.dwc-overlay {
    position: fixed;
    right: 22px;
    bottom: 88px;
    width: min(860px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 120px));
    min-width: 780px;
    min-height: 620px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    pointer-events: none;
    transition: opacity 170ms ease, transform 170ms ease;
}

.dwc-ai-overlay {
    --dwc-ai-main-form-height: 152px;
    --dwc-ai-side-static-height: 78px;
    position: fixed;
    right: 22px;
    bottom: 88px;
    width: min(640px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 120px));
    min-width: 560px;
    min-height: 560px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    pointer-events: none;
    transition: opacity 170ms ease, transform 170ms ease;
}

.dwc-ai-overlay.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dwc-ai-head {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(99, 102, 241, 0.92));
}

.dwc-ai-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 152px 1fr;
}

.dwc-ai-side {
    min-height: 0;
    border-right: 1px solid rgba(79, 70, 229, 0.16);
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.86), rgba(224, 231, 255, 0.66));
    padding: 9px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dwc-ai-new-chat {
    width: 100%;
    border: 1px solid rgba(79, 70, 229, 0.32);
    border-radius: 10px;
    background: #ffffff;
    color: #3730a3;
    font-size: 0.77rem;
    font-weight: 800;
    padding: 8px 9px;
    cursor: pointer;
}

.dwc-ai-side-title {
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #312e81;
}

.dwc-ai-chat-list {
    flex: 1;
    min-height: 0;
    max-height: calc(100% - var(--dwc-ai-side-static-height));
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.dwc-ai-chat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: stretch;
}

.dwc-ai-chat-btn {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.86);
    color: #1e293b;
    padding: 8px;
    cursor: pointer;
}

.dwc-ai-chat-btn.is-active {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(219, 234, 254, 0.86);
}

.dwc-ai-chat-delete {
    width: 28px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #475569;
    font-size: 0.8rem;
    cursor: pointer;
}

.dwc-ai-chat-delete:hover {
    border-color: rgba(239, 68, 68, 0.5);
    color: #b91c1c;
    background: rgba(254, 242, 242, 0.95);
}

.dwc-ai-chat-title {
    display: block;
    font-size: 0.73rem;
    line-height: 1.35;
    font-weight: 700;
}

.dwc-ai-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dwc-ai-list {
    flex: 1;
    min-height: 0;
    max-height: calc(100% - var(--dwc-ai-main-form-height));
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: radial-gradient(circle at 88% 10%, rgba(99, 102, 241, 0.1), transparent 36%), radial-gradient(circle at 14% 86%, rgba(37, 99, 235, 0.1), transparent 34%), rgba(255, 255, 255, 0.92);
}

.dwc-ai-tools {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.dwc-ai-tool-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1e3a8a;
}

.dwc-ai-select {
    border: 1px solid rgba(79, 70, 229, 0.25);
    border-radius: 8px;
    padding: 4px 8px;
    background: #ffffff;
    color: #1e293b;
    font-size: 0.76rem;
}

.dwc-ai-toggle input {
    accent-color: #4f46e5;
}

.dwc-ai-msg {
    max-width: 92%;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #ffffff;
    padding: 9px 10px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.dwc-ai-sources {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dwc-ai-source {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(79, 70, 229, 0.22);
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.66rem;
    color: #3730a3;
    background: rgba(238, 242, 255, 0.88);
}

.dwc-ai-msg.assistant {
    align-self: flex-start;
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(239, 246, 255, 0.88);
}

.dwc-ai-msg.user {
    align-self: flex-end;
    border-color: rgba(79, 70, 229, 0.28);
    background: rgba(238, 242, 255, 0.88);
}

body[data-theme="dark"] .dwc-ai-tool-item {
    color: #c7d2fe;
}

body[data-theme="dark"] .dwc-ai-select {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border-color: rgba(129, 140, 248, 0.34);
}

body[data-theme="dark"] .dwc-ai-source {
    background: rgba(49, 46, 129, 0.42);
    color: #c7d2fe;
    border-color: rgba(129, 140, 248, 0.36);
}

body[data-theme="dark"] .dwc-ai-side {
    border-right-color: rgba(129, 140, 248, 0.28);
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.82), rgba(30, 41, 59, 0.78));
}

body[data-theme="dark"] .dwc-ai-new-chat {
    background: rgba(15, 23, 42, 0.86);
    color: #c7d2fe;
    border-color: rgba(129, 140, 248, 0.4);
}

body[data-theme="dark"] .dwc-ai-side-title {
    color: #c7d2fe;
}

body[data-theme="dark"] .dwc-ai-chat-btn {
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    border-color: rgba(129, 140, 248, 0.26);
}

body[data-theme="dark"] .dwc-ai-chat-delete {
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(30, 41, 59, 0.86);
    color: #cbd5e1;
}

body[data-theme="dark"] .dwc-ai-chat-delete:hover {
    border-color: rgba(248, 113, 113, 0.52);
    color: #fecaca;
    background: rgba(69, 10, 10, 0.72);
}

body[data-theme="dark"] .dwc-ai-chat-btn.is-active {
    background: rgba(30, 58, 138, 0.42);
    border-color: rgba(96, 165, 250, 0.45);
}

.dwc-ai-msg-role {
    font-size: 0.68rem;
    font-weight: 800;
    color: #1e40af;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.dwc-ai-model {
    font-size: 0.64rem;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, 0.25);
    background: rgba(255, 255, 255, 0.9);
    color: #3730a3;
}

.dwc-ai-status {
    font-size: 0.64rem;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(14, 116, 144, 0.18);
    background: rgba(240, 249, 255, 0.96);
    color: #0f766e;
}

.dwc-ai-steps {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.dwc-ai-step {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #334155;
    background: rgba(255, 255, 255, 0.9);
    border: 1px dashed rgba(100, 116, 139, 0.28);
}

.dwc-ai-msg-text {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.45;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.dwc-ai-msg-text:empty::before {
    content: "생각 중...";
    color: #64748b;
}

.dwc-ai-msg-text strong {
    font-weight: 800;
}

.dwc-ai-code-inline {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    padding: 1px 5px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.08);
    color: #1e293b;
}

.dwc-ai-code-block {
    margin: 8px 0;
    padding: 9px 10px;
    border-radius: 9px;
    border: 1px solid rgba(100, 116, 139, 0.25);
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
    overflow-x: auto;
    white-space: pre;
}

.dwc-ai-code-block code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.77rem;
    line-height: 1.45;
}

.dwc-ai-form {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(79, 70, 229, 0.14);
    background: rgba(248, 250, 252, 0.95);
}

.dwc-ai-input {
    width: 100%;
    min-height: 48px;
    max-height: 132px;
    resize: vertical;
    border: 1px solid rgba(79, 70, 229, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    outline: none;
}

.dwc-overlay.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dwc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.98), rgba(14, 165, 233, 0.92));
    color: #ffffff;
}

.dwc-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dwc-head-toggle {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.16);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 6px 10px;
    cursor: pointer;
}

.dwc-head-toggle.is-active {
    background: rgba(255, 255, 255, 0.16);
}

.dwc-head-toggle:disabled {
    opacity: 0.55;
    cursor: default;
}

.dwc-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.dwc-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.22);
    font-size: 1rem;
    cursor: pointer;
}

.dwc-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 230px 1fr;
}

.dwc-sidebar {
    border-right: 1px solid rgba(15, 118, 110, 0.12);
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.94), rgba(236, 253, 245, 0.88));
    padding: 10px;
    overflow-y: auto;
}

.dwc-side-group {
    margin-bottom: 12px;
}

.dwc-side-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0f766e;
    font-weight: 800;
    margin: 6px 4px;
}

.dwc-side-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.dwc-add-btn {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #0f766e;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dwc-search-wrap {
    margin: 2px 0 8px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.84);
    padding: 8px;
}

.dwc-search-wrap.is-hidden {
    display: none;
}

.dwc-search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.dwc-search-modes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dwc-search-mode-btn {
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.9);
    color: #0f766e;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.dwc-search-mode-btn.is-active {
    border-color: rgba(14, 165, 233, 0.34);
    background: rgba(224, 242, 254, 0.95);
    color: #0369a1;
}

.dwc-search-input {
    width: 100%;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 8px;
    padding: 7px 8px;
    font-size: 0.82rem;
}

.dwc-search-btn {
    border: none;
    border-radius: 8px;
    padding: 0 10px;
    background: linear-gradient(140deg, #0f766e, #0ea5e9);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.dwc-search-result {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 156px;
    overflow-y: auto;
}

.dwc-search-empty {
    color: #64748b;
    font-size: 0.78rem;
    padding: 5px 4px;
}

.dwc-user-item {
    width: 100%;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 8px;
    background: #ffffff;
    padding: 6px 8px;
    text-align: left;
    cursor: pointer;
}

.dwc-user-item-inner {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    align-items: center;
}

.dwc-avatar,
.dwc-room-avatar,
.dwc-msg-avatar,
.dwc-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #0ea5e9, #0f766e);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dwc-user-item-name {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
}

.dwc-user-item-meta {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    color: #64748b;
}

.dwc-room-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dwc-room-btn {
    width: 100%;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.dwc-room-btn-inner {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    align-items: center;
}

.dwc-room-btn.is-active {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(14, 165, 233, 0.16));
    border-color: rgba(14, 165, 233, 0.4);
}

.dwc-room-name {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
}

.dwc-room-meta {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.74rem;
}

.dwc-side-empty {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px dashed rgba(15, 118, 110, 0.2);
    color: #64748b;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.68);
}

.dwc-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.92);
}

.dwc-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(15, 118, 110, 0.14);
    background: rgba(248, 250, 252, 0.9);
}

.dwc-pinned-section {
    border-bottom: 1px solid rgba(15, 118, 110, 0.12);
    background: linear-gradient(180deg, rgba(240, 253, 250, 0.82), rgba(255, 255, 255, 0.92));
    padding: 10px 12px 8px;
}

.dwc-pinned-section.is-hidden {
    display: none;
}

.dwc-pinned-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.dwc-pinned-title {
    font-size: 0.74rem;
    font-weight: 800;
    color: #0f766e;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dwc-pinned-count {
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #0f766e;
    background: rgba(204, 251, 241, 0.78);
}

.dwc-pinned-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 172px;
    overflow-y: auto;
}

.dwc-pin-card {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 10px;
    align-items: start;
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    padding: 8px 10px;
}

.dwc-pin-card-body {
    min-width: 0;
}

.dwc-pin-card-name {
    font-size: 0.76rem;
    font-weight: 800;
    color: #0f172a;
}

.dwc-pin-card-reply {
    margin-top: 3px;
    font-size: 0.7rem;
    color: #0369a1;
}

.dwc-pin-card-text {
    margin-top: 3px;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.dwc-pin-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dwc-pin-card-btn {
    border: 1px solid rgba(14, 116, 144, 0.22);
    border-radius: 999px;
    background: rgba(240, 249, 255, 0.96);
    color: #0e7490;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 4px 8px;
    cursor: pointer;
}

.dwc-pin-card-btn.danger {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(254, 242, 242, 0.96);
    color: #b91c1c;
}

.dwc-room-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.dwc-user-badge {
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.78rem;
    color: #0f766e;
    background: rgba(240, 253, 250, 0.92);
    white-space: nowrap;
}

.dwc-list {
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: radial-gradient(circle at 84% 10%, rgba(14, 165, 233, 0.08), transparent 36%), radial-gradient(circle at 14% 90%, rgba(15, 118, 110, 0.07), transparent 32%), rgba(255, 255, 255, 0.92);
}

.dwc-msg {
    position: relative;
    align-self: flex-start;
    max-width: 90%;
    min-width: 152px;
    border-radius: 12px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    background: #ffffff;
    padding: 26px 10px 8px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.dwc-msg-actions {
    position: absolute;
    top: 7px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dwc-msg-actions.me {
    left: 8px;
    right: auto;
}

.dwc-msg-reply-btn {
    position: static;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #0f766e;
    background: rgba(240, 253, 250, 0.96);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
    transition: opacity 130ms ease, transform 130ms ease;
}

.dwc-msg-pin-btn {
    position: static;
    border: 1px solid rgba(234, 179, 8, 0.28);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #a16207;
    background: rgba(254, 249, 195, 0.96);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
    transition: opacity 130ms ease, transform 130ms ease;
}

.dwc-msg-pin-btn.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dwc-msg-delete-btn {
    position: static;
    border: 1px solid rgba(239, 68, 68, 0.24);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #b91c1c;
    background: rgba(254, 242, 242, 0.96);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
    transition: opacity 130ms ease, transform 130ms ease;
}

.dwc-msg:hover .dwc-msg-reply-btn,
.dwc-msg:hover .dwc-msg-pin-btn,
.dwc-msg:focus-within .dwc-msg-reply-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dwc-msg:focus-within .dwc-msg-pin-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dwc-msg:hover .dwc-msg-delete-btn,
.dwc-msg:focus-within .dwc-msg-delete-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dwc-msg:focus-visible {
    outline: 2px solid rgba(14, 165, 233, 0.55);
    outline-offset: 2px;
}

.dwc-msg.is-jump-flash {
    animation: dwc-pin-flash 1.2s ease;
}

@keyframes dwc-pin-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.34);
        border-color: rgba(14, 165, 233, 0.28);
    }
    35% {
        box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.14);
        border-color: rgba(14, 165, 233, 0.58);
    }
    100% {
        box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
        border-color: rgba(15, 118, 110, 0.14);
    }
}

.dwc-msg-row {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 8px;
    align-items: start;
    min-width: 0;
}

.dwc-msg.me .dwc-msg-row {
    grid-template-columns: 1fr 30px;
}

.dwc-msg.me .dwc-msg-body {
    order: 1;
}

.dwc-msg.me .dwc-msg-avatar {
    order: 2;
}

.dwc-msg-body {
    min-width: 0;
}

.dwc-msg.me {
    align-self: flex-end;
    background: #ecfeff;
    border-color: rgba(14, 165, 233, 0.24);
}

.dwc-msg-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: #0f766e;
    margin-bottom: 3px;
}

.dwc-msg.me .dwc-msg-name {
    text-align: right;
}

.dwc-msg-text {
    font-size: 0.88rem;
    color: #1f2a37;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dwc-reply-block {
    margin-bottom: 5px;
    border-left: 3px solid rgba(14, 165, 233, 0.58);
    border-radius: 8px;
    background: rgba(236, 254, 255, 0.82);
    padding: 5px 7px;
}

.dwc-reply-block-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #0369a1;
}

.dwc-reply-block-text {
    margin-top: 2px;
    font-size: 0.76rem;
    color: #0f172a;
    line-height: 1.32;
    white-space: pre-wrap;
    word-break: break-word;
}

.dwc-form {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(15, 118, 110, 0.14);
    background: rgba(248, 250, 252, 0.95);
}

.dwc-reply-box {
    grid-column: 1 / -1;
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 10px;
    background: rgba(236, 254, 255, 0.82);
    padding: 7px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dwc-reply-box.is-hidden {
    display: none;
}

.dwc-reply-text {
    font-size: 0.76rem;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dwc-reply-cancel {
    border: 1px solid rgba(14, 116, 144, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: #0e7490;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 7px;
    cursor: pointer;
    flex-shrink: 0;
}

.dwc-input {
    width: 100%;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.dwc-send-btn {
    border: none;
    border-radius: 10px;
    padding: 0 14px;
    background: linear-gradient(140deg, #0f766e, #0ea5e9);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.dwc-empty {
    margin: auto;
    text-align: center;
    color: #64748b;
    font-size: 0.88rem;
}

.dwc-resize-handle {
    position: absolute;
    left: 8px;
    top: 8px;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background:
        linear-gradient(315deg, transparent 0 46%, rgba(14, 165, 233, 0.2) 46% 54%, transparent 54% 100%),
        linear-gradient(315deg, transparent 0 62%, rgba(15, 118, 110, 0.44) 62% 72%, transparent 72% 100%);
    cursor: nwse-resize;
    z-index: 3;
}

body.dwc-resizing {
    cursor: nwse-resize;
    user-select: none;
}

body[data-theme="dark"] .dwc-overlay {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 20px 38px rgba(2, 6, 23, 0.62);
}

body[data-theme="dark"] .dwc-ai-overlay {
    background: rgba(15, 23, 42, 0.94);
    border-color: rgba(129, 140, 248, 0.3);
    box-shadow: 0 20px 38px rgba(2, 6, 23, 0.62);
}

body[data-theme="dark"] .dwc-sidebar {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.9));
    border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] .dwc-main,
body[data-theme="dark"] .dwc-main-head,
body[data-theme="dark"] .dwc-form,
body[data-theme="dark"] .dwc-input {
    background: rgba(15, 23, 42, 0.82);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] .dwc-room-title {
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-user-badge {
    color: #99f6e4;
    background: rgba(2, 6, 23, 0.72);
    border-color: rgba(45, 212, 191, 0.34);
}

body[data-theme="dark"] .dwc-head-toggle {
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(2, 6, 23, 0.32);
}

body[data-theme="dark"] .dwc-head-toggle.is-active {
    background: rgba(129, 140, 248, 0.28);
}

body[data-theme="dark"] .dwc-side-title {
    color: #99f6e4;
}

body[data-theme="dark"] .dwc-room-btn {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.24);
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-add-btn {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.28);
    color: #99f6e4;
}

body[data-theme="dark"] .dwc-search-wrap {
    background: rgba(2, 6, 23, 0.62);
    border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] .dwc-search-input,
body[data-theme="dark"] .dwc-user-item {
    background: rgba(15, 23, 42, 0.86);
    border-color: rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-search-mode-btn {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

body[data-theme="dark"] .dwc-search-mode-btn.is-active {
    background: rgba(12, 74, 110, 0.48);
    border-color: rgba(56, 189, 248, 0.34);
    color: #a5f3fc;
}

body[data-theme="dark"] .dwc-user-item-name {
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-room-btn.is-active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.52), rgba(8, 145, 178, 0.42));
    border-color: rgba(56, 189, 248, 0.46);
}

body[data-theme="dark"] .dwc-room-meta,
body[data-theme="dark"] .dwc-side-empty,
body[data-theme="dark"] .dwc-empty {
    color: #94a3b8;
}

body[data-theme="dark"] .dwc-pinned-section {
    border-bottom-color: rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.82));
}

body[data-theme="dark"] .dwc-pinned-title {
    color: #99f6e4;
}

body[data-theme="dark"] .dwc-pinned-count {
    background: rgba(17, 94, 89, 0.52);
    color: #99f6e4;
}

body[data-theme="dark"] .dwc-pin-card {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(56, 189, 248, 0.22);
}

body[data-theme="dark"] .dwc-pin-card-name,
body[data-theme="dark"] .dwc-pin-card-text {
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-pin-card-reply {
    color: #7dd3fc;
}

body[data-theme="dark"] .dwc-pin-card-btn {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(12, 74, 110, 0.42);
    color: #a5f3fc;
}

body[data-theme="dark"] .dwc-pin-card-btn.danger {
    border-color: rgba(248, 113, 113, 0.34);
    background: rgba(69, 10, 10, 0.72);
    color: #fecaca;
}

body[data-theme="dark"] .dwc-list {
    background: radial-gradient(circle at 84% 10%, rgba(14, 165, 233, 0.1), transparent 36%), radial-gradient(circle at 14% 90%, rgba(45, 212, 191, 0.1), transparent 32%), rgba(2, 6, 23, 0.68);
}

body[data-theme="dark"] .dwc-msg {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.26);
}

body[data-theme="dark"] .dwc-ai-list {
    background: radial-gradient(circle at 84% 10%, rgba(129, 140, 248, 0.16), transparent 36%), radial-gradient(circle at 14% 90%, rgba(56, 189, 248, 0.12), transparent 32%), rgba(2, 6, 23, 0.72);
}

body[data-theme="dark"] .dwc-ai-msg.assistant {
    background: rgba(30, 41, 59, 0.86);
    border-color: rgba(96, 165, 250, 0.34);
}

body[data-theme="dark"] .dwc-ai-msg.user {
    background: rgba(49, 46, 129, 0.56);
    border-color: rgba(129, 140, 248, 0.38);
}

body[data-theme="dark"] .dwc-ai-msg-role {
    color: #bfdbfe;
}

body[data-theme="dark"] .dwc-ai-model {
    background: rgba(15, 23, 42, 0.86);
    color: #c7d2fe;
    border-color: rgba(129, 140, 248, 0.34);
}

body[data-theme="dark"] .dwc-ai-msg-text {
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-ai-msg-text:empty::before {
    color: #cbd5e1;
}

body[data-theme="dark"] .dwc-ai-status {
    background: rgba(12, 74, 110, 0.48);
    color: #a5f3fc;
    border-color: rgba(103, 232, 249, 0.26);
}

body[data-theme="dark"] .dwc-ai-step {
    background: rgba(15, 23, 42, 0.82);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] .dwc-ai-code-inline {
    background: rgba(148, 163, 184, 0.22);
    color: #f8fafc;
}

body[data-theme="dark"] .dwc-ai-form,
body[data-theme="dark"] .dwc-ai-input {
    background: rgba(15, 23, 42, 0.84);
    color: #e5e7eb;
    border-color: rgba(129, 140, 248, 0.28);
}

body[data-theme="dark"] .dwc-msg-reply-btn {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(2, 6, 23, 0.86);
    color: #7dd3fc;
}

body[data-theme="dark"] .dwc-msg-pin-btn {
    border-color: rgba(250, 204, 21, 0.32);
    background: rgba(113, 63, 18, 0.78);
    color: #fde68a;
}

body[data-theme="dark"] .dwc-msg-delete-btn {
    border-color: rgba(248, 113, 113, 0.36);
    background: rgba(69, 10, 10, 0.82);
    color: #fecaca;
}

body[data-theme="dark"] .dwc-msg:focus-visible {
    outline-color: rgba(56, 189, 248, 0.6);
}

body[data-theme="dark"] .dwc-msg.me {
    background: rgba(12, 74, 110, 0.78);
    border-color: rgba(56, 189, 248, 0.32);
}

body[data-theme="dark"] .dwc-msg-text {
    color: #e5e7eb;
}

body[data-theme="dark"] .dwc-reply-block {
    border-left-color: rgba(56, 189, 248, 0.55);
    background: rgba(30, 41, 59, 0.72);
}

body[data-theme="dark"] .dwc-reply-block-title {
    color: #7dd3fc;
}

body[data-theme="dark"] .dwc-reply-block-text {
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-reply-box {
    border-color: rgba(56, 189, 248, 0.34);
    background: rgba(15, 23, 42, 0.84);
}

body[data-theme="dark"] .dwc-reply-text {
    color: #e2e8f0;
}

body[data-theme="dark"] .dwc-reply-cancel {
    border-color: rgba(148, 163, 184, 0.38);
    background: rgba(30, 41, 59, 0.86);
    color: #cbd5e1;
}

body[data-theme="dark"] .dwc-resize-handle {
    background:
    linear-gradient(315deg, transparent 0 46%, rgba(129, 140, 248, 0.24) 46% 54%, transparent 54% 100%),
    linear-gradient(315deg, transparent 0 62%, rgba(56, 189, 248, 0.5) 62% 72%, transparent 72% 100%);
}

@media (max-width: 540px) {
    .dwc-ai-fab {
        right: 78px;
        bottom: 14px;
        width: 54px;
        height: 54px;
    }

    .dwc-fab {
        right: 14px;
        bottom: 14px;
        width: 54px;
        height: 54px;
    }

    .dwc-overlay {
        right: 12px;
        bottom: 76px;
        width: calc(100vw - 24px);
        height: min(520px, calc(100vh - 100px));
        min-width: 0;
        min-height: 0;
    }

    .dwc-ai-overlay {
        --dwc-ai-main-form-height: 156px;
        --dwc-ai-side-static-height: 82px;
        right: 12px;
        bottom: 76px;
        width: calc(100vw - 24px);
        height: min(520px, calc(100vh - 100px));
        min-width: 0;
        min-height: 0;
    }

    .dwc-ai-shell {
        grid-template-columns: 1fr;
        grid-template-rows: 146px 1fr;
    }

    .dwc-ai-side {
        border-right: none;
        border-bottom: 1px solid rgba(79, 70, 229, 0.16);
    }

    .dwc-ai-chat-list {
        max-height: 64px;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(130px, 1fr);
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .dwc-shell {
        grid-template-columns: 1fr;
        grid-template-rows: 180px 1fr;
    }

    .dwc-sidebar {
        border-right: none;
        border-bottom: 1px solid rgba(15, 118, 110, 0.12);
    }

    .dwc-head-toggle,
    .dwc-resize-handle {
        display: none;
    }

    .dwc-pinned-list {
        max-height: 126px;
    }

    .dwc-pin-card {
        grid-template-columns: 30px 1fr;
    }

    .dwc-pin-card-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .dwc-room-list {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(130px, 1fr);
        overflow-x: auto;
        padding-bottom: 4px;
    }
}
