* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Ubuntu, sans-serif;
    background-color: #1a1a2e;
    color: #eaeaea;
    height: 100vh;
    overflow: hidden;
}

.login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 20%, rgba(78, 204, 163, 0.18), transparent 45%),
        radial-gradient(circle at 80% 30%, rgba(233, 69, 96, 0.2), transparent 50%),
        #141a2f;
}

.login-card {
    width: min(540px, 100%);
    padding: 26px;
    border-radius: 12px;
    border: 1px solid #2e4467;
    background: rgba(15, 24, 47, 0.92);
    box-shadow: 0 18px 56px rgba(0, 0, 0, 0.45);
}

.login-card h1 {
    margin-bottom: 8px;
    font-size: 30px;
}

.login-subtitle {
    font-size: 14px;
    color: #c9d8f5;
    margin-bottom: 14px;
}

.login-domains {
    margin-bottom: 16px;
    font-size: 12px;
    color: #adc4ea;
    line-height: 1.5;
}

.login-status {
    margin-top: 14px;
    font-size: 12px;
    color: #a8bddf;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background-color: #1a1a2e;
    padding: 16px 24px;
    border-bottom: 3px solid #e94560;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

header h1 {
    font-size: 24px;
    font-weight: bold;
}

header p {
    font-size: 14px;
    color: #a0a0a0;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

#user-name {
    font-size: 13px;
    font-weight: 600;
}

#user-role {
    font-size: 11px;
    color: #9fc4ff;
    letter-spacing: 0.4px;
}

#app-version-chip {
    margin-top: 2px;
    font-size: 10px;
    color: #f8d9a0;
    border: 1px solid #74592c;
    border-radius: 999px;
    padding: 1px 7px;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

body.tasks-dashboard-route main {
    display: block;
    overflow-y: auto;
    padding: 20px;
}

.left-panel {
    width: 350px;
    background-color: #16213e;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 1px solid #2a2a4a;
    overflow-y: auto;
}

body.tasks-dashboard-route .left-panel {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    border-right: 0;
    min-height: calc(100vh - 116px);
}

body.tasks-dashboard-route .right-panel {
    display: none;
}

.dashboard-main {
    display: block;
    overflow-y: auto;
    padding: 20px;
}

.dashboard-panel {
    width: min(1120px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.dashboard-eyebrow,
.dashboard-section-kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9fc4ff;
    margin-bottom: 8px;
}

.dashboard-hero h2 {
    font-size: 30px;
    margin-bottom: 10px;
}

.dashboard-copy {
    max-width: 760px;
    color: #adc4ea;
    line-height: 1.6;
    font-size: 14px;
}

.dashboard-summary-card,
.dashboard-section {
    border: 1px solid #294066;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(22, 33, 62, 0.98), rgba(17, 27, 52, 0.94));
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.22);
}

.dashboard-summary-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.dashboard-summary-label,
.dashboard-summary-meta {
    font-size: 12px;
    color: #a8bddf;
}

.review-required-count {
    color: #ffd58d;
    font-weight: 700;
}

.dashboard-summary-value {
    font-size: 18px;
    line-height: 1.4;
    word-break: break-word;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
    gap: 20px;
}

.dashboard-section {
    padding: 20px;
}

.dashboard-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-section h3 {
    font-size: 18px;
}

.dashboard-status-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: #d7e3ff;
}

.dashboard-progress-bar {
    margin-top: 0;
}

body.tasks-dashboard-route #editing-options-section,
body.tasks-dashboard-route #ai-settings-section,
body.tasks-dashboard-route .actions-section,
body.tasks-dashboard-route #managed-settings-note {
    display: none;
}

body.task-detail-route .upload-section {
    display: none;
}

section h2 {
    font-size: 14px;
    font-weight: bold;
    color: #eaeaea;
    margin-bottom: 12px;
}

.upload-zone {
    border: 2px dashed #e94560;
    border-radius: 4px;
    padding: 24px 16px;
    text-align: center;
    background-color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone:hover {
    border-color: #ff6b8a;
    background-color: #1f1f38;
}

.upload-zone.dragover {
    border-color: #4ecca3;
    background-color: rgba(78, 204, 163, 0.1);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 12px;
    color: #a0a0a0;
    margin-bottom: 12px;
}

.file-name {
    font-size: 11px;
    color: #a0a0a0;
    word-wrap: break-word;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 13px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e94560;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: #a0a0a0;
}

.input-field {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    background-color: #1a1a2e;
    color: #eaeaea;
    font-size: 12px;
}

.terms-box {
    min-height: 90px;
    resize: vertical;
    white-space: pre-wrap;
}

.inline-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.inline-row .input-field {
    margin-bottom: 0;
    flex: 1;
}

.btn-small {
    padding: 8px 12px;
    white-space: nowrap;
}

.hint-text {
    margin-top: 6px;
    font-size: 11px;
    color: #a0a0a0;
}

.wizard-open-btn {
    width: 100%;
    margin-bottom: 10px;
}

.advanced-settings {
    margin-top: 10px;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px;
}

.advanced-settings > summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #d5def5;
    margin-bottom: 8px;
}

.advanced-settings[open] > summary {
    margin-bottom: 10px;
}

.advanced-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.hidden {
    display: none;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #e94560;
    color: #eaeaea;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #ff6b8a;
}

.btn-primary:disabled {
    background-color: #2a2a4a;
    color: #a0a0a0;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 8px 16px;
    background-color: #2a2a4a;
    color: #eaeaea;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #3a3a5a;
}

.btn-secondary:disabled {
    color: #a0a0a0;
    cursor: not-allowed;
}

.btn-text {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 11px;
    cursor: pointer;
    float: right;
}

.btn-text:hover {
    color: #eaeaea;
}

.header-user .btn-text {
    float: none;
}

.save-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.save-buttons .btn-secondary {
    flex: 1;
}

.assistant-section {
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.assistant-chat-toggle {
    position: fixed;
    right: 18px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(145deg, #e94560, #ff6b8a);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    z-index: 1200;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.assistant-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ffd166;
    color: #1a1a2e;
    font-size: 11px;
    line-height: 20px;
    font-weight: 700;
    text-align: center;
}

.assistant-toast {
    position: fixed;
    right: 18px;
    bottom: 146px;
    max-width: min(320px, calc(100vw - 32px));
    border-radius: 8px;
    border: 1px solid #32517e;
    background: rgba(10, 18, 38, 0.96);
    color: #dce8ff;
    font-size: 12px;
    padding: 10px 12px;
    z-index: 1250;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.assistant-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 84px;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100vh - 110px);
    overflow: auto;
    border-radius: 12px;
    border: 1px solid #2f446a;
    background: #111b34;
    padding: 12px;
    z-index: 1200;
    box-shadow: 0 22px 46px rgba(0, 0, 0, 0.35);
}

.assistant-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #d9e5ff;
}

.assistant-question-input {
    min-height: 56px;
    resize: vertical;
}

.assistant-panel-label {
    margin: 0 0 6px;
    color: #93abd1;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.assistant-prompt-panel {
    margin-bottom: 8px;
}

.assistant-prompt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.assistant-prompt-chip {
    min-height: 32px;
    border: 1px solid #365987;
    border-radius: 6px;
    background: rgba(39, 68, 112, 0.52);
    color: #d8e7ff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.assistant-prompt-chip:hover,
.assistant-prompt-chip:focus-visible {
    border-color: #78a8e8;
    background: rgba(65, 105, 166, 0.68);
    outline: none;
}

.assistant-prompt-chip:disabled {
    opacity: 0.58;
    cursor: wait;
}

.assistant-banner {
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(233, 69, 96, 0.8);
    border-radius: 6px;
    background: rgba(233, 69, 96, 0.12);
    color: #ffd5dd;
    font-size: 12px;
}

.assistant-dashboard-hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: #ffd58d;
}

.assistant-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.assistant-diagnostics {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #2f446a;
    border-radius: 6px;
    background: rgba(24, 36, 66, 0.6);
    color: #c7d9f5;
    font-size: 11px;
    line-height: 1.45;
}

.assistant-copy-btn {
    width: 100%;
    margin-bottom: 10px;
}

.assistant-request-log {
    margin-bottom: 10px;
    border: 1px solid #2f446a;
    border-radius: 6px;
    padding: 8px 10px;
    background: rgba(20, 30, 56, 0.7);
}

.assistant-request-log > summary {
    cursor: pointer;
    color: #d3e3ff;
    font-size: 12px;
    font-weight: 600;
}

#assistant-request-log-list {
    margin-top: 8px;
    font-size: 11px;
    color: #bed3f3;
    line-height: 1.4;
    max-height: 140px;
    overflow: auto;
}

#assistant-request-log-list ul {
    margin: 0;
    padding-left: 16px;
}

.assistant-run-stages {
    margin-bottom: 10px;
    border: 1px solid #2f446a;
    border-radius: 6px;
    padding: 8px 10px;
    background: rgba(20, 30, 56, 0.7);
}

.assistant-run-stages > summary {
    cursor: pointer;
    color: #d3e3ff;
    font-size: 12px;
    font-weight: 600;
}

#assistant-run-stages-list {
    margin-top: 8px;
    font-size: 11px;
    color: #bed3f3;
    line-height: 1.45;
}

#assistant-run-stages-list ul {
    margin: 0;
    padding-left: 16px;
}

.stage-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
    border: 1px solid transparent;
}

.stage-badge.done {
    border-color: rgba(78, 204, 163, 0.65);
    background: rgba(78, 204, 163, 0.14);
    color: #baf3de;
}

.stage-badge.skipped {
    border-color: rgba(255, 193, 7, 0.6);
    background: rgba(255, 193, 7, 0.14);
    color: #ffe9ab;
}

.stage-badge.failed {
    border-color: rgba(233, 69, 96, 0.65);
    background: rgba(233, 69, 96, 0.16);
    color: #ffced8;
}

.assistant-fallback-panel {
    margin-bottom: 10px;
    border: 1px solid #3f547c;
    border-radius: 6px;
    padding: 8px 10px;
    background: rgba(63, 84, 124, 0.18);
}

.assistant-fallback-panel > summary {
    cursor: pointer;
    color: #d4e2fa;
    font-size: 12px;
    font-weight: 600;
}

.assistant-fallback-summary {
    margin: 8px 0 6px;
    font-size: 11px;
    color: #d6e3fa;
}

.assistant-fallback-reasons,
.assistant-fallback-recommendations {
    font-size: 11px;
    color: #bad0f4;
    margin-bottom: 6px;
}

.assistant-fallback-reasons ul,
.assistant-fallback-recommendations ul {
    margin: 4px 0;
    padding-left: 18px;
}

.assistant-retry-btn {
    width: 100%;
    margin-top: 4px;
}

.assistant-guided-action-card {
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid #5f7fae;
    border-radius: 8px;
    background: rgba(38, 58, 94, 0.72);
    color: #d9e6fb;
}

.assistant-guided-action-title {
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 800;
}

.assistant-guided-action-summary {
    margin: 0 0 7px;
    color: #c6d8f3;
    font-size: 11px;
    line-height: 1.45;
}

.assistant-guided-action-details {
    color: #aec7ef;
    font-size: 11px;
    line-height: 1.4;
}

.assistant-guided-action-details ul {
    margin: 0 0 8px;
    padding-left: 18px;
}

.assistant-guided-action-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.assistant-output {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #d6e0f5;
    white-space: pre-wrap;
    min-height: 54px;
    max-height: 170px;
    overflow: auto;
    border: 1px solid #304970;
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.assistant-quick-summary {
    margin: 0 0 8px;
    padding: 9px 10px;
    border: 1px solid #3e5f90;
    border-radius: 8px;
    background: rgba(49, 76, 122, 0.2);
    color: #dbe8ff;
    font-size: 12px;
    line-height: 1.45;
}

.assistant-transcript {
    margin-bottom: 8px;
    border: 1px solid #2f446a;
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(20, 30, 56, 0.7);
}

.assistant-transcript > summary {
    cursor: pointer;
    color: #d3e3ff;
    font-size: 12px;
    font-weight: 600;
}

.assistant-suggestions ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.assistant-suggestions li {
    color: #9fc4ff;
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 4px;
}

.processing-mode-pill {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #35517f;
    color: #c3d6f5;
    font-size: 11px;
    line-height: 1.4;
    background: rgba(53, 81, 127, 0.22);
}

.processing-mode-pill.mode-ai {
    border-color: rgba(78, 204, 163, 0.65);
    color: #b7f2dd;
    background: rgba(78, 204, 163, 0.12);
}

.processing-mode-pill.mode-fallback {
    border-color: rgba(255, 193, 7, 0.65);
    color: #ffe6a1;
    background: rgba(255, 193, 7, 0.13);
}

.processing-mode-pill.mode-unknown {
    border-color: #35517f;
    color: #c3d6f5;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background-color: #16213e;
    overflow: hidden;
}

.task-history {
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    max-height: 220px;
    overflow-y: auto;
}

.task-history-item {
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.task-history-item:first-child {
    border-top: 0;
}

.task-history-item:hover {
    background: rgba(159, 196, 255, 0.1);
}

.task-history-item.active {
    background: rgba(78, 204, 163, 0.16);
}

.task-history-title {
    font-size: 12px;
    font-weight: 600;
    color: #e9f1ff;
}

.task-history-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
}

.task-history-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    color: #d9ebff;
    background: rgba(159, 196, 255, 0.12);
    border: 1px solid rgba(159, 196, 255, 0.22);
}

.task-history-badge-status {
    color: #d3ffe7;
    background: rgba(121, 223, 169, 0.12);
    border-color: rgba(121, 223, 169, 0.22);
}

.task-history-badge-status-review-required {
    color: #ffe7b8;
    background: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 193, 7, 0.36);
}

.task-history-meta {
    margin-top: 4px;
    font-size: 11px;
    color: #9fb0cf;
}

.task-empty {
    padding: 12px;
    font-size: 12px;
    color: #9aa8c2;
}

.tabs-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 20px;
    background-color: #1a1a2e;
    color: #a0a0a0;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background-color: #2a2a4a;
    color: #eaeaea;
}

.view-mode {
    display: flex;
    gap: 4px;
}

.view-tab {
    padding: 8px 12px;
    background-color: #1a1a2e;
    color: #a0a0a0;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.view-tab.active {
    background-color: #2a2a4a;
    color: #eaeaea;
}

.page-controls {
    display: grid;
    grid-template-columns: 1.4fr repeat(7, minmax(90px, 1fr));
    gap: 8px;
    align-items: end;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    padding: 8px;
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 10px;
    align-items: start;
}

.compare-pane {
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    min-height: 260px;
    overflow: hidden;
}

.compare-pane h3 {
    margin: 0;
    padding: 8px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #1a1f38;
    color: #dbe7ff;
}

.compare-content {
    max-height: 70vh;
    overflow: auto;
    padding: 8px 10px;
}

.pc-item .input-field {
    margin-bottom: 0;
}

.pc-preset {
    min-width: 170px;
}

.preview-container {
    flex: 1;
    background-color: #1a1a2e;
    border-radius: 4px;
    overflow: hidden;
}

.preview {
    width: 100%;
    height: 100%;
    padding: 12px;
    font-family: Consolas, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    color: #eaeaea;
}

.doc-preview {
    color: #eaeaea;
    line-height: 1.55;
}

.doc-preview h1,
.doc-preview h2,
.doc-preview h3,
.doc-preview h4 {
    margin: 10px 0 6px;
    color: #f6f6f6;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.doc-preview h1 {
    font-size: 20px;
    letter-spacing: 0.3px;
}

.doc-preview h2 {
    font-size: 17px;
}

.doc-preview h3 {
    font-size: 14px;
    text-transform: uppercase;
}

.doc-preview h4 {
    font-size: 13px;
    text-transform: uppercase;
    opacity: 0.9;
}

.doc-preview p {
    margin: 0 0 8px;
}

.foreign-term {
    font-style: italic;
    text-transform: lowercase;
}

.doc-gap {
    height: 8px;
}

.doc-list {
    margin: 0 0 10px 22px;
    padding: 0;
}

.doc-list li {
    margin: 0 0 6px;
}

.doc-list-ref {
    list-style-type: decimal;
}

.doc-list-ref li::marker {
    content: "[" counter(list-item) "] ";
    color: #9fc4ff;
}

.doc-table-wrap {
    margin: 12px 0;
    border: 1px solid rgba(159, 196, 255, 0.24);
    border-radius: 8px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.03);
}

.doc-table-preview {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
}

.doc-table-preview td {
    border: 1px solid rgba(159, 196, 255, 0.18);
    padding: 7px 9px;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.45;
    color: #e5efff;
    white-space: pre-wrap;
}

.doc-equation {
    margin: 10px 0;
    padding: 8px 11px;
    border-left: 3px solid rgba(120, 168, 232, 0.7);
    background: rgba(120, 168, 232, 0.1);
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    color: #ecf4ff;
    white-space: pre-wrap;
}

.doc-figure-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    margin: 12px 0;
    padding: 14px 16px;
    border: 1px solid rgba(159, 196, 255, 0.22);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(159, 196, 255, 0.08), rgba(78, 204, 163, 0.06)),
        rgba(255, 255, 255, 0.03);
}

.doc-figure-card-page {
    border-color: #cfd7e6;
    background:
        linear-gradient(135deg, rgba(201, 214, 234, 0.45), rgba(236, 240, 247, 0.85)),
        #f7f8fb;
}

.doc-figure-icon {
    min-width: 62px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(233, 69, 96, 0.16);
    color: #ffd5dd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-align: center;
}

.doc-figure-card-page .doc-figure-icon {
    background: #25324d;
    color: #f5f8ff;
}

.doc-figure-body {
    min-width: 0;
}

.doc-figure-title {
    font-size: 14px;
    font-weight: 700;
    color: #eef5ff;
    margin-bottom: 6px;
}

.doc-figure-card-page .doc-figure-title {
    color: #17243a;
}

.doc-figure-note,
.doc-figure-meta {
    font-size: 12px;
    line-height: 1.45;
    color: #b8c7e8;
}

.doc-figure-card-page .doc-figure-note,
.doc-figure-card-page .doc-figure-meta {
    color: #53627d;
}

.doc-figure-media {
    margin: 8px 0 2px;
}

.doc-figure-media img {
    display: block;
    width: 100%;
    max-width: min(560px, 100%);
    height: auto;
    border-radius: 6px;
    border: 1px solid rgba(159, 196, 255, 0.24);
    background: rgba(10, 18, 38, 0.3);
}

.doc-figure-card-page .doc-figure-media img {
    border-color: #cfd7e6;
    background: #f5f7fb;
}

.doc-figure-gallery {
    margin: 14px 0;
    padding: 12px;
    border: 1px solid rgba(159, 196, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.doc-figure-gallery-page {
    border-color: #d4dbe9;
    background: #f8f9fc;
}

.doc-figure-gallery-title {
    font-size: 13px;
    font-weight: 700;
    color: #e8f1ff;
    margin-bottom: 4px;
}

.doc-figure-gallery-page .doc-figure-gallery-title {
    color: #1d2d45;
}

.doc-figure-gallery-note {
    font-size: 11px;
    line-height: 1.4;
    color: #b8c7e8;
    margin-bottom: 10px;
}

.doc-figure-gallery-page .doc-figure-gallery-note {
    color: #586b87;
}

.doc-figure-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.doc-figure-gallery-item {
    margin: 0;
    border: 1px solid rgba(159, 196, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(10, 18, 38, 0.25);
}

.doc-figure-gallery-page .doc-figure-gallery-item {
    border-color: #d3dbe8;
    background: #ffffff;
}

.doc-figure-gallery-item img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: rgba(10, 18, 38, 0.36);
}

.doc-figure-gallery-page .doc-figure-gallery-item img {
    background: #f1f4f9;
}

.doc-figure-gallery-item figcaption {
    margin: 0;
    padding: 5px 7px;
    font-size: 10px;
    color: #d9e8ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-figure-gallery-page .doc-figure-gallery-item figcaption {
    color: #344a6b;
}

.doc-figure-meta {
    margin-top: 8px;
}

.doc-figure-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.doc-figure-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(159, 196, 255, 0.14);
    border: 1px solid rgba(159, 196, 255, 0.22);
    color: #ddecff;
    font-size: 11px;
    line-height: 1.2;
}

.doc-figure-card-page .doc-figure-tag {
    background: rgba(37, 50, 77, 0.08);
    border-color: rgba(37, 50, 77, 0.14);
    color: #2c3a54;
}

.page-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    padding: 8px 0 22px;
}

.page-sheet {
    width: min(100%, var(--page-width-px, 794px));
    background: #fcfcfc;
    color: #121212;
    border: 1px solid #d7d7dc;
    border-radius: 3px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    padding:
        var(--page-margin-top-px, 96px)
        var(--page-margin-right-px, 120px)
        var(--page-margin-bottom-px, 96px)
        var(--page-margin-left-px, 120px);
    font-family: "Times New Roman", Times, serif;
    font-size: var(--page-font-size-px, 16px);
    line-height: var(--page-line-height, 1.5);
    letter-spacing: 0;
    white-space: normal;
    min-height: var(--page-height-px, 1123px);
}

.page-sheet h1,
.page-sheet h2,
.page-sheet h3,
.page-sheet h4 {
    margin: 12px 0 8px;
    color: #0f0f0f;
    font-weight: 700;
}

.page-sheet h1 {
    font-size: var(--page-h1-size-px, 24px);
}

.page-sheet h2 {
    font-size: var(--page-h2-size-px, 20px);
}

.page-sheet h3 {
    font-size: var(--page-h3-size-px, 16px);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.page-sheet h4 {
    font-size: var(--page-h4-size-px, 14px);
    text-transform: uppercase;
    letter-spacing: 0.25px;
}

.page-sheet p {
    margin: 0 0 var(--page-para-spacing-px, 0px);
}

.page-sheet .page-list-item {
    padding-left: 22px;
    text-indent: -22px;
}

.page-sheet .page-list-marker {
    display: inline-block;
    min-width: 20px;
    font-weight: 600;
    color: #202024;
}

.page-sheet .page-number {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

.page-sheet .doc-table-wrap {
    border-color: #ccd4e3;
    background: #f8f9fc;
}

.page-sheet .doc-table-preview {
    min-width: 0;
}

.page-sheet .doc-table-preview td {
    border-color: #cfd7e6;
    color: #1a1d27;
    font-size: inherit;
}

.page-sheet .doc-equation,
.doc-equation-page {
    border-left-color: #486a9e;
    background: #edf3fb;
    color: #1b2738;
}

.page-sheet .redline-del {
    color: #ff9aa8;
    text-decoration: line-through;
}

.page-sheet .redline-add {
    color: #2fbf71;
    text-decoration: underline;
}

.redline-del {
    color: #ff9aa8;
    text-decoration: line-through;
}

.redline-add {
    color: #2fbf71;
    text-decoration: underline;
}

.page-sheet .missing-placeholder {
    color: #808080;
}

.missing-placeholder {
    color: #808080;
}

.corrections-panel {
    white-space: normal;
    font-family: "Segoe UI", Ubuntu, sans-serif;
    font-size: 13px;
    color: #e9edf7;
    line-height: 1.45;
}

.cor-summary {
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #2e3a5a;
    border-radius: 6px;
    background: rgba(159, 196, 255, 0.08);
}

.decision-card {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #355a56;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(78, 204, 163, 0.16), rgba(78, 204, 163, 0.06));
}

.decision-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #d4fff0;
    margin-bottom: 8px;
}

.decision-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.decision-btn {
    border: 1px solid rgba(175, 247, 223, 0.45);
    background: rgba(78, 204, 163, 0.18);
    color: #dffff4;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    cursor: pointer;
}

.decision-btn:hover {
    filter: brightness(1.06);
}

.decision-btn-reject {
    border-color: rgba(255, 164, 164, 0.45);
    background: rgba(233, 69, 96, 0.18);
    color: #ffd8df;
}

.decision-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 8px;
}

.decision-item {
    border: 1px solid rgba(186, 238, 222, 0.25);
    border-radius: 6px;
    padding: 6px 8px;
    background: rgba(8, 24, 22, 0.25);
}

.decision-label {
    font-size: 11px;
    color: #c8f5e7;
    margin-bottom: 5px;
}

.decision-toggle {
    display: flex;
    gap: 5px;
}

.decision-chip {
    border: 1px solid rgba(168, 240, 216, 0.4);
    background: rgba(78, 204, 163, 0.14);
    color: #dffdf1;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0.8;
}

.decision-chip.reject {
    border-color: rgba(255, 164, 164, 0.4);
    background: rgba(233, 69, 96, 0.12);
    color: #ffdce3;
}

.decision-chip.active {
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.validator-card {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #826031;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 193, 92, 0.17), rgba(255, 193, 92, 0.06));
}

.validator-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #ffe3bb;
    margin-bottom: 8px;
}

.validator-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.validator-item {
    border: 1px solid rgba(255, 211, 154, 0.35);
    border-radius: 6px;
    padding: 6px 8px;
    background: rgba(45, 28, 8, 0.35);
}

.validator-item span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: #ffdfb5;
    margin-bottom: 3px;
}

.validator-item strong {
    font-size: 13px;
    color: #fff4df;
}

.validator-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.validator-chip {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(255, 214, 164, 0.4);
    background: rgba(255, 193, 92, 0.13);
    color: #ffebcc;
}

.validator-messages {
    border-top: 1px dashed rgba(255, 214, 164, 0.35);
    padding-top: 8px;
}

.validator-messages-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    color: #ffe2bd;
    margin-bottom: 5px;
}

.validator-messages ul {
    margin: 0;
    padding-left: 18px;
}

.validator-messages li {
    color: #ffd8ae;
    font-size: 12px;
    margin-bottom: 4px;
}

.validator-ok {
    margin-top: 4px;
    font-size: 12px;
    color: #d8f6df;
}

.profile-card {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #4f5e8b;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(121, 223, 169, 0.12), rgba(121, 223, 169, 0.05));
}

.profile-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #d9f6e6;
    margin-bottom: 6px;
}

.profile-summary {
    font-size: 12px;
    color: #e6f4ec;
    margin-bottom: 8px;
}

.profile-rules {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.profile-chip {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(121, 223, 169, 0.35);
    background: rgba(121, 223, 169, 0.12);
    color: #d5f4e4;
}

.profile-validation {
    margin-top: 6px;
    border-top: 1px dashed rgba(180, 208, 240, 0.35);
    padding-top: 8px;
}

.profile-validation-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    color: #ffd7b5;
    margin-bottom: 5px;
}

.profile-validation ul {
    margin: 0;
    padding-left: 18px;
}

.profile-validation li {
    color: #ffd0a8;
    font-size: 12px;
    margin-bottom: 4px;
}

.prose-diff-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.prose-only-diff-box {
    margin: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid rgba(164, 197, 238, 0.35);
    border-radius: 8px;
    padding: 10px;
    background: rgba(8, 19, 34, 0.55);
    color: #d8e9ff;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.profile-ok {
    margin-top: 6px;
    font-size: 12px;
    color: #c6f3d9;
}

.audit-card {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid #35517a;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(90, 137, 203, 0.16), rgba(90, 137, 203, 0.06));
}

.audit-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    color: #d7e8ff;
    margin-bottom: 8px;
}

.audit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.audit-item {
    border: 1px solid rgba(159, 196, 255, 0.25);
    border-radius: 6px;
    padding: 6px 8px;
    background: rgba(10, 18, 36, 0.35);
}

.audit-item span {
    display: block;
    font-size: 10px;
    color: #a9c6ef;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    margin-bottom: 3px;
}

.audit-item strong {
    font-size: 13px;
    color: #e8f2ff;
}

.audit-consistency {
    border-top: 1px dashed rgba(159, 196, 255, 0.3);
    padding-top: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #d5e7ff;
}

.audit-label {
    color: #a9c6ef;
}

.audit-note {
    margin-top: 5px;
    font-size: 11px;
    color: #bad2f7;
}

.audit-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.audit-chip {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(159, 196, 255, 0.35);
    background: rgba(159, 196, 255, 0.12);
    color: #d8eaff;
}

.docx-card {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(121, 223, 169, 0.18);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(121, 223, 169, 0.12), rgba(121, 223, 169, 0.04));
}

.docx-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    color: #dff9eb;
    margin-bottom: 6px;
}

.docx-summary {
    font-size: 12px;
    color: #d2e4dc;
    margin-bottom: 10px;
}

.docx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.docx-item {
    border: 1px solid rgba(121, 223, 169, 0.2);
    border-radius: 8px;
    padding: 7px 9px;
    background: rgba(10, 18, 36, 0.32);
}

.docx-item span {
    display: block;
    font-size: 10px;
    color: #a8d6bf;
    text-transform: uppercase;
    letter-spacing: 0.25px;
    margin-bottom: 3px;
}

.docx-item strong {
    font-size: 14px;
    color: #effff6;
}

.docx-note,
.docx-ok {
    font-size: 12px;
    line-height: 1.5;
    border-radius: 8px;
    padding: 8px 10px;
}

.docx-note {
    color: #d8e6ff;
    background: rgba(159, 196, 255, 0.1);
    border: 1px solid rgba(159, 196, 255, 0.18);
}

.docx-ok {
    color: #c8f3dd;
    background: rgba(121, 223, 169, 0.08);
    border: 1px solid rgba(121, 223, 169, 0.18);
}

.cor-empty {
    color: #a9b3c9;
    padding: 10px 0;
}

.cor-group {
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.cor-group h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 8px 10px;
    background: #1a1f38;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cor-group h3 span {
    color: #9fc4ff;
    font-weight: 700;
}

.cor-group ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cor-group li {
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.cor-group li:first-child {
    border-top: 0;
}

.cor-line {
    font-size: 11px;
    color: #9aa3b8;
    margin-bottom: 4px;
}

.cor-change {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.cor-old {
    color: #ff8f8f;
    text-decoration: line-through;
}

.cor-new {
    color: #79dfa9;
    font-weight: 600;
}

.cor-arrow {
    color: #a0a0a0;
}

.cor-context {
    font-size: 11px;
    color: #aab4ca;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    padding: 5px 6px;
}

.cor-empty-token {
    color: #9aa3b8;
    font-style: italic;
}

.noun-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 10px;
}

.noun-label {
    font-size: 11px;
    color: #9aa3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

.noun-chip {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.2;
    border: 1px solid transparent;
}

.noun-chip.proper {
    background: rgba(159, 196, 255, 0.14);
    color: #cfe2ff;
    border-color: rgba(159, 196, 255, 0.35);
}

.noun-chip.common {
    background: rgba(121, 223, 169, 0.14);
    color: #c8f3dd;
    border-color: rgba(121, 223, 169, 0.35);
}

.noun-empty {
    color: #9aa3b8;
    font-style: italic;
    font-size: 11px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 11px;
    color: #a0a0a0;
}

#status {
    color: #4ecca3;
}

.autopilot-status-panel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(78, 204, 163, 0.25);
    background: rgba(78, 204, 163, 0.08);
    color: #d6f7ec;
    font-size: 11px;
}

.autopilot-status-title {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #9adfca;
}

.autopilot-status-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid rgba(154, 223, 202, 0.4);
    background: rgba(154, 223, 202, 0.12);
    color: #dffff4;
}

.autopilot-status-pill.autopilot-healed {
    border-color: rgba(47, 191, 113, 0.5);
    background: rgba(47, 191, 113, 0.2);
    color: #d8ffe8;
}

.autopilot-status-pill.autopilot-processed {
    border-color: rgba(121, 163, 255, 0.5);
    background: rgba(121, 163, 255, 0.18);
    color: #e2ecff;
}

.autopilot-status-detail {
    color: #c9d6d1;
    opacity: 0.95;
}

.processing-presence {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 0 0 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(233, 69, 96, 0.25);
    background:
        radial-gradient(circle at top left, rgba(233, 69, 96, 0.2), transparent 48%),
        linear-gradient(135deg, rgba(28, 33, 58, 0.98), rgba(17, 22, 42, 0.99));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.processing-presence::before {
    content: '';
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.08) 48%, transparent 100%);
    animation: processingCardSweep 3.2s ease-in-out infinite;
    pointer-events: none;
}

.processing-presence::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 1px solid rgba(255, 145, 166, 0.18);
    pointer-events: none;
}

.processing-presence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.processing-telemetry-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(233, 69, 96, 0.15);
    padding-top: 10px;
    animation: fadeInTelemetry 0.4s ease-out;
}

.telemetry-bar-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.progress-percentage-label {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #ff8aa0;
    background: rgba(233, 69, 96, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(233, 69, 96, 0.25);
}

.telemetry-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.telemetry-metric {
    display: flex;
    align-items: center;
    gap: 10px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.09);
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.telemetry-metric:hover {
    background: rgba(233, 69, 96, 0.07);
    border-color: rgba(233, 69, 96, 0.22);
    transform: translateY(-1px);
}

.metric-icon {
    font-size: 18px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(233, 69, 96, 0.25));
}

.metric-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.metric-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(246, 248, 255, 0.6);
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes fadeInTelemetry {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.processing-presence.hidden {
    display: none;
}

.processing-presence-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
}

.processing-orbit {
    position: relative;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #ffd1da 0%, #ff8aa0 45%, #e94560 100%);
    box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.35);
    animation: processingPulse 1.6s ease-out infinite;
    flex: 0 0 auto;
}

.processing-orbit::after {
    content: '';
    position: absolute;
    inset: -7px;
    border: 1px solid rgba(255, 181, 195, 0.45);
    border-radius: 999px;
    animation: processingRing 2.1s linear infinite;
}

.processing-orbit::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    border: 1px dashed rgba(255, 190, 203, 0.4);
    animation: processingRing 1.3s linear infinite reverse;
}

.processing-message {
    color: #f6f8ff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    animation: processingMessageBreath 1.9s ease-in-out infinite;
}

.processing-message-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.processing-stage-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.processing-stage-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    color: rgba(234, 240, 255, 0.62);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.11);
    transition: all 0.25s ease;
}

.processing-stage-dot.active {
    color: #fff3ea;
    background: linear-gradient(90deg, rgba(233, 69, 96, 0.26), rgba(255, 126, 103, 0.24));
    border-color: rgba(255, 171, 144, 0.6);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 14px rgba(255, 126, 103, 0.2);
    transform: translateY(-1px);
}

.processing-stage-dot.completed {
    color: #dbffe9;
    background: linear-gradient(90deg, rgba(47, 191, 113, 0.32), rgba(121, 223, 169, 0.25));
    border-color: rgba(121, 223, 169, 0.65);
}

.processing-timer {
    color: #ffd7df;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 167, 186, 0.34);
    background: rgba(233, 69, 96, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.progress-bar {
    height: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #e94560 0%, #ff7e67 56%, #ffbf69 100%);
    border-radius: 999px;
    transition: width 0.35s ease;
    box-shadow: 0 0 14px rgba(233, 69, 96, 0.35);
}

.progress-bar.processing .progress-fill {
    position: relative;
    background: linear-gradient(90deg, #e94560 0%, #ff7e67 50%, #ffbf69 100%);
    background-size: 220% 100%;
    animation: processingBarShift 1.8s linear infinite;
}

.progress-bar.processing .progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
    transform: translateX(-100%);
    animation: processingBarSweep 1.4s ease-in-out infinite;
}

.progress-bar.processing .progress-fill::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, 0.0) 0px,
            rgba(255, 255, 255, 0.0) 8px,
            rgba(255, 255, 255, 0.12) 8px,
            rgba(255, 255, 255, 0.12) 16px
        );
    animation: processingStripeMove 1.15s linear infinite;
}

@keyframes processingPulse {
    0% {
        transform: scale(0.92);
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.35);
    }
    55% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(233, 69, 96, 0);
    }
    100% {
        transform: scale(0.92);
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0);
    }
}

@keyframes processingRing {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes processingBarShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 220% 50%;
    }
}

@keyframes processingBarSweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(220%);
    }
}

@keyframes processingStripeMove {
    from { background-position: 0 0; }
    to   { background-position: 24px 0; }
}

@keyframes processingCardSweep {
    0%, 70%, 100% { transform: translateX(0); opacity: 0; }
    12% { opacity: 0.85; }
    48% { transform: translateX(430%); opacity: 0.5; }
}

@keyframes processingMessageBreath {
    0%, 100% { opacity: 0.88; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .processing-presence::before,
    .processing-orbit,
    .processing-orbit::after,
    .processing-orbit::before,
    .processing-message,
    .progress-bar.processing .progress-fill,
    .progress-bar.processing .progress-fill::after,
    .progress-bar.processing .progress-fill::before {
        animation: none !important;
    }
}

footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 24px;
    background-color: #16213e;
    font-size: 11px;
    color: #a0a0a0;
    border-top: 1px solid #2a2a4a;
}

.setup-wizard-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 24, 0.76);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.setup-wizard-backdrop.hidden {
    display: none;
}

body.admin-dashboard-route {
    min-height: 100vh;
    height: auto;
    overflow-y: auto;
}

body.admin-dashboard-route .app {
    min-height: 100vh;
    height: auto;
}

body.admin-dashboard-active main {
    display: none;
}

body.admin-dashboard-active #admin-panel-backdrop {
    position: static;
    inset: auto;
    z-index: auto;
    background: transparent;
    align-items: stretch;
    justify-content: stretch;
    padding: 16px 24px 24px;
}

body.admin-dashboard-active #admin-panel-backdrop .setup-wizard-card {
    width: 100%;
    max-width: none;
    box-shadow: none;
}

body.admin-dashboard-active #admin-panel-backdrop.hidden {
    display: flex;
}

.setup-wizard-card {
    width: min(760px, 100%);
    background: #141e38;
    border: 1px solid #2f446d;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    padding: 16px;
    color: #e8edff;
}

.admin-panel-card {
    width: min(1120px, 100%);
}

.admin-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.admin-block {
    border: 1px solid #2e446d;
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-block h3 {
    margin-bottom: 8px;
    font-size: 14px;
}

.admin-validation-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    align-items: center;
}

.admin-settings-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-settings-row {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 8px 14px;
    align-items: start;
}

.admin-row-label {
    margin: 8px 0 0;
}

.admin-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
    gap: 8px 12px;
    align-items: center;
}

.admin-check-grid .checkbox-item,
.admin-provider-grid .checkbox-item,
.admin-advanced-grid .checkbox-item {
    margin-bottom: 0;
}

.admin-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    align-items: center;
}

.admin-provider-grid > .hidden {
    display: none;
}

.admin-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
    align-items: center;
}

.admin-action-row {
    flex-wrap: wrap;
}

.admin-settings-actions .hint-text {
    margin-top: 8px;
}

.admin-diagnostics-json {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 18, 38, 0.75);
    color: #d6e3f8;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow: auto;
}

.admin-api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    align-items: center;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.password-field-input {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.password-toggle-btn {
    flex: 0 0 auto;
    min-width: 68px;
}

.admin-panel-card .btn-primary {
    width: auto;
}

@media (max-width: 920px) {
    .admin-settings-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .admin-row-label {
        margin-top: 0;
    }
}

.admin-table-wrap {
    max-height: 260px;
    overflow: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 7px 6px;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: #bcd1f3;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    background: #1a2441;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.status-pill.active {
    color: #d9fff2;
    border: 1px solid rgba(78, 204, 163, 0.45);
    background: rgba(78, 204, 163, 0.18);
}

.status-pill.inactive {
    color: #ffdbe2;
    border: 1px solid rgba(233, 69, 96, 0.4);
    background: rgba(233, 69, 96, 0.17);
}

.setup-wizard-card h2 {
    margin-bottom: 6px;
    font-size: 19px;
}

.setup-wizard-subtitle {
    margin-bottom: 12px;
    font-size: 12px;
    color: #bdd0f7;
}

.setup-wizard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.setup-wizard-help {
    margin-top: 12px;
    border: 1px dashed rgba(159, 196, 255, 0.42);
    background: rgba(159, 196, 255, 0.1);
    border-radius: 7px;
    padding: 9px 10px;
    font-size: 12px;
    color: #d9e8ff;
}

.setup-wizard-actions {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.setup-wizard-save {
    width: auto;
    padding: 10px 16px;
}

.setup-wizard-skip {
    margin-right: auto;
    font-size: 12px;
}

@media (max-width: 1200px) {
    .header-user {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .page-controls {
        grid-template-columns: repeat(4, minmax(100px, 1fr));
    }

    .audit-grid {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
    }

    .validator-grid {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
    }

    .decision-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .compare-grid {
        grid-template-columns: 1fr;
    }

    .noun-wrap {
        grid-template-columns: 1fr;
    }

    .setup-wizard-grid {
        grid-template-columns: 1fr;
    }

    .setup-wizard-actions {
        flex-wrap: wrap;
    }

    .login-card {
        padding: 18px;
    }

    .dashboard-hero,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .dashboard-main,
    body.tasks-dashboard-route main {
        padding: 14px;
    }

    .dashboard-section,
    .dashboard-summary-card {
        padding: 16px;
    }

    .dashboard-status-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Premium Split-Canvas Interface */
.split-canvas-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    height: 100%;
    width: 100%;
    position: relative;
    background: #0d0d1a;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.pane-left {
    display: none !important;
}

.split-pane {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.split-pane:hover {
    border-color: rgba(159, 196, 255, 0.25);
    box-shadow: 0 8px 32px 0 rgba(159, 196, 255, 0.05);
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pane-header.glassmorphic {
    background: rgba(255, 255, 255, 0.02);
}

.pane-title {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #e5efff;
}

.pane-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #b8c7e8;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pane-badge.success {
    background: rgba(47, 191, 113, 0.15);
    color: #4efca0;
    border-color: rgba(47, 191, 113, 0.25);
}

.pane-header-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.heading-legend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 2px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.heading-legend-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #c8d7f6;
    text-transform: uppercase;
}

.heading-legend-chip {
    font-size: 10px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    color: #dbe8ff;
    background: rgba(159, 196, 255, 0.12);
    border: 1px solid rgba(159, 196, 255, 0.22);
}

.pane-mini-save-indicator {
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #dbe6ff;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.pane-mini-save-indicator.hidden {
    opacity: 0;
    transform: translateY(-2px);
    pointer-events: none;
}

.pane-mini-save-indicator.saving {
    color: #ffe29a;
    border-color: rgba(255, 226, 154, 0.45);
    background: rgba(255, 226, 154, 0.12);
}

.pane-mini-save-indicator.saved {
    color: #b9f7db;
    border-color: rgba(62, 201, 143, 0.5);
    background: rgba(62, 201, 143, 0.14);
}

.pane-mini-save-indicator.error {
    color: #ffb8bf;
    border-color: rgba(255, 122, 135, 0.55);
    background: rgba(255, 122, 135, 0.14);
}

.pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: #d1dcec;
}

/* Glassmorphic Floating Sidebar Controls */
.floating-glass-controls {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 320px;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    background: rgba(13, 13, 30, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.6);
    z-index: 100;
    transition: all 0.3s ease;
}

.floating-glass-controls:hover {
    border-color: rgba(159, 196, 255, 0.3);
}

.floating-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
}

.floating-subtitle {
    font-size: 11px;
    color: #8c9cb8;
    margin-bottom: 12px;
    display: block;
}

.floating-group-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 4px;
}

.floating-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.floating-group-item:last-child {
    border-bottom: none;
}

.floating-group-label {
    font-size: 12px;
    color: #e2ecfc;
}

.floating-btn-toggle {
    display: flex;
    gap: 4px;
}

.floating-chip {
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #b8c7e8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-chip:hover {
    background: rgba(255, 255, 255, 0.1);
}

.floating-chip.active {
    background: rgba(47, 191, 113, 0.2);
    color: #4efca0;
    border-color: rgba(47, 191, 113, 0.4);
}

.floating-chip.reject.active {
    background: rgba(233, 69, 96, 0.2);
    color: #ff8e9e;
    border-color: rgba(233, 69, 96, 0.4);
}

.floating-actions {
    display: flex;
    gap: 8px;
}

.floating-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floating-btn.accept-all {
    background: linear-gradient(135deg, #2fbf71 0%, #1ea35b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(47, 191, 113, 0.2);
}

.floating-btn.reject-all {
    background: linear-gradient(135deg, #e94560 0%, #c12a43 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.2);
}

.floating-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

/* Hover-pulse and highlighting for change segments */
.redline-del, .redline-add {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 2px;
    padding: 0 2px;
}

.redline-del {
    background: rgba(233, 69, 96, 0.1);
}

.redline-add {
    background: rgba(47, 191, 113, 0.1);
}

.redline-del:hover {
    background: rgba(233, 69, 96, 0.25);
    animation: hover-pulse-del 1.5s infinite alternate;
}

.redline-add:hover {
    background: rgba(47, 191, 113, 0.25);
    animation: hover-pulse-add 1.5s infinite alternate;
}

@keyframes hover-pulse-del {
    0% {
        box-shadow: 0 0 0 0px rgba(233, 69, 96, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(233, 69, 96, 0);
    }
}

@keyframes hover-pulse-add {
    0% {
        box-shadow: 0 0 0 0px rgba(47, 191, 113, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(47, 191, 113, 0);
    }
}

/* Glassmorphic Contextual Tooltip Popover */
.glassmorphic-tooltip {
    position: absolute;
    background: rgba(13, 13, 30, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: auto;
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 220px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #9fc4ff;
    letter-spacing: 0.5px;
    margin: 0;
}

.tooltip-text {
    font-size: 12px;
    color: #e5efff;
    margin: 0;
    word-break: break-word;
}

.tooltip-buttons {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.tooltip-btn {
    flex: 1;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tooltip-btn.accept {
    background: #2fbf71;
    color: white;
}

.tooltip-btn.reject {
    background: #e94560;
    color: white;
}

.tooltip-btn:hover {
    filter: brightness(1.15);
}

.glassmorphic-tooltip.hidden {
    display: none !important;
    pointer-events: none;
}

/* Glassmorphic WYSIWYG Floating Selection Toolbar */
.wysiwyg-floating-toolbar {
    position: absolute;
    background: rgba(13, 13, 30, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.wysiwyg-floating-toolbar.hidden {
    display: none !important;
}

.wysiwyg-btn {
    background: transparent;
    border: none;
    color: #e5efff;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wysiwyg-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #9fc4ff;
    transform: translateY(-1px);
}

.wysiwyg-btn.active {
    background: rgba(159, 196, 255, 0.2);
    color: #9fc4ff;
}

.wysiwyg-btn.highlight {
    color: #ffd54f;
}

.wysiwyg-separator {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.pane-content[contenteditable="true"] {
    outline: none;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.pane-content[contenteditable="true"]:focus {
    border-color: rgba(159, 196, 255, 0.4);
    box-shadow: 0 0 15px rgba(159, 196, 255, 0.1) inset;
}

/* Journal Profile Catalog & Guidelines Match Score UI */
.catalog-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.catalog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #9fc4ff, #4ecca3);
    opacity: 0.8;
}

.catalog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(159, 196, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.catalog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.catalog-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #e9f1ff;
    margin: 0;
    line-height: 1.3;
}

.catalog-card-id {
    font-size: 10px;
    font-family: monospace;
    background: rgba(159, 196, 255, 0.12);
    border: 1px solid rgba(159, 196, 255, 0.2);
    color: #9fc4ff;
    padding: 2px 6px;
    border-radius: 4px;
}

.catalog-card-body {
    font-size: 12px;
    color: #b0c4de;
    flex: 1;
    margin-bottom: 16px;
}

.catalog-rule-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
    padding-bottom: 4px;
}

.catalog-rule-label {
    color: #7d8fa9;
    font-weight: 500;
}

.catalog-rule-value {
    color: #e9f1ff;
    font-weight: 600;
}

.catalog-score-container {
    margin-top: 12px;
}

.catalog-score-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 4px;
}

.catalog-score-label {
    color: #a0a0a0;
    font-weight: 600;
}

.catalog-score-val {
    font-weight: 800;
}

.catalog-score-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.catalog-score-bar-fg {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.catalog-card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    margin-top: 8px;
}

.catalog-issues-list {
    margin: 4px 0 0 0;
    padding-left: 14px;
    font-size: 11px;
    color: #ffd58d;
}

.catalog-issues-list li {
    margin-bottom: 2px;
}

/* ============================================================
   Bibliography Healing Engine — Premium UI Components
   ============================================================ */

/* Heal-Bibliography trigger bar (inside pane-header on compare view) */
.heal-bib-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    background: linear-gradient(135deg, rgba(99, 57, 255, 0.12) 0%, rgba(20, 20, 45, 0.8) 100%);
    border-bottom: 1px solid rgba(99, 57, 255, 0.2);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.heal-bib-bar:hover {
    background: linear-gradient(135deg, rgba(99, 57, 255, 0.18) 0%, rgba(20, 20, 55, 0.9) 100%);
}

.heal-bib-label {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #b0a0ff;
    flex: 1;
}

.heal-bib-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #6339ff 0%, #a855f7 100%);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(99, 57, 255, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.heal-bib-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.heal-bib-btn:hover::before {
    left: 100%;
}

.heal-bib-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 57, 255, 0.5);
}

.heal-bib-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 10px rgba(99, 57, 255, 0.3);
}

.heal-bib-btn:disabled {
    background: rgba(99, 57, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.heal-bib-btn:disabled::before {
    display: none;
}

.heal-bib-btn .btn-icon {
    font-size: 13px;
    display: inline-block;
}

.heal-bib-btn.healing .btn-icon {
    animation: heal-spin 1s linear infinite;
}

@keyframes heal-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Healing progress overlay on pane-right */
.healing-progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 26, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 50;
    border-radius: 12px;
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.healing-progress-icon {
    font-size: 40px;
    animation: heal-bounce 1.2s ease-in-out infinite alternate;
}

@keyframes heal-bounce {
    from { transform: translateY(0px) scale(1.0); }
    to   { transform: translateY(-10px) scale(1.08); }
}

.healing-progress-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #d0c0ff;
    text-align: center;
}

.healing-progress-stage {
    font-size: 12px;
    color: #7c8ea8;
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.healing-progress-bar-wrap {
    width: 260px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(99, 57, 255, 0.2);
}

.healing-progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6339ff 0%, #a855f7 60%, #6339ff 100%);
    background-size: 200% 100%;
    animation: healing-shimmer 2s linear infinite;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes healing-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Status banner shown after healing completes */
.healing-status-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    background: linear-gradient(135deg, rgba(47, 191, 113, 0.12) 0%, rgba(20, 20, 45, 0.8) 100%);
    border-bottom: 1px solid rgba(47, 191, 113, 0.22);
    font-size: 12px;
    flex-shrink: 0;
    animation: slide-down 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slide-down {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.healing-status-icon {
    font-size: 16px;
}

.healing-status-text {
    flex: 1;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #4efca0;
}

.healing-status-detail {
    font-size: 11px;
    color: #7c8ea8;
}

/* HSL-pulsed diff highlights for healed reference segments */
.bib-healed {
    position: relative;
    background: rgba(99, 57, 255, 0.12);
    border-bottom: 1.5px solid rgba(168, 85, 247, 0.5);
    border-radius: 2px;
    cursor: help;
    padding: 0 2px;
    transition: background 0.3s ease;
    animation: bib-heal-pulse 3s ease-in-out infinite;
}

@keyframes bib-heal-pulse {
    0%, 100% {
        background: rgba(99, 57, 255, 0.08);
        box-shadow: 0 0 0 0px rgba(99, 57, 255, 0.25);
    }
    50% {
        background: rgba(99, 57, 255, 0.18);
        box-shadow: 0 0 0 3px rgba(99, 57, 255, 0);
    }
}

.bib-healed:hover {
    background: rgba(99, 57, 255, 0.28);
    animation: none;
}

.bib-healed.doi-added {
    border-bottom-color: rgba(47, 191, 113, 0.7);
    background: rgba(47, 191, 113, 0.08);
    animation: bib-doi-pulse 3s ease-in-out infinite;
}

@keyframes bib-doi-pulse {
    0%, 100% { background: rgba(47, 191, 113, 0.06); }
    50%       { background: rgba(47, 191, 113, 0.16); }
}

/* Pane badge variant for the healed bibliographic pane */
.pane-badge.healed {
    background: linear-gradient(135deg, rgba(99, 57, 255, 0.25) 0%, rgba(168, 85, 247, 0.2) 100%);
    color: #c4b0ff;
    border-color: rgba(99, 57, 255, 0.4);
    animation: badge-glow 2.5s ease-in-out infinite alternate;
}

@keyframes badge-glow {
    from { box-shadow: 0 0 6px rgba(99, 57, 255, 0.3); }
    to   { box-shadow: 0 0 12px rgba(168, 85, 247, 0.5); }
}

/* Synchronized scroll indicator line between panes */
.scroll-sync-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(99, 57, 255, 0.3) 30%, rgba(168, 85, 247, 0.2) 70%, transparent 100%);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.split-canvas-container.syncing .scroll-sync-line {
    opacity: 1;
    animation: sync-pulse 1s ease-in-out infinite alternate;
}

@keyframes sync-pulse {
    from { opacity: 0.4; }
    to   { opacity: 1.0; }
}

/* Reference number chip inside healed pane */
.ref-num-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-family: 'Outfit', monospace;
    font-size: 10px;
    font-weight: 800;
    background: rgba(99, 57, 255, 0.25);
    color: #b0a0ff;
    border: 1px solid rgba(99, 57, 255, 0.35);
    margin-right: 5px;
    vertical-align: middle;
    user-select: none;
    transition: all 0.2s ease;
}

.ref-num-chip:hover {
    background: rgba(99, 57, 255, 0.4);
    color: #d0c0ff;
}

/* Responsive — collapse to single-pane on narrow screens */
@media (max-width: 900px) {
    .split-canvas-container {
        grid-template-columns: 1fr;
    }

    .pane-right {
        display: none;
    }

    .floating-glass-controls {
        position: static;
        width: 100%;
        max-height: none;
        border-radius: 8px;
        margin-top: 12px;
    }

    .heal-bib-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
}
