html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    background: #07111f;
    color: #e8f7ff;
}

#particles-js,
body::before,
.app-footer {
    display: none;
}

.main-content {
    max-width: none;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

#app-container {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

#main-navigation {
    flex: 0 0 auto;
}

.academic-workspace-page {
    --aw-ink: #e8f7ff;
    --aw-muted: #8fb4c8;
    --aw-line: rgba(126, 200, 236, 0.22);
    --aw-panel: rgba(9, 27, 45, 0.88);
    --aw-blue: #57c4f6;
    --aw-blue-soft: rgba(87, 196, 246, 0.13);
    --aw-cyan: #47d8ff;
    --aw-green: #64e4ba;
    --aw-red: #ff8c86;
    --workspace-titlebar-color: #0f766e;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 22%, rgba(31, 115, 157, 0.28), transparent 34%), #07111f;
    color: var(--aw-ink);
    font-family: Inter, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.academic-workspace-page button,
.academic-workspace-page input,
.academic-workspace-page textarea,
.academic-workspace-page select {
    font: inherit;
}

.workspace-chat-panel,
.workspace-chat-panel *,
.workspace-chat-panel *::before,
.workspace-chat-panel *::after {
    box-sizing: border-box;
}

.workspace-topbar,
.workspace-statusbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(7, 17, 31, 0.94);
    border-bottom: 1px solid var(--aw-line);
}

.workspace-topbar {
    min-height: 62px;
    padding: 10px 16px;
}

.workspace-title-zone {
    min-width: 0;
    flex: 1;
}

.workspace-breadcrumbs,
.workspace-title-row,
.workspace-top-actions,
.canvas-toolbar,
.document-toolbar,
.document-toolbar-group,
.document-footer,
.analysis-head,
.analysis-head-main,
.analysis-title-meta,
.analysis-title-meta span,
.chat-panel-head,
.chat-panel-actions,
.chat-tabs,
.chat-search,
.chat-side-section summary,
.composer-actions,
.workspace-statusbar span {
    display: flex;
    align-items: center;
}

.workspace-breadcrumbs {
    gap: 6px;
    color: var(--aw-muted);
    font-size: 0.74rem;
}

.workspace-breadcrumbs i {
    width: 13px;
    height: 13px;
}

.workspace-title-row {
    gap: 8px;
    margin-top: 4px;
}

.workspace-select {
    max-width: min(520px, 70vw);
    min-width: 240px;
    height: 34px;
    padding: 0 30px 0 10px;
    border: 1px solid #ccd7df;
    border-radius: 6px;
    background: rgba(10, 31, 52, 0.92);
    color: var(--aw-ink);
    font-weight: 700;
}

.workspace-version-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(100, 228, 186, 0.14);
    color: var(--aw-green);
    font-size: 0.72rem;
    font-weight: 800;
}

.workspace-top-actions {
    gap: 8px;
}

.workspace-top-actions button,
.tool-icon,
.workspace-icon-action,
.analysis-action,
.send-button,
.chat-tabs button,
.conversation-item {
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.workspace-top-actions button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 10px;
    background: rgba(11, 43, 69, 0.84);
    border-color: rgba(126, 200, 236, 0.24);
    color: #d7f1ff;
}

.workspace-top-actions button:hover,
.workspace-icon-action:hover,
.tool-icon:hover,
.analysis-action:hover,
.conversation-item:hover {
    border-color: rgba(87, 196, 246, 0.72);
    background: var(--aw-blue-soft);
    color: var(--aw-blue);
}

.workspace-top-actions button.danger {
    border-color: rgba(255, 140, 134, 0.36);
    color: #ffd4d1;
}

.workspace-top-actions button.danger:hover {
    border-color: rgba(255, 140, 134, 0.78);
    background: rgba(255, 140, 134, 0.14);
    color: var(--aw-red);
}

.workspace-icon-action,
.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(11, 43, 69, 0.84);
    border-color: rgba(126, 200, 236, 0.24);
    color: #d7f1ff;
    text-decoration: none;
}

.workspace-stage {
    display: block;
    position: relative;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.workspace-canvas {
    position: relative;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background-color: #081421;
    background-image: radial-gradient(rgba(119, 201, 239, 0.17) 0.9px, transparent 0.9px);
    background-size: 18px 18px;
    cursor: grab;
    touch-action: none;
}

.workspace-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(9, 23, 38, 0.28), rgba(9, 23, 38, 0.03));
}

.workspace-canvas.is-panning {
    cursor: grabbing;
    -webkit-user-select: none;
    user-select: none;
}

.workspace-canvas-viewport {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.workspace-canvas-surface {
    position: absolute;
    left: 0;
    top: 0;
    width: 1900px;
    height: 1540px;
    transform-origin: 0 0;
    will-change: transform;
}

.workspace-canvas-surface.is-centering {
    transition: transform 180ms ease;
}

.canvas-toolbar {
    position: absolute;
    top: 14px;
    left: 50%;
    z-index: 6;
    gap: 8px;
    min-height: 42px;
    padding: 5px 8px;
    border: 1px solid rgba(126, 200, 236, 0.26);
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.82);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
    cursor: default;
}

.canvas-toolbar .tool-icon {
    width: 31px;
    height: 31px;
    background: transparent;
}

.canvas-toolbar strong {
    min-width: 46px;
    color: #e8f7ff;
    font-size: 0.78rem;
    text-align: center;
}

.canvas-links {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.canvas-link {
    fill: none;
    stroke: rgba(97, 205, 230, 0.72);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    marker-end: url(#canvas-arrowhead);
    filter: drop-shadow(0 0 7px rgba(71, 216, 255, 0.2));
}

.canvas-links marker path {
    fill: rgba(97, 205, 230, 0.92);
}

.link-summary {
    stroke: rgba(56, 189, 248, 0.82);
}

.link-detail {
    stroke: rgba(167, 139, 250, 0.82);
}

.link-data {
    stroke: rgba(245, 158, 11, 0.82);
}

.link-method {
    stroke: rgba(34, 197, 94, 0.82);
}

.workspace-document-shell,
.analysis-node,
.aidig-node,
.analysis-card {
    position: absolute;
    z-index: 2;
    box-sizing: border-box;
    border: 1px solid rgba(126, 200, 236, 0.22);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.workspace-document-shell::after,
.analysis-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 6;
    border: 1px solid rgba(126, 200, 236, 0.42);
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

.workspace-draggable {
    touch-action: none;
}

.workspace-canvas.is-dragging-item,
.workspace-canvas.is-resizing-item {
    cursor: grabbing;
    -webkit-user-select: none;
    user-select: none;
}

.workspace-item-dragging,
.workspace-item-resizing {
    z-index: 5;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.36), 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.workspace-chat-panel,
.workspace-modal-surface {
    position: relative;
    z-index: 2;
    border: 1px solid rgba(126, 200, 236, 0.22);
    border-radius: 8px;
    background: var(--aw-panel);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.workspace-document-shell {
    --workspace-titlebar-color: #0f766e;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    top: 450px;
    left: 570px;
    width: 760px;
    height: 660px;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border-color: #163750;
    background: var(--aw-panel);
}

.document-toolbar,
.document-footer {
    justify-content: space-between;
    gap: 12px;
    color: #f4fbff;
}

.document-toolbar {
    position: relative;
    z-index: 2;
    min-height: 44px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--workspace-titlebar-color), #123040);
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.document-toolbar:active,
.analysis-head:active {
    cursor: grabbing;
}

.document-footer {
    background: #0c314b;
}

.document-toolbar-group {
    gap: 8px;
}

.document-toolbar .tool-icon {
    width: 30px;
    height: 30px;
    background: transparent;
    border-color: transparent;
    color: #d9edf8;
    cursor: pointer;
}

.document-toolbar .tool-icon:hover,
.document-toolbar .tool-icon.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.tool-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.22);
}

.document-toolbar select {
    height: 30px;
    min-width: 108px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: #153d5a;
    color: #ffffff;
    cursor: pointer;
}

.document-body {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    height: auto;
    min-height: 0;
    background: #e8edf1;
}

.document-thumbnails {
    display: grid;
    grid-auto-rows: minmax(112px, auto);
    align-content: start;
    gap: 12px;
    padding: 12px;
    background: #143b56;
    overflow-y: auto;
    touch-action: pan-y;
}

.doc-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 78px;
    height: 100%;
    padding: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 5px;
    appearance: none;
    background: #f9fbfc;
    color: #26475c;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.doc-thumb.has-preview {
    min-height: 112px;
}

.doc-thumb-preview {
    display: grid;
    place-items: center;
    width: 72px;
    height: 88px;
    overflow: hidden;
    border: 1px solid #d6e0e8;
    border-radius: 3px;
    background: #ffffff;
}

.doc-thumb-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.doc-thumb-skeleton {
    width: 70%;
    height: 76%;
    border-radius: 2px;
    background: linear-gradient(135deg, #eef4f7, #dbe7ed);
}

.doc-thumb-page {
    display: block;
    color: inherit;
}

.doc-thumb:hover,
.doc-thumb.active {
    border-color: #57c4f6;
    box-shadow: 0 0 0 2px rgba(87, 196, 246, 0.28);
}

.doc-thumb:hover .doc-thumb-preview,
.doc-thumb.active .doc-thumb-preview {
    border-color: #57c4f6;
}

.document-preview {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    padding: 24px;
    overflow: auto;
    touch-action: pan-x pan-y;
}

.document-preview.is-pdf-preview {
    display: block;
}

.pdf-continuous-document {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: max-content;
    min-width: 100%;
    margin: 0 auto;
}

.document-preview iframe,
.document-preview img,
.modal-document-object iframe,
.modal-document-object img {
    width: 100%;
    height: 100%;
    border: none;
}

.document-preview img,
.modal-document-object img {
    object-fit: contain;
}

.pdf-frame {
    width: min(100%, 560px);
    height: 100%;
    max-height: 650px;
    border: 1px solid #ccd7df;
    background: #ffffff;
}

.document-native-frame {
    min-height: 520px;
}

.pdf-page-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 100%;
    min-height: 360px;
}

.pdf-page-canvas {
    display: block;
    flex: 0 0 auto;
    border: 1px solid #ccd7df;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(16, 33, 50, 0.16);
}

.pdf-page-loading {
    display: grid;
    place-items: center;
    width: min(100%, 520px);
    min-height: 520px;
    border: 1px solid #ccd7df;
    color: #5b7487;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(16, 33, 50, 0.1);
    font-size: 0.84rem;
    font-weight: 700;
}

.document-loading-card {
    display: grid;
    place-items: center;
    gap: 12px;
    width: min(100%, 420px);
    min-height: 260px;
    padding: 28px;
    color: #26475c;
    background: #ffffff;
    border: 1px solid #d7e1e8;
}

.document-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #dce8ef;
    border-top-color: #0f766e;
    border-radius: 50%;
    animation: workspace-spin 0.8s linear infinite;
}

.text-preview,
.file-preview-card {
    width: min(100%, 520px);
    min-height: 440px;
    padding: 36px 42px;
    background: #ffffff;
    color: #16202a;
    box-shadow: 0 10px 30px rgba(16, 33, 50, 0.12);
}

.text-preview {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", SimSun, "Microsoft YaHei", Georgia, 'Times New Roman', serif;
    line-height: 1.7;
}

.file-preview-card {
    display: grid;
    place-items: center;
    text-align: center;
}

.file-preview-card i {
    width: 56px;
    height: 56px;
    color: var(--aw-cyan);
}

.file-preview-card h2 {
    max-width: 100%;
    margin: 16px 0 8px;
    overflow-wrap: anywhere;
    font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", SimSun, "Microsoft YaHei", Georgia, 'Times New Roman', serif;
    font-size: 1.35rem;
}

.file-preview-card p {
    margin: 0;
    color: var(--aw-muted);
}

.document-footer {
    min-height: 34px;
    padding: 0 14px;
    font-size: 0.74rem;
}

.analysis-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    width: 420px;
    height: 300px;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border-color: rgba(181, 208, 222, 0.92);
    background: rgba(248, 252, 255, 0.96);
    color: #243849;
    box-shadow: 0 18px 44px rgba(4, 13, 23, 0.26);
}

.analysis-card-up {
    --workspace-titlebar-color: #0284c7;
}

.analysis-card-right {
    --workspace-titlebar-color: #7c3aed;
}

.analysis-card-left {
    --workspace-titlebar-color: #d97706;
}

.analysis-card-down {
    --workspace-titlebar-color: #16a34a;
}

.analysis-node,
.aidig-node {
    z-index: 3;
    display: inline-grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px 8px;
    min-width: 142px;
    min-height: 58px;
    padding: 9px 12px;
    border-color: #96bed0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--workspace-titlebar-color), #123040);
    color: #f4fbff;
    box-shadow: 0 12px 30px rgba(12, 49, 75, 0.24);
    cursor: pointer;
}

.analysis-node-up {
    --workspace-titlebar-color: #0284c7;
}

.analysis-node-right {
    --workspace-titlebar-color: #7c3aed;
}

.analysis-node-left {
    --workspace-titlebar-color: #d97706;
}

.analysis-node-down {
    --workspace-titlebar-color: #16a34a;
}

.analysis-node:hover,
.aidig-node:hover,
.analysis-node.active {
    border-color: #57c4f6;
    filter: brightness(1.08);
}

.analysis-node-up:hover,
.analysis-node-up.active,
.analysis-node-down:hover,
.analysis-node-down.active {
    filter: brightness(1.08);
}

.analysis-node i,
.aidig-node i {
    grid-row: span 2;
    width: 22px;
    height: 22px;
    color: #ffffff;
}

.analysis-node span,
.aidig-node span {
    font-size: 0.82rem;
    font-weight: 800;
}

.analysis-node strong,
.aidig-node strong {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.68rem;
    font-weight: 700;
}

.analysis-node-up {
    top: 381px;
    left: 879px;
}

.analysis-node-down {
    top: 1121px;
    left: 879px;
}

.analysis-node-left {
    top: 751px;
    left: 439px;
}

.analysis-node-right {
    top: 751px;
    left: 1319px;
}

.aidig-node {
    --workspace-titlebar-color: #db2777;
    top: 88px;
    right: 120px;
    min-width: 128px;
}

.analysis-card-up {
    top: 70px;
    left: 570px;
    width: 760px;
}

.analysis-card-left {
    top: 630px;
    left: 30px;
}

.analysis-card-right {
    top: 630px;
    left: 1450px;
}

.analysis-card-down {
    top: 1190px;
    left: 570px;
    width: 760px;
}

.analysis-head {
    position: relative;
    z-index: 2;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 7px 7px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, var(--workspace-titlebar-color), #123040);
    color: #ffffff;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
}

.analysis-head .tool-icon {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.analysis-head .tool-icon:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.analysis-head-main {
    flex: 1;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-width: 0;
}

.analysis-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #0b7195;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.analysis-head .analysis-title,
.analysis-head .analysis-title i,
.analysis-head .analysis-title-meta,
.analysis-head .analysis-title-meta b,
.analysis-head .analysis-title-meta strong {
    color: #ffffff;
}

.analysis-head .analysis-title-meta {
    opacity: 0.9;
}

.analysis-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-title i {
    width: 18px;
    height: 18px;
}

.analysis-title-meta {
    flex: 1 1 260px;
    flex-wrap: wrap;
    gap: 3px 10px;
    max-height: 2.7em;
    min-width: 0;
    overflow: hidden;
    color: #63768a;
    font-size: 0.68rem;
    line-height: 1.3;
}

.analysis-title-meta span {
    gap: 4px;
    min-width: 0;
    white-space: nowrap;
}

.analysis-title-meta b {
    color: #768696;
    font-weight: 700;
}

.analysis-title-meta strong {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #243849;
    font-size: 0.76rem;
    font-weight: 800;
}

.analysis-body {
    min-width: 0;
    min-height: 0;
    padding: 12px 14px;
    overflow: auto;
    color: #314156;
    font-size: 0.8rem;
    line-height: 1.55;
}

.analysis-main {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.analysis-sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    padding: 6px 8px;
    overflow: hidden;
    border-right: 1px solid #cfdee8;
    background: #edf5f9;
}

.analysis-actions {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 1px;
}

.analysis-version-select {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 0 5px;
    border: 1px solid #cbd8e2;
    border-radius: 6px;
    background: #ffffff;
    color: #314156;
    font-size: 0.64rem;
}

.analysis-action {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 29px;
    padding: 3px;
    background: #ffffff;
    border-color: #cfd9e2;
    color: #314156;
    font-size: 0.58rem;
    line-height: 1;
    text-align: center;
}

.analysis-action i {
    width: 14px;
    height: 14px;
}

.analysis-action span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analysis-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.analysis-export {
    min-width: 0;
    padding-inline: 3px;
    font-size: 0.6rem;
}

.analysis-result-preview {
    max-height: 96px;
    overflow: auto;
    padding-right: 4px;
    white-space: pre-wrap;
}

.analysis-result-loading {
    margin-top: 8px;
    color: #6b7d8f;
    font-size: 0.72rem;
}

.analysis-result-plain,
.analysis-result-markdown {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.analysis-result-plain {
    margin: 0;
    white-space: pre-wrap;
    font: inherit;
}

.analysis-result-markdown > :first-child {
    margin-top: 0;
}

.analysis-result-markdown > :last-child {
    margin-bottom: 0;
}

.analysis-result-markdown h1,
.analysis-result-markdown h2,
.analysis-result-markdown h3,
.analysis-result-markdown h4 {
    margin: 0.85em 0 0.35em;
    color: #17283a;
    line-height: 1.28;
}

.analysis-result-markdown h1 {
    font-size: 1rem;
}

.analysis-result-markdown h2 {
    font-size: 0.94rem;
}

.analysis-result-markdown h3,
.analysis-result-markdown h4 {
    font-size: 0.88rem;
}

.analysis-result-markdown p,
.analysis-result-markdown ul,
.analysis-result-markdown ol,
.analysis-result-markdown blockquote,
.analysis-result-markdown pre,
.analysis-result-markdown table {
    margin: 0.55em 0;
}

.analysis-result-markdown ul,
.analysis-result-markdown ol {
    padding-left: 1.2rem;
}

.analysis-result-markdown code {
    padding: 0.08em 0.28em;
    border-radius: 4px;
    background: #edf3f7;
    font-size: 0.78rem;
}

.analysis-result-markdown pre {
    overflow: auto;
    padding: 10px;
    border-radius: 6px;
    background: #13283a;
    color: #eef8ff;
}

.analysis-result-markdown pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.analysis-result-markdown table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.analysis-result-markdown th,
.analysis-result-markdown td {
    padding: 6px 8px;
    border: 1px solid #d1dde7;
    vertical-align: top;
}

.analysis-result-markdown blockquote {
    padding-left: 10px;
    border-left: 3px solid #8dbdd3;
    color: #52677b;
}

.analysis-card.expanded {
    border-color: #89b7cb;
    box-shadow: 0 18px 46px rgba(15, 111, 140, 0.16);
}

.chat-orb {
    position: absolute;
    top: 50%;
    right: 28px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 1px solid #96bed0;
    border-radius: 50%;
    background: #0c314b;
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(12, 49, 75, 0.28);
}

.workspace-chat-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 10;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    width: min(700px, calc(100vw - 24px));
    max-height: none;
    margin: 0;
    padding: 12px;
    overflow: hidden;
    border-color: rgba(126, 200, 236, 0.28);
    background: rgba(7, 20, 34, 0.94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transform: translateX(calc(100% + 24px));
    transition: transform 200ms ease;
}

.workspace-chat-panel.open {
    transform: translateX(0);
}

.workspace-chat-panel.fullscreen {
    left: 12px;
    right: 12px;
    z-index: 18;
    width: auto;
    transform: translateX(0);
}

.workspace-chat-panel.fullscreen .chat-panel-body {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.workspace-chat-panel.fullscreen .message-bubble {
    max-width: min(76%, 720px);
}

.workspace-chat-panel.fullscreen .chat-composer textarea {
    min-height: 72px;
    max-height: 132px;
}

.chat-panel-body {
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
    gap: 10px;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.chat-context-rail,
.chat-main-area {
    min-width: 0;
    min-height: 0;
}

.chat-context-rail {
    display: grid;
    grid-template-rows: minmax(0, 1fr) clamp(112px, 32%, 190px);
    gap: 8px;
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    overscroll-behavior: contain;
    padding-right: 2px;
}

.chat-main-area {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    overflow: hidden;
}

.chat-side-section {
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(126, 200, 236, 0.2);
    border-radius: 7px;
    background: rgba(6, 24, 40, 0.46);
}

.chat-side-section[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.source-side-section {
    max-height: none;
}

.chat-context-rail .chat-side-section:first-child[open] {
    min-height: 0;
}

.source-side-section[open] {
    min-height: 0;
}

.chat-side-section summary {
    justify-content: space-between;
    gap: 7px;
    min-height: 30px;
    padding: 0 8px;
    color: #d7f1ff;
    font-size: 0.74rem;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
}

.chat-side-section summary::-webkit-details-marker {
    display: none;
}

.chat-side-section summary::after {
    content: "+";
    margin-left: auto;
    color: var(--aw-muted);
    font-weight: 900;
}

.chat-side-section[open] summary::after {
    content: "-";
}

.chat-side-section summary i {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    color: var(--aw-blue);
}

.chat-side-section summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-side-content {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.conversation-side-content {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 0 7px 7px;
    overflow: hidden;
}

.source-side-content {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 0 7px 7px;
    overflow: hidden;
}

.workspace-chat-panel::-webkit-scrollbar,
.chat-context-rail::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar,
.chat-thread::-webkit-scrollbar {
    width: 8px;
}

.chat-source-strip::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.workspace-chat-panel::-webkit-scrollbar-track,
.chat-context-rail::-webkit-scrollbar-track,
.conversation-list::-webkit-scrollbar-track,
.chat-thread::-webkit-scrollbar-track,
.chat-source-strip::-webkit-scrollbar-track {
    background: rgba(7, 20, 34, 0.28);
    border-radius: 999px;
}

.workspace-chat-panel::-webkit-scrollbar-thumb,
.chat-context-rail::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb,
.chat-thread::-webkit-scrollbar-thumb,
.chat-source-strip::-webkit-scrollbar-thumb {
    border: 2px solid rgba(7, 20, 34, 0.28);
    border-radius: 999px;
    background: rgba(126, 200, 236, 0.5);
}

.chat-panel-head {
    justify-content: space-between;
    gap: 12px;
}

.chat-panel-head > div:first-child {
    min-width: 0;
}

.chat-panel-actions {
    flex: 0 0 auto;
    gap: 6px;
}

.chat-panel-actions .tool-icon {
    width: 32px;
    height: 32px;
}

.chat-panel-head strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}

.chat-panel-head span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--aw-muted);
    font-size: 0.68rem;
}

.chat-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 2px;
    border: 1px solid rgba(126, 200, 236, 0.22);
    border-radius: 7px;
    background: rgba(6, 24, 40, 0.58);
}

.chat-tabs button {
    height: 27px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--aw-muted);
    font-size: 0.74rem;
}

.chat-tabs button.active {
    background: rgba(87, 196, 246, 0.14);
    color: var(--aw-blue);
}

.chat-model-select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(126, 200, 236, 0.24);
    border-radius: 6px;
    background: rgba(6, 24, 40, 0.92);
    color: var(--aw-ink);
    font-size: 0.78rem;
}

.chat-search {
    gap: 6px;
    width: 100%;
    height: 32px;
    padding: 0 8px;
    border: 1px solid rgba(126, 200, 236, 0.24);
    border-radius: 6px;
    color: var(--aw-muted);
    background: rgba(6, 24, 40, 0.72);
}

.chat-search i {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
}

.chat-search input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--aw-ink);
}

.conversation-list,
.chat-thread {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 0;
    padding-right: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.conversation-list,
.chat-source-strip {
    height: 100%;
    max-height: 100%;
}

.chat-main-area .chat-thread {
    padding: 10px;
    border: 1px solid rgba(126, 200, 236, 0.18);
    border-radius: 8px;
    background: rgba(6, 24, 40, 0.46);
}

.conversation-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 48px;
    padding: 7px 8px;
    background: rgba(6, 24, 40, 0.72);
    border-color: rgba(126, 200, 236, 0.18);
    color: var(--aw-ink);
    text-align: left;
}

.conversation-item.active {
    border-color: rgba(87, 196, 246, 0.68);
    background: rgba(87, 196, 246, 0.14);
}

.conversation-open {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.conversation-actions {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.conversation-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--aw-muted);
    cursor: pointer;
}

.conversation-actions button:hover {
    border-color: rgba(87, 196, 246, 0.48);
    color: var(--aw-blue);
}

.conversation-actions button:disabled {
    border-color: rgba(126, 200, 236, 0.12);
    color: rgba(166, 181, 196, 0.62);
    cursor: default;
}

.conversation-share-badge {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(87, 196, 246, 0.14);
    color: #9bdcff;
    font-size: 0.68rem;
}

.conversation-actions i {
    width: 13px;
    height: 13px;
}

.conversation-item strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

.conversation-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--aw-muted);
    font-size: 0.68rem;
}

.conversation-item .conversation-share-badge {
    color: #9bdcff;
    font-size: 0.68rem;
}

.chat-source-strip {
    display: grid;
    align-content: start;
    gap: 5px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0 2px 0 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.source-chip {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    min-height: 27px;
    min-width: 0;
    padding: 3px 8px;
    border: 1px solid rgba(126, 200, 236, 0.22);
    border-radius: 999px;
    background: rgba(6, 24, 40, 0.72);
    color: #d7f1ff;
    font-size: 0.68rem;
}

.source-chip i {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
}

.source-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-chip input {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin: 0;
    accent-color: #0f6f8c;
}

.source-chip.active {
    border-color: #6aa5bc;
    background: rgba(71, 216, 255, 0.16);
    color: #e8fbff;
}

.source-chip.disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.message-bubble {
    max-width: min(90%, 520px);
    padding: 8px 10px;
    border: 1px solid rgba(126, 200, 236, 0.22);
    border-radius: 8px;
    background: rgba(8, 28, 47, 0.84);
    color: #e8f7ff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.8rem;
    line-height: 1.5;
}

.message-bubble.user {
    justify-self: end;
    background: rgba(87, 196, 246, 0.18);
    border-color: rgba(87, 196, 246, 0.42);
}

.message-bubble.assistant {
    justify-self: start;
}

.message-citations {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.citation-reference {
    display: grid;
    gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(126, 200, 236, 0.25);
    border-radius: 8px;
    background: rgba(6, 24, 40, 0.64);
    color: #bfefff;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.citation-reference:hover,
.citation-reference:focus-visible {
    border-color: rgba(87, 196, 246, 0.68);
    background: rgba(9, 39, 62, 0.82);
    outline: none;
}

.citation-reference-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    color: #e8fbff;
    font-size: 0.7rem;
}

.citation-reference-meta strong,
.citation-reference-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.citation-reference-meta span {
    flex: 0 1 auto;
    color: var(--aw-muted);
}

.citation-reference-quote {
    color: rgba(223, 244, 255, 0.86);
    font-size: 0.74rem;
    line-height: 1.45;
}

.citation-page-highlight {
    animation: citationPagePulse 1.6s ease-out;
}

@keyframes citationPagePulse {
    0%, 100% {
        box-shadow: none;
    }
    20% {
        box-shadow: 0 0 0 3px rgba(87, 196, 246, 0.46), 0 0 28px rgba(87, 196, 246, 0.22);
    }
}

.chat-empty {
    display: grid;
    min-height: 84px;
    place-items: center;
    color: var(--aw-muted);
    text-align: center;
    font-size: 0.78rem;
}

.chat-composer {
    display: grid;
    grid-template-rows: minmax(46px, auto) auto;
    min-height: 84px;
    max-height: 128px;
    border: 1px solid rgba(126, 200, 236, 0.24);
    border-radius: 7px;
    overflow: hidden;
}

.chat-composer textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    max-height: 78px;
    resize: none;
    border: none;
    outline: none;
    padding: 8px 10px;
    background: rgba(6, 24, 40, 0.72);
    color: var(--aw-ink);
    line-height: 1.45;
}

.composer-actions {
    justify-content: space-between;
    gap: 6px;
    min-height: 36px;
    padding: 6px;
    background: rgba(7, 17, 31, 0.86);
    border-top: 1px solid rgba(126, 200, 236, 0.18);
}

.composer-actions .tool-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
}

.send-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 30px;
    background: #0c5c84;
    color: #ffffff;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.composer-actions .tool-icon.active {
    border-color: rgba(60, 199, 255, 0.55);
    background: rgba(17, 110, 150, 0.54);
    color: #d9f7ff;
}

.citation-reference.is-web .citation-reference-meta strong::after {
    content: " · Web";
    color: #7ec8ec;
    font-weight: 700;
}

.workspace-statusbar {
    min-height: 38px;
    padding: 0 16px;
    color: #506174;
    font-size: 0.74rem;
}

.workspace-statusbar span {
    gap: 6px;
}

.workspace-statusbar strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e8eef3;
    color: #314156;
}

.statusbar-right {
    margin-left: auto;
}

.workspace-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 20, 31, 0.58);
}

.workspace-modal-surface {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(1100px, 96vw);
    height: min(820px, 92vh);
    overflow: hidden;
}

.workspace-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #dce3ea;
}

.workspace-modal-head h2 {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
}

.workspace-modal-body {
    min-height: 0;
    padding: 16px;
    overflow: auto;
    background: #edf2f5;
}

.modal-document-object {
    width: 100%;
    height: 100%;
    min-height: 640px;
    background: #ffffff;
}

.aidig-workbench-surface {
    width: min(1240px, 96vw);
    height: min(860px, 92vh);
}

.aidig-workbench-body {
    display: grid;
    grid-template-columns: minmax(250px, 300px) minmax(280px, 0.9fr) minmax(360px, 1.15fr);
    gap: 14px;
    min-height: 0;
    overflow: hidden;
}

.aidig-control-panel,
.aidig-document-panel,
.aidig-results-panel {
    min-height: 0;
    border: 1px solid #d7e0e7;
    border-radius: 8px;
    background: #ffffff;
}

.aidig-control-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    overflow: auto;
}

.aidig-status-card {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 8px;
    background: #f1f7f8;
    color: #243849;
}

.aidig-status-card span,
.aidig-field span,
.aidig-segment-prompt span {
    font-size: 0.76rem;
    font-weight: 700;
    color: #647487;
}

.aidig-status-card strong {
    font-size: 1.15rem;
    color: #123040;
}

.aidig-status-card p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #536678;
}

.aidig-field {
    display: grid;
    gap: 6px;
}

.aidig-field select,
.aidig-field textarea,
.aidig-segment-prompt textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid #ced8e0;
    border-radius: 8px;
    background: #fbfdfe;
    color: #243849;
    font: inherit;
}

.aidig-field select {
    height: 36px;
    padding: 0 10px;
}

.aidig-field textarea,
.aidig-segment-prompt textarea {
    padding: 9px 10px;
    resize: vertical;
    line-height: 1.5;
}

.aidig-actions {
    display: grid;
    gap: 8px;
    margin-top: auto;
}

.aidig-results-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.aidig-document-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.aidig-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e3e9ef;
}

.aidig-results-head div {
    display: grid;
    gap: 2px;
}

.aidig-results-head strong {
    color: #1f3142;
}

.aidig-results-head span {
    font-size: 0.78rem;
    color: #6b7c8e;
}

.aidig-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    min-height: 300px;
    padding: 22px;
    text-align: center;
    color: #66798b;
}

.aidig-empty i {
    width: 36px;
    height: 36px;
    color: #1f8a9a;
}

.aidig-empty strong {
    color: #27394a;
}

.aidig-segment-list {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 0;
    padding: 14px;
    overflow: auto;
}

.aidig-document-blocks {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    padding: 14px;
    overflow: auto;
}

.aidig-doc-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: #738597;
    text-align: center;
}

.aidig-doc-block {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #dce5ec;
    border-radius: 8px;
    background: #fbfdfe;
    cursor: pointer;
}

.aidig-doc-block:hover,
.aidig-doc-block.related {
    border-color: #9bc4cd;
    background: #f1f9fa;
}

.aidig-doc-block.active {
    border-color: #1f8a9a;
    box-shadow: inset 3px 0 0 #1f8a9a;
}

.aidig-doc-block-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.76rem;
    color: #66798b;
}

.aidig-doc-block-meta strong {
    color: #176f7e;
}

.aidig-doc-block-text {
    color: #2f4355;
    line-height: 1.6;
    font-size: 0.9rem;
}

.aidig-segment-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #dbe4eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(28, 48, 67, 0.06);
}

.aidig-segment-card.selected {
    border-color: #1f8a9a;
    box-shadow: 0 12px 28px rgba(31, 138, 154, 0.16);
}

.aidig-segment-card.high-priority {
    border-color: #89c4b4;
}

.aidig-segment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.aidig-segment-top span {
    font-weight: 700;
    color: #27394a;
}

.aidig-segment-top strong {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: #e7f5f0;
    color: #16765f;
    font-size: 0.82rem;
}

.aidig-segment-reason {
    margin: 0;
    color: #43576b;
    line-height: 1.55;
}

.aidig-segment-card blockquote {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid #94a9b8;
    border-radius: 0 8px 8px 0;
    background: #f6f8fa;
    color: #536678;
    line-height: 1.55;
}

.aidig-segment-prompt {
    display: grid;
    gap: 6px;
}

.aidig-image-area {
    min-height: 150px;
    border: 1px dashed #c7d4dd;
    border-radius: 8px;
    background: #f8fbfc;
    overflow: hidden;
}

.aidig-image-placeholder,
.aidig-generating {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    min-height: 150px;
    color: #6d7d8d;
}

.aidig-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid #d7e4ea;
    border-top-color: #1f8a9a;
    border-radius: 999px;
    animation: workspace-spin 0.8s linear infinite;
}

.aidig-generated-image {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 10px;
}

.aidig-image-frame {
    position: relative;
    display: grid;
    place-items: center;
}

.aidig-generated-image img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 6px;
    background: #ffffff;
}

.aidig-image-nav {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(20, 37, 51, 0.72);
    color: #ffffff;
    transform: translateY(-50%);
    cursor: pointer;
}

.aidig-image-nav:disabled {
    opacity: 0.38;
    cursor: default;
}

.aidig-image-nav.prev {
    left: 10px;
}

.aidig-image-nav.next {
    right: 10px;
}

.aidig-image-counter {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(20, 37, 51, 0.72);
    color: #ffffff;
    font-size: 0.76rem;
}

.aidig-generated-image figcaption {
    text-align: right;
    font-size: 0.84rem;
}

.aidig-generated-image a {
    color: #166a7a;
    font-weight: 700;
    text-decoration: none;
}

.aidig-segment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@keyframes workspace-spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

@media (max-width: 1320px) {
    .workspace-chat-panel {
        width: min(680px, calc(100vw - 24px));
    }
}

@media (max-height: 760px) {
    .workspace-chat-panel {
        top: 8px;
        bottom: 8px;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 8px;
        padding: 8px;
        overflow-x: hidden;
        overflow-y: hidden;
    }

    .chat-panel-body,
    .chat-context-rail,
    .chat-main-area {
        gap: 8px;
    }

    .chat-context-rail {
        grid-template-rows: minmax(0, 1fr) clamp(96px, 30%, 150px);
    }

    .source-side-section {
        max-height: none;
    }

    .chat-context-rail .chat-side-section:first-child[open] {
        min-height: 0;
    }

    .source-side-section[open] {
        min-height: 0;
    }

    .chat-panel-actions .tool-icon {
        width: 30px;
        height: 30px;
    }

    .chat-model-select {
        height: 32px;
    }

    .chat-search {
        height: 30px;
    }

    .chat-tabs button {
        height: 25px;
    }

    .conversation-list,
    .chat-thread {
        gap: 6px;
    }

    .conversation-item {
        min-height: 44px;
        padding: 6px 7px;
    }

    .chat-composer {
        min-height: 76px;
        max-height: 112px;
    }

    .chat-composer textarea {
        min-height: 42px;
        max-height: 62px;
        padding: 7px 9px;
    }

    .composer-actions {
        padding: 6px;
    }
}

@media (max-width: 980px) {
    .aidig-workbench-body {
        grid-template-columns: 1fr;
        overflow: auto;
    }

    .aidig-results-panel {
        overflow: visible;
    }

    .aidig-document-panel {
        overflow: visible;
    }

    .aidig-segment-list {
        overflow: visible;
    }

    .aidig-document-blocks {
        overflow: visible;
    }

    .workspace-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .workspace-top-actions {
        width: 100%;
        overflow-x: auto;
    }

    .workspace-canvas {
        min-height: 0;
    }

    .canvas-toolbar {
        left: 12px;
        right: 12px;
        justify-content: center;
        transform: none;
    }

    .document-body {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .document-thumbnails {
        grid-auto-rows: minmax(96px, auto);
        padding: 8px;
    }

    .doc-thumb.has-preview {
        min-height: 96px;
    }

    .doc-thumb-preview {
        width: 54px;
        height: 70px;
    }
}

@media (max-width: 640px) {
    .workspace-chat-panel {
        position: fixed;
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: 8px;
        z-index: 130;
        width: auto;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 8px;
        padding: 8px;
        border-radius: 10px;
    }

    .workspace-chat-panel.fullscreen,
    .workspace-chat-panel.fullscreen .chat-panel-body,
    .chat-panel-body {
        grid-template-columns: 1fr;
    }

    .chat-panel-body {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .chat-context-rail {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: auto;
        max-height: 154px;
        overflow-y: hidden;
    }

    .conversation-side-content {
        max-height: 112px;
        grid-template-rows: auto auto minmax(0, 1fr);
    }

    .source-side-section {
        max-height: 154px;
    }

    .chat-source-strip {
        max-height: 96px;
    }

    .workspace-chat-panel.fullscreen .message-bubble {
        max-width: min(92%, 520px);
    }

    .chat-panel-head strong {
        font-size: 0.9rem;
    }

    .chat-panel-actions .tool-icon {
        width: 32px;
        height: 32px;
    }

    .chat-model-select,
    .chat-search {
        height: 32px;
    }

    .conversation-item {
        min-height: 46px;
        padding: 7px 8px;
    }

    .conversation-actions {
        gap: 2px;
    }

    .conversation-actions button {
        width: 28px;
        height: 28px;
    }

    .source-chip {
        max-width: 100%;
    }

    .chat-composer textarea {
        min-height: 54px;
        max-height: 78px;
    }

    .workspace-select {
        min-width: 0;
        width: 100%;
    }

    .workspace-title-row {
        width: 100%;
    }

    .workspace-top-actions button span {
        display: none;
    }

    .workspace-statusbar {
        flex-wrap: wrap;
        padding: 8px 12px;
    }
}
