/* Shared loader styles */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cute-loader-state {
    display: flex;
    gap: 0.75rem;
    color: #64748b;
}

.cute-loader-state cute-loader {
    flex-shrink: 0;
}

.cute-loader-state__copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cute-loader-state__text {
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.cute-loader-state__hint {
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.cute-loader-state--inline,
.cute-loader-state--inline-center,
.cute-loader-state--button,
.cute-loader-state--button-icon {
    align-items: center;
    flex-direction: row;
}

.cute-loader-state--inline-center {
    justify-content: center;
    text-align: center;
}

.cute-loader-state--stack,
.cute-loader-state--stack-start {
    flex-direction: column;
}

.cute-loader-state--stack {
    align-items: center;
    text-align: center;
}

.cute-loader-state--stack-start {
    align-items: flex-start;
    text-align: left;
}

.cute-loader-state--button,
.cute-loader-state--button-icon {
    display: inline-flex;
    gap: 0.55rem;
    color: inherit;
}

.cute-loader-state--button-icon {
    justify-content: center;
}

.cute-loader-state--button .cute-loader-state__text,
.cute-loader-state--button-icon .cute-loader-state__text {
    color: inherit;
    font-size: 0.92rem;
    font-weight: 600;
}

.cute-loader-state--button .cute-loader-state__hint,
.cute-loader-state--button-icon .cute-loader-state__hint {
    color: inherit;
    font-size: 0.78rem;
    opacity: 0.85;
}

.cute-loader-state--muted .cute-loader-state__text {
    color: inherit;
    font-size: inherit;
    font-weight: 600;
}

.cute-loader-state--muted .cute-loader-state__hint {
    color: inherit;
    opacity: 0.9;
}

.cute-loader-state--compact {
    gap: 0.5rem;
}

/* Sourcing View Styles */
.sourcing-container {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    min-height: 100%;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.sourcing-project-card {
    background: #fbbf24;
    border: 2px solid #0f172a;
    padding: 1.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 8px;
    box-shadow: 0 4px 0 #0f172a;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sourcing-project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 0 #0f172a;
    background: #f59e0b;
}

.sourcing-project-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #0f172a;
}

.sourcing-workflow-page {
    background: transparent;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0.75rem;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
}

.sourcing-workflow-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0;
    flex-shrink: 0;
    z-index: 5;
    background: rgba(252, 255, 252, 0.96);
    border: 1px solid #dbe7ef;
    border-radius: 14px;
    padding: 0.5rem 0.7rem;
    backdrop-filter: blur(8px);
}

.sourcing-workflow-topbar .editable-title {
    font-family: var(--font-display);
    font-size: 1.04rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    margin: 0;
    outline: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
    text-align: center;
}

.sourcing-workflow-topbar-left {
    display: flex;
    align-items: center;
    min-width: 0;
    justify-self: start;
}

.sourcing-workflow-topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    justify-self: center;
}

.sourcing-workflow-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: fit-content;
    padding: 0.2rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 39, 66, 0.2);
    background: rgba(255, 255, 255, 0.84);
}

.sourcing-workflow-view-btn {
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    background: transparent;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.sourcing-workflow-view-btn.active {
    background: #0f2742;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(15, 39, 66, 0.2);
}

.sourcing-workflow-header-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
    justify-self: end;
}

.sourcing-workflow-sections {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sourcing-workflow-section {
    min-height: 0;
}

.sourcing-workflow-section-product {
    display: none;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
    overflow: hidden;
}

.sourcing-workflow-section-outreach {
    display: none;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sourcing-workflow-sections[data-active-section="spec"] .sourcing-workflow-section-product {
    display: flex;
    flex: 1 1 auto;
}

.sourcing-workflow-sections[data-active-section="outreach"] .sourcing-workflow-section-outreach {
    display: block;
    flex: 1 1 auto;
}

.sourcing-workflow-stagebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 0;
}

.sourcing-workflow-stage {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #dbe7ef;
}

.sourcing-workflow-stage span {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #d8e8ef;
    color: #0f2742;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sourcing-workflow-stage strong {
    display: block;
    color: #0f172a;
    font-size: 0.95rem;
}

.sourcing-workflow-stage small {
    display: block;
    color: #64748b;
    line-height: 1.45;
    margin-top: 0.15rem;
}

.sourcing-workflow-stage.active,
.sourcing-workflow-stage.done {
    background: #eef9f2;
    border-color: #9ad0b2;
}

.sourcing-workflow-stage.active span,
.sourcing-workflow-stage.done span {
    background: #0f2742;
    color: #ffffff;
}

.sourcing-chat-shell {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 34%),
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.06), transparent 28%),
        linear-gradient(180deg, #f2f7fb 0%, #f8fbfd 100%);
    border: 1px solid rgba(203, 213, 225, 0.65);
    border-radius: 24px;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    z-index: 2;
}

.sourcing-chat-window {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(244, 248, 251, 0.97) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 6px 14px rgba(15, 23, 42, 0.05);
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.85) rgba(226, 232, 240, 0.7);
    z-index: 2;
}

.sourcing-chat-window-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(248, 250, 252, 0.95);
}

.sourcing-chat-window-title {
    display: grid;
    gap: 0.18rem;
}

.sourcing-chat-window-kicker {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sourcing-chat-window-title strong {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.sourcing-chat-window-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.sourcing-chat-window-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.78);
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sourcing-chat-window-badge.primary {
    border-color: rgba(14, 116, 144, 0.18);
    background: rgba(224, 242, 254, 0.96);
    color: #0f4c64;
}

.sourcing-chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
    padding: 1rem;
}

.sourcing-chat-window::-webkit-scrollbar {
    width: 10px;
}

.sourcing-chat-window::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
    border: 2px solid rgba(241, 245, 249, 0.96);
}

.sourcing-chat-window::-webkit-scrollbar-track {
    background: transparent;
}

.sourcing-chat-bubble {
    position: relative;
    max-width: min(72ch, 78%);
    border-radius: 18px;
    padding: 0.8rem 0.95rem;
    border: 1px solid transparent;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(8px);
}

.sourcing-chat-bubble p {
    margin: 0;
    color: #0f172a;
    line-height: 1.48;
    font-size: 0.94rem;
}

.sourcing-chat-bubble p+p {
    margin-top: 0.55rem;
}

.sourcing-chat-bubble+.sourcing-chat-bubble {
    margin-top: 0.15rem;
}

.sourcing-chat-bubble.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(148, 163, 184, 0.28);
}

.sourcing-chat-bubble.assistant::after {
    content: "";
    position: absolute;
    left: 18px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.94);
    transform: rotate(45deg);
    border-radius: 2px;
}

.sourcing-chat-bubble.buyer {
    align-self: flex-end;
    background: linear-gradient(180deg, #16395f 0%, #0f2742 100%);
    border-color: rgba(15, 39, 66, 0.14);
}

.sourcing-chat-bubble.buyer p {
    color: #f8fafc;
}

.sourcing-chat-bubble.buyer::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: #0f2742;
    transform: rotate(45deg);
    border-radius: 2px;
}

.sourcing-chat-bubble-note {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.5rem !important;
}

.sourcing-chat-inline-note {
    align-self: flex-start;
    max-width: min(72ch, 78%);
    padding: 0.7rem 0.85rem;
    border-radius: 14px;
    background: rgba(241, 245, 249, 0.9);
    border: 1px dashed rgba(71, 85, 105, 0.2);
    color: #334155;
    font-size: 0.84rem;
}

.sourcing-chat-inline-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    max-width: min(72ch, 78%);
    padding: 0.72rem 0.9rem;
    border-radius: 14px;
    background: #ecfeff;
    border: 1px solid #99f6e4;
    color: #0f4c64;
    font-size: 0.84rem;
    font-weight: 600;
}

.sourcing-chat-inline-cta i {
    color: #0891b2;
}

.sourcing-workflow-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.75rem;
}

.sourcing-workflow-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 39, 66, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #18324d;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.sourcing-workflow-file-chip:hover {
    background: rgba(15, 39, 66, 0.12);
}

.sourcing-chat-bubble.buyer .sourcing-workflow-file-chip {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f8fafc;
}

.sourcing-chat-bubble.buyer .sourcing-workflow-file-chip:hover {
    background: rgba(255, 255, 255, 0.18);
}

.sourcing-questionnaire-card {
    width: min(100%, 760px);
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.88);
    border: 2px solid rgba(15, 39, 66, 0.14);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(15, 39, 66, 0.08);
}

.sourcing-questionnaire-header,
.sourcing-questionnaire-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1fr);
}

.sourcing-questionnaire-header {
    background: #0b6689;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sourcing-questionnaire-header span,
.sourcing-questionnaire-term,
.sourcing-questionnaire-answer {
    padding: 0.95rem 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.sourcing-questionnaire-header span:last-child,
.sourcing-questionnaire-term:last-child,
.sourcing-questionnaire-answer:last-child {
    border-right: none;
}

.sourcing-questionnaire-row:nth-child(odd) {
    background: rgba(226, 232, 240, 0.78);
}

.sourcing-questionnaire-row:nth-child(even) {
    background: rgba(241, 245, 249, 0.84);
}

.sourcing-questionnaire-term {
    color: #0f172a;
    font-weight: 700;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.sourcing-questionnaire-term.is-editable {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sourcing-questionnaire-term-editor {
    flex: 1;
}

.sourcing-questionnaire-term-input {
    font-weight: 700;
}

.sourcing-questionnaire-answer {
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    align-items: center;
}

.sourcing-questionnaire-field {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(8, 145, 178, 0.45);
    background: #ffffff;
    border-radius: 10px;
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.45;
    outline: none;
    font-family: var(--font-main);
    padding: 0.58rem 0.72rem;
    display: block;
    box-shadow: inset 0 0 0 1px rgba(186, 230, 253, 0.35);
}

.sourcing-questionnaire-field::placeholder {
    color: #64748b;
}

.sourcing-questionnaire-field:focus {
    border-color: #0369a1;
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.16);
}

.sourcing-questionnaire-field.is-short {
    white-space: nowrap;
    min-height: 0;
    height: 42px;
}

.sourcing-questionnaire-field.is-long {
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
}

.sourcing-questionnaire-field:disabled {
    color: #475569;
    cursor: default;
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: none;
}

.sourcing-questionnaire-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.sourcing-questionnaire-actions span {
    color: #0f2742;
    font-size: 0.88rem;
}

.sourcing-questionnaire-remove-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.sourcing-questionnaire-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.sourcing-questionnaire-remove-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.sourcing-questionnaire-toggle-row {
    align-self: flex-start;
}

.sourcing-questionnaire-toggle-btn {
    padding-left: 0.82rem;
    padding-right: 0.82rem;
}

.sourcing-chat-action-row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    align-self: flex-start;
}

.sourcing-chat-action-row-right {
    align-self: flex-end;
}

.sourcing-action-pill {
    border: 1px solid #0f2742;
    background: rgba(255, 255, 255, 0.94);
    color: #0f2742;
    border-radius: 999px;
    padding: 0.68rem 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.sourcing-action-pill.primary {
    background: #0f2742;
    color: #ffffff;
}

.sourcing-action-pill.secondary {
    background: rgba(241, 245, 249, 0.94);
}

.sourcing-action-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sourcing-generated-image-card {
    width: min(100%, 340px);
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.sourcing-generated-image-card img {
    width: 100%;
    display: block;
    border-radius: 10px;
    object-fit: cover;
}

.sourcing-inline-link {
    margin-top: 0.75rem;
    border: none;
    background: none;
    color: #0b6689;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.sourcing-chat-composer {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 16px;
    padding: 0.6rem 0.7rem;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06), 0 8px 20px rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
    z-index: 6;
    margin-top: 0.4rem;
}


.sourcing-workflow-pending-attachments {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.sourcing-workflow-pending-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.65rem;
    background: #eef5fb;
    border: 1px solid #c6d7e7;
    border-radius: 999px;
    color: #0f2742;
    font-size: 0.8rem;
}

.sourcing-workflow-pending-chip button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

.sourcing-chat-composer-row {
    display: block;
}

.sourcing-chat-icon-btn,
.sourcing-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
    color: #0f2742;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sourcing-chat-mode-btn {
    min-height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #ffffff;
    color: #0f2742;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding: 0 0.86rem;
}

.sourcing-chat-send-btn {
    background: #0f2742;
    color: #ffffff;
}

.sourcing-chat-image-toggle.active {
    background: #0b6689;
    border-color: #0b6689;
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(11, 102, 137, 0.24);
}

.sourcing-chat-icon-btn:disabled,
.sourcing-chat-mode-btn:disabled,
.sourcing-chat-send-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sourcing-chat-input-shell {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    background: #f8fafc;
    padding: 0.38rem 0.42rem;
}

.sourcing-chat-composer-actions {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sourcing-chat-composer-action-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.sourcing-chat-input {
    width: 100%;
    display: block;
    border: none;
    border-radius: 0;
    min-height: 36px;
    max-height: 160px;
    resize: none;
    padding: 0.55rem 0;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: #0f172a;
    background: transparent;
    line-height: 1.45;
}

.sourcing-chat-input:focus {
    outline: none;
}

.sourcing-chat-questionnaire-tip {
    margin: 0.72rem 0 0;
    padding: 0.55rem 0.68rem;
    border-radius: 12px;
    background: rgba(236, 254, 255, 0.9);
    border: 1px solid rgba(153, 246, 228, 0.9);
    color: #0f4c64;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sourcing-chat-composer-note {
    margin: 0.45rem 0 0;
    color: #64748b;
    font-size: 0.74rem;
}

.sourcing-status-card {
    margin-top: 1.5rem;
    border-radius: 18px;
    padding: 1.5rem;
    border: 1px solid #dbe7ef;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 39, 66, 0.06);
}

.sourcing-workflow-section-outreach .sourcing-status-card {
    margin-top: 0;
}

.sourcing-status-card.active {
    border-left: 6px solid #10b981;
}

.sourcing-status-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.sourcing-status-kicker {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0b6689;
    font-size: 0.78rem;
    font-weight: 700;
}

.sourcing-status-header h3 {
    margin: 0;
    font-family: var(--font-display);
    color: #0f172a;
}

.sourcing-status-header p:last-child {
    margin: 0.45rem 0 0;
    color: #475569;
    line-height: 1.55;
}

.sourcing-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.sourcing-status-metric {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.sourcing-status-metric span {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sourcing-status-metric strong {
    color: #0f172a;
    font-size: 1rem;
}

.sourcing-status-steps {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.sourcing-status-steps div {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: #334155;
    background: #f8fafc;
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.sourcing-status-steps i {
    color: #0b6689;
    margin-top: 0.15rem;
}

.sourcing-status-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.sourcing-status-card.pulse {
    animation: sourcing-outreach-pulse 1.1s ease;
}

@keyframes sourcing-outreach-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
    }

    100% {
        box-shadow: 0 0 0 22px rgba(16, 185, 129, 0);
    }
}

@media (max-width: 1000px) {

    .sourcing-workflow-topbar,
    .sourcing-status-header,
    .sourcing-chat-window-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .sourcing-workflow-topbar-center {
        justify-content: flex-start;
        justify-self: auto;
    }

    .sourcing-workflow-topbar .editable-title {
        text-align: left;
    }

    .sourcing-workflow-header-actions {
        justify-content: flex-start;
        justify-self: auto;
    }

    .sourcing-workflow-stagebar,
    .sourcing-status-grid {
        grid-template-columns: 1fr;
    }

    .sourcing-questionnaire-header,
    .sourcing-questionnaire-row {
        grid-template-columns: 1fr;
    }

    .sourcing-questionnaire-header span:first-child {
        display: none;
    }

    .sourcing-workflow-view-toggle {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 700px) {
    .sourcing-container {
        padding: 1rem;
    }

    .sourcing-chat-shell {
        padding: 1rem;
    }

    .sourcing-chat-window {
        height: 100%;
        min-height: 0;
    }

    .sourcing-chat-bubble,
    .sourcing-questionnaire-card,
    .sourcing-chat-inline-note {
        max-width: 100%;
    }

    .sourcing-chat-inline-cta {
        max-width: 100%;
    }

    .sourcing-chat-input-shell {
        align-items: center;
        border-radius: 16px;
    }

    .sourcing-chat-icon-btn,
    .sourcing-chat-send-btn {
        width: 36px;
        height: 36px;
    }

    .sourcing-chat-mode-btn {
        min-height: 36px;
        padding: 0 0.68rem;
        font-size: 0.74rem;
    }
}

.instruction-block {
    background: #f8fafc;
    color: #1e293b;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--accent);
}

.instruction-block h4 {
    color: var(--accent-dark);
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.instruction-page {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.instruction-page-header h2 {
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    color: #0f172a;
}

.instruction-page-header p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.instruction-overview,
.instruction-guidance {
    margin-top: 1.5rem;
}

.instruction-overview h3,
.instruction-guidance h3 {
    margin: 0 0 0.9rem;
    font-family: var(--font-display);
    color: #0f172a;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-sec-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0f766e;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.instruction-role-switch {
    display: inline-flex;
    gap: 0.5rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.35rem;
    margin-top: 1.25rem;
}

.instruction-role-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 600;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.instruction-role-btn.active {
    background: #0f766e;
    color: white;
}

.instruction-flow-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.instruction-flow-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    background: #f8fafc;
    transition: all 0.2s ease;
    height: 100%;
}

.instruction-flow-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    transform: translateY(-2px);
}

.instruction-flow-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0f766e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.65rem;
}

.instruction-flow-card h3 {
    margin: 0 0 0.45rem;
    color: #0f172a;
    font-family: var(--font-display);
}

.instruction-flow-card h4 {
    margin: 0 0 0.45rem;
    color: #0f172a;
    font-family: var(--font-display);
}

.instruction-flow-card p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
    font-size: 0.92rem;
}

.feature-toggle-btn {
    background: transparent;
    border: none;
    color: #0f766e;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.feature-toggle-btn:hover {
    color: #115e59;
    text-decoration: underline;
}

.feature-list {
    margin-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 0 8px 8px;
    animation: fadeInSlide 0.2s ease-out;
}

.feature-list.hidden {
    display: none;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-list ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.feature-list li {
    font-size: 0.85rem;
    color: #475569;
    padding: 0.25rem 0;
    display: flex;
    gap: 0.5rem;
}

.feature-list li strong {
    color: #0f766e;
    font-weight: 700;
    min-width: 1.5rem;
}

.instruction-role-panel {
    margin-top: 1.5rem;
    border: 1px solid #bfdbfe;
    background: linear-gradient(145deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.instruction-role-panel h3 {
    margin: 0 0 0.55rem;
    color: #0f172a;
    font-family: var(--font-display);
}

.instruction-role-list p {
    margin: 0 0 0.45rem;
    color: #334155;
    line-height: 1.6;
    font-size: 0.92rem;
}

.instruction-role-list p:last-child {
    margin-bottom: 0;
}

.instruction-role-list .instruction-group-title {
    margin-top: 0.6rem;
    margin-bottom: 0.35rem;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

@media (max-width: 900px) {
    .instruction-flow-grid {
        grid-template-columns: 1fr;
    }
}

/* Sourcing Table Base */
.sourcing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.sourcing-suppliers-scroll {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 1rem;
    background: #fcfcfc;
}


.sourcing-table th {
    padding: 1rem;
    text-align: left;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #64748b;
    position: sticky;
    top: 0;
    background: #fcfcfc;
    z-index: 10;
}


.sourcing-table td {
    background: white;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.sourcing-table tr td:first-child {
    border-left: 1px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
}

.sourcing-table tr td:last-child {
    border-right: 1px solid #e2e8f0;
    border-radius: 0 8px 8px 0;
}

.sourcing-progress-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.sourcing-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sourcing-progress-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 700;
}

.sourcing-progress-percent {
    font-size: 0.78rem;
    color: #0f172a;
    font-weight: 700;
}

.sourcing-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-bottom: 0.7rem;
}

.sourcing-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9 0%, #10b981 100%);
    transition: width 0.3s ease;
}

.sourcing-progress-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}

.sourcing-progress-step {
    font-size: 0.7rem;
    color: #64748b;
    padding: 0.25rem 0.35rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    text-align: center;
    background: #fff;
}

.sourcing-progress-step.done {
    border-color: #86efac;
    color: #166534;
    background: #dcfce7;
}

.sourcing-progress-step.active {
    border-color: #7dd3fc;
    color: #0c4a6e;
    background: #e0f2fe;
}

/* ==================== GOOGLE-STYLE SEARCH SECTION ==================== */
.sourcing-search-section {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.sourcing-search-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sourcing-search-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #0f172a;
    margin: 0;
}

.sourcing-search-icon {
    font-size: 1.25rem;
    color: var(--accent);
}

.sourcing-search-subtitle {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.sourcing-google-search-wrap {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.sourcing-google-search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 28px;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sourcing-google-search-bar:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.sourcing-google-search-bar.focused {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15), 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.sourcing-search-bar-icon {
    color: #94a3b8;
    font-size: 1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    transition: color 0.3s;
}

.sourcing-google-search-bar.focused .sourcing-search-bar-icon {
    color: var(--accent);
}

.sourcing-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: var(--font-main);
    color: #0f172a;
    background: transparent;
    padding: 0.5rem 0;
}

.sourcing-search-input::placeholder {
    color: #94a3b8;
    font-size: 0.95rem;
}

.sourcing-search-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.2s;
    flex-shrink: 0;
}

.sourcing-search-clear-btn:hover {
    color: #ef4444;
}

.sourcing-search-clear-btn.hidden {
    display: none;
}

.sourcing-search-submit-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.sourcing-search-submit-btn:hover {
    background: #059669;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.sourcing-search-submit-btn:active {
    transform: scale(0.95);
}

/* Autocomplete dropdown */
.sourcing-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 200;
    display: none;
    padding: 6px;
}

.sourcing-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s;
    font-size: 0.9rem;
    color: #334155;
}

.sourcing-autocomplete-item:hover {
    background: #f0fdf4;
    color: #166534;
}

.sourcing-autocomplete-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ==================== KEYWORD TAGS ==================== */
.sourcing-keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
    min-height: 28px;
}

.sourcing-keyword-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 5px 10px 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
}

.sourcing-keyword-pill:hover {
    border-color: #86efac;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
    transform: translateY(-1px);
}

.sourcing-keyword-remove {
    background: none;
    border: none;
    color: #166534;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.2s;
    font-size: 0.7rem;
    border-radius: 50%;
}

.sourcing-keyword-remove:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ==================== OUTREACH REQUIREMENTS MODAL ==================== */
.outreach-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.outreach-modal-content {
    background: white;
    border-radius: 20px;
    width: 560px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    animation: slideUpModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.outreach-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem 2rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.outreach-modal-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent) 0%, #059669 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.outreach-modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: #0f172a;
    margin: 0;
}

.outreach-modal-header p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.25rem 0 0;
}

.outreach-modal-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.outreach-modal-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.outreach-modal-body {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.outreach-req-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.outreach-req-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.outreach-req-group label i {
    color: var(--accent);
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.outreach-req-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: var(--font-main);
    color: #0f172a;
    transition: all 0.2s;
    background: #fafafa;
}

.outreach-req-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
    background: white;
}

.outreach-req-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: var(--font-main);
    color: #0f172a;
    transition: all 0.2s;
    background: #fafafa;
    resize: vertical;
    min-height: 70px;
}

.outreach-req-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
    background: white;
}

.outreach-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 2rem 2rem;
    border-top: 1px solid #f1f5f9;
}

.supplier-link-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: stretch;
}

.link-input-pill {
    background: #fbbf24;
    border: 2px solid #0f172a;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #0f172a;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-box-placeholder {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    color: #64748b;
    font-size: 0.8125rem;
}

.analyze-button-large {
    width: 100%;
    background: #064e3b;
    color: white;
    padding: 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 2rem;
    box-shadow: 0 10px 20px rgba(6, 78, 59, 0.2);
}

.analyze-button-large:hover {
    background: #065f46;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(6, 78, 59, 0.3);
}

.analyze-button-large:active {
    transform: translateY(1px);
}

.editable-title {
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.editable-title:hover {
    background: rgba(0, 0, 0, 0.05);
}

.editable-title:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--accent-light);
}

.delete-project-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: white;
    border: 2px solid #0f172a;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0;
    transform: scale(0.8);
}

div:hover>.delete-project-btn {
    opacity: 1;
    transform: scale(1);
}

.delete-project-btn:hover {
    background: #dc2626;
    transform: scale(1.1) !important;
}

.custom-context-menu {
    position: fixed;
    z-index: 10000;
    min-width: 180px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: none;
    flex-direction: column;
    animation: menu-pop-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes menu-pop-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(5px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-menu-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.context-menu-item:hover {
    background: rgba(16, 185, 129, 0.08);
    color: #10B981;
}

.context-menu-item i {
    font-size: 16px;
    opacity: 0.8;
    width: 20px;
    text-align: center;
}

.context-menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 6px 0;
}

/* Translation Badge */
.translation-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 8px;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.translation-badge i {
    font-size: 12px;
    color: #10B981;
}

.message-bubble {
    transition: all 0.3s ease;
}

:root {
    --primary: #0f172a;
    /* Deep Slate - Trustworthy, Industrial */
    --primary-light: #1e293b;

    --accent: #10B981;
    /* Logo Green - Emerald 500 */
    --accent-light: #34D399;
    /* Emerald 400 */
    --accent-glow: rgba(16, 185, 129, 0.15);
    --accent-dark: #059669;
    /* Emerald 600 */

    --secondary: #0EA5E9;
    /* Logo Blue - Sky 500 */
    --secondary-light: #38BDF8;
    /* Sky 400 */

    /* Brand Gradient */
    --brand-gradient: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    --brand-gradient-hover: linear-gradient(135deg, var(--secondary-light) 0%, var(--accent-light) 100%);

    /* Success: Shared with Accent */
    --success: #10B981;
    --success-light: #4ab8aa;

    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;

    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;

    /* Shadows - cooler, more modern tones */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.1);

    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-main: 'DM Sans', sans-serif;
    --dashboard-mobile-top-offset: 80px;

    /* Side specific colors - Aligned with logo */
    --side-buyer: var(--secondary);
    --side-supplier: var(--accent);
    --side-buyer-bg: rgba(14, 165, 233, 0.08);
    --side-supplier-bg: rgba(16, 185, 129, 0.08);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

body.dashboard-mobile-sidebar-open {
    overflow: hidden;
}

/* Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3仿真%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

.app-container {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 80px;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e2e8f0;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--brand-gradient);
    opacity: 0.3;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo .highlight {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 3rem;
}

.nav-main-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-action-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
    /* Push to the far right */
}

.nav-dash-btn {
    background: var(--primary);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 6px 6px;
    color: white !important;
    padding: 0.7rem 1.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.nav-dash-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.nav-dash-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px var(--accent-glow);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-dash-btn:hover::before,
.nav-dash-btn.active::before {
    opacity: 1;
}

.nav-dash-btn.active {
    box-shadow: 0 4px 10px var(--accent-glow);
}

.nav-btn {
    background: none;
    border: none;
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0.35rem 0;
    position: relative;
    letter-spacing: 0.3px;
    text-transform: none;
}

.nav-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-gradient);
    transition: width 0.3s ease;
}

.nav-btn:hover {
    color: var(--primary);
}

.nav-btn:hover::after,
.nav-btn.active::after {
    width: 100%;
}

.nav-btn.active {
    color: var(--secondary);
    font-weight: 600;
}

/* Global Buttons */
.btn-primary {
    background: var(--brand-gradient);
    color: white;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px var(--accent-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    background: var(--brand-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px var(--accent-glow);
}

.login-btn {
    background: var(--primary);
    color: white;
    font-family: var(--font-display);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 0.75rem;
}

.role-badge-small {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.05em;
}

.role-badge-mini {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
    display: inline-block;
}

.user-info-mini {
    display: flex;
    flex-direction: column;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem;
    position: relative;
}

.view {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.view.hidden {
    display: none;
    opacity: 0;
}

.view.active {
    display: block;
    opacity: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 0;
    max-width: 1400px;
    margin: 0 auto;
}

.hero.reworked {
    text-align: left;
    padding: 10rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    position: relative;
    overflow: hidden;
}

.hero-background-decor {
    position: absolute;
    top: 10%;
    right: 5%;
    width: 40%;
    height: 80%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    opacity: 0.1;
}

.decor-line {
    width: 100%;
    height: 1px;
    background: var(--brand-gradient);
}

.hero-content-wrapper {
    position: relative;
    z-index: 10;
    max-width: 900px;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
    transform: translateY(-2px);
}

.hero-title.large-left {
    font-family: var(--font-display);
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -2px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 850px;
    margin-bottom: 0;
}

.mission-statement {
    max-width: 600px;
    border-left: 4px solid var(--accent);
    padding-left: 2rem;
    margin-top: 2.5rem;
}

.mission-title {
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.4;
}

/* Sections */
.section-container {
    padding: 6rem 0;
    max-width: 1400px;
    margin: 0 auto;
    scroll-margin-top: 100px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--primary);
}

.section-title.align-left {
    font-family: var(--font-display);
    text-align: left;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1.5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    width: fit-content;
    margin-bottom: 2rem;
}

.section-title.align-left.green {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-description {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 800px;
    line-height: 1.6;
}



/* Problem Section */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.problem-card {
    background: var(--bg-card);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: left;
    border: 1px solid var(--border);
    transition: all 0.3s ease-out;
    position: relative;
}

.problem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.problem-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.problem-card:hover::before {
    opacity: 1;
}

.problem-card i {
    font-size: 2.5rem;
    color: var(--accent-light);
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.problem-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.problem-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Value Proposition Grid (2x2) */
.value-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Chevron Flowchart Style */
.chevron-flow-container {
    padding: 2rem 0;
    max-width: 1100px;
    margin: 0 auto;
}

.chevron-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    height: 100px;
}

.chevron-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    position: relative;
    background: var(--primary-light);
    color: white;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-align: center;
    letter-spacing: 0.5px;
}

.chevron-step:nth-child(2) {
    background: #3c4460;
}

.chevron-step:nth-child(3) {
    background: #7c6258;
}

.chevron-step:nth-child(4) {
    background: var(--accent);
}

/* Base chevron shape for all - we adapt the first and last with pseudo-classes */
.chevron-step {
    clip-path: polygon(calc(100% - 30px) 0%, 100% 50%, calc(100% - 30px) 100%, 0% 100%, 30px 50%, 0% 0%);
    margin-left: -20px;
    /* Overlap to create connected feel */
}

.chevron-step:first-child {
    clip-path: polygon(calc(100% - 30px) 0%, 100% 50%, calc(100% - 30px) 100%, 0% 100%, 0% 0%);
    margin-left: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.chevron-step:last-child {
    clip-path: polygon(100% 0%, 100% 100%, 0% 100%, 30px 50%, 0% 0%);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Active class no longer overrides color, maintained for potential JS use */
.chevron-step.active {
    background: var(--accent);
    color: white;
}

.chevron-step:hover {
    transform: scale(1.02);
    z-index: 10;
    filter: brightness(1.1);
}

/* Descriptions Grid */
.chevron-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.chevron-detail-item {
    padding-left: 1.5rem;
    position: relative;
}

.chevron-detail-item h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.chevron-detail-item h3::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 0;
}

.chevron-detail-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Maintain consistency with the rest of the app */
.evidence-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--accent) !important;
}

/* Chat Interface */
.chat-interface-container {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
}

.chat-input-wrapper i {
    color: var(--accent);
    margin-right: 0.75rem;
}

.chat-input-wrapper input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1.1rem;
    outline: none;
    color: var(--text-main);
}

.send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:hover {
    background: var(--accent);
}

.quick-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tag {
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    min-width: 0;
}

.about-text h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.values-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.value-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.value-item i {
    color: var(--accent);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mini-stat {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.mini-stat:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-lab {
    color: var(--text-muted);
    font-weight: 500;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--primary);
    font-weight: 500;
}

.contact-item i {
    color: var(--accent);
    width: 20px;
}

.contact-form {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.contact-form::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--success);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.contact-form .form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    min-height: 120px;
    font-family: inherit;
    resize: vertical;
}

.contact-form .btn-primary {
    width: 100%;
    margin-top: 1rem;
}

/* Categories */
.categories-section {
    margin-top: 4rem;
}

.categories-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.category-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Search View */
.search-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    color: var(--primary);
}

.search-bar-small {
    flex: 1;
    max-width: 600px;
    display: flex;
    align-items: center;
    background: var(--bg-elevated);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.search-bar-small:focus-within {
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.search-bar-small input {
    border: none;
    outline: none;
    width: 100%;
    margin-left: 0.5rem;
    font-size: 1rem;
}

.results-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.filters-sidebar {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    height: fit-content;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.filter-group select {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.factory-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.factory-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.factory-img {
    height: 180px;
    width: 100%;
    object-fit: cover;
}

.factory-info {
    padding: 1.5rem;
}

.factory-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.factory-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.9rem;
}

.location {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-sm {
    background: var(--bg-body);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Profile View */
.profile-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-top: 1rem;
}

.profile-banner {
    height: 250px;
    width: 100%;
    object-fit: cover;
}

.profile-header-section {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-title h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-btns {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--accent);
}

.btn-outline {
    background: white;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
}

.profile-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.info-section h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.info-section p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-body);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chart-container {
    background: var(--bg-body);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    height: 300px;
}

/* Analytics View */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.analytics-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.analytics-card h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.history-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.history-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-body);
}

.history-list li:last-child {
    border-bottom: none;
}

.history-list .query {
    font-weight: 500;
}

.history-list .time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Authentication Styles */
#auth-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-body);
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    border: 1px solid var(--border);
}

.user-profile span {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: #ef4444;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.requirement-modal-wrapper {
    position: fixed;
    top: 80px;
    left: 240px;
    width: calc(100vw - 240px);
    height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 800;
}

@media (max-width: 1024px) {
    .requirement-modal-wrapper {
        left: 224px;
        width: calc(100vw - 224px);
    }
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--primary);
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: var(--accent);
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Global App Layout with Sidebar */
.app-container main {
    display: flex;
    height: calc(100vh - 80px);
    min-height: 0;
    /* header height */
    padding: 0;
    margin: 0;
    background: var(--bg-body);
    overflow: hidden;
}

body.spec-workspace-scroll-lock {
    overflow: hidden;
}

body.dashboard-shell-scroll-lock {
    overflow: hidden;
}

body.dashboard-shell-scroll-lock .app-container {
    height: 100vh;
    min-height: 100vh;
}

body.dashboard-shell-scroll-lock .app-container>#main-content {
    height: calc(100vh - 80px);
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 1024px) {
    body.dashboard-shell-scroll-lock {
        overflow: auto;
    }

    body.dashboard-shell-scroll-lock .app-container {
        height: auto;
        min-height: 100vh;
    }

    body.dashboard-shell-scroll-lock .app-container>#main-content {
        height: auto;
        min-height: calc(100vh - var(--dashboard-mobile-top-offset));
        overflow: auto;
    }

    body.spec-workspace-scroll-lock {
        overflow: auto;
    }
}

.view {
    flex: 1;
    min-width: 0;
    display: none;
    /* Default hidden */
}

.view.active {
    display: block;
}

#dashboard-view.active,
#spec-alignment-view.active,
#messaging-view.active {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    align-items: stretch;
    justify-content: flex-start;
    max-width: none;
    margin: 0;
}

#dashboard-view.active>*,
#spec-alignment-view.active>*,
#messaging-view.active>* {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.dashboard-sidebar~.view.active {
    padding: 0;
}

.dashboard-sidebar.hidden {
    display: none !important;
}

.dashboard-mobile-backdrop {
    display: none;
    position: fixed;
    inset: var(--dashboard-mobile-top-offset) 0 0 0;
    border: none;
    padding: 0;
    background: rgba(15, 23, 42, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 880;
}

.dashboard-mobile-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar */
/* Sidebar */
.dashboard-sidebar {
    width: 240px;
    min-width: 240px;
    background: #0f172a;
    /* Deep Slate - Cleaner than complex gradient */
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    /* Removed horizontal padding completely */
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtler border */
    box-shadow: none;
    /* Cleaner look without heavy shadow */
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: fixed;
    top: 80px;
    left: 0;
    height: calc(100vh - 80px);
    z-index: 900;
    overflow-y: auto;
    overflow-x: hidden;
}


.sidebar-header {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    height: 42px;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}


.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    /* Tighter gap */
    flex: 1;
    padding: 0.5rem 0 0;
    align-items: stretch;
    /* Reset global nav centering */
    margin-left: 0;
    /* Reset global nav margin */
}

.sidebar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 0.5rem;
    /* Aligned with header padding */
    border-radius: 8px;
    /* Slightly sharper corners */
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    /* Smaller font */
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    min-height: 38px;
    transition: all 0.2s ease;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.dashboard-main-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1rem;
    /* More generous padding for the main button */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: auto;
    min-height: auto;
    margin-bottom: 0.5rem;
}

.dashboard-main-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-main-btn.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
    border-color: rgba(56, 189, 248, 0.3);
}

.dashboard-main-btn .btn-icon {
    font-size: 1.5rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-main-btn .btn-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.dashboard-main-btn .btn-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
}

.dashboard-main-btn .btn-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}



.sidebar-btn>span:not(.step-number) {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    transform: translateY(0.5px);
    /* Optical alignment */
}

.sidebar-btn i {
    width: 18px;
    font-size: 0.98rem;
    flex-shrink: 0;
    text-align: center;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    /* Sky Blue text */
    border-color: rgba(56, 189, 248, 0.2);
    font-weight: 600;
    box-shadow: none;
}

/* Workflow Steps Group */
.workflow-steps-group {
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0.05rem 0 0;
    padding-left: 0;
    gap: 0.2rem;
}

/* Vertical line for workflow connector */
.workflow-steps-group::before {
    display: none;
}

.sidebar-btn.workflow-step {
    position: relative;
    padding-left: 0.5rem;
    margin-bottom: 0;
    z-index: 1;
}

.step-number {
    position: static;
    width: 19px;
    height: 19px;
    background: rgba(148, 163, 184, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.95);
    transition: all 0.3s ease;
    z-index: 2;
    flex-shrink: 0;
}

/* Remove old connector divs */
.step-connector {
    display: none;
}

.sidebar-btn.workflow-step.active .step-number {
    background: white;
    color: #0c4a6e;
    border-color: white;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.26);
}

.sidebar-btn.workflow-step:hover .step-number {
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

#btn-dash-analytics {
    margin-top: 2rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.user-guide-toggle {
    width: 100%;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: rgba(56, 189, 248, 0.1);
    color: #e0f2fe;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.user-guide-toggle:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #ffffff;
}

.user-guide-toggle.active {
    background: #38bdf8;
    color: #082f49;
    border-color: #7dd3fc;
}

.user-guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 2600;
    pointer-events: auto;
    cursor: pointer;
}

.user-guide-highlight-box {
    position: fixed;
    border: 2px solid #38bdf8;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22), 0 10px 24px rgba(2, 6, 23, 0.22);
}

.user-guide-callout {
    position: fixed;
    width: min(340px, calc(100vw - 20px));
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 18px 32px rgba(2, 6, 23, 0.25);
}

.user-guide-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0c4a6e;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.4rem;
}

.user-guide-callout h4 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.user-guide-callout p {
    margin: 0;
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.45;
}

.user-guide-callout-fixed {
    min-height: 118px;
}

.user-guide-shell {
    position: fixed;
    z-index: 2602;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.32);
}

.user-guide-shell-video {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    padding: 1rem;
}

.user-guide-shell-floating {
    right: 16px;
    bottom: 16px;
    width: min(360px, calc(100vw - 24px));
    padding: 0.9rem;
}

.user-guide-shell-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.25rem;
    background: #e2e8f0;
    border-radius: 999px;
}

.user-guide-shell-tab {
    border: none;
    background: transparent;
    color: #475569;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-guide-shell-tab.active {
    background: #0f172a;
    color: #f8fafc;
}

.user-guide-shell-copy {
    margin-top: 0.9rem;
}

.user-guide-shell-copy h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.user-guide-shell-copy p {
    margin: 0.45rem 0 0;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.5;
}

.user-guide-video-frame {
    margin-top: 0.9rem;
    border-radius: 14px;
    overflow: hidden;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.user-guide-video-frame video {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(56vh, 520px);
    background: #020617;
}

.user-guide-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.9rem;
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.45;
}

.user-guide-checkbox input {
    margin-top: 0.15rem;
    width: 16px;
    height: 16px;
    accent-color: #0f172a;
}

.user-guide-shell-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.user-guide-shell-actions .btn-outline,
.user-guide-shell-actions .btn-primary {
    min-width: 110px;
    justify-content: center;
}

.requirements-guide-toggle {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    font-size: 0.86rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.requirements-guide-toggle:hover {
    border-color: #7dd3fc;
    color: #0c4a6e;
    background: #f8fafc;
}

.requirements-guide-toggle.active {
    border-color: #38bdf8;
    background: #e0f2fe;
    color: #075985;
}

@media (max-width: 720px) {
    .user-guide-shell-video {
        padding: 0.85rem;
    }

    .user-guide-shell-floating {
        left: 12px;
        right: 12px;
        width: auto;
    }

    .user-guide-shell-actions {
        justify-content: stretch;
    }

    .user-guide-shell-actions .btn-outline,
    .user-guide-shell-actions .btn-primary {
        flex: 1 1 140px;
    }
}

.user-info-mini {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9rem;
    gap: 0.4rem;
}

.sidebar-footer #sidebar-username {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sidebar-footer .role-badge-mini {
    background: rgba(226, 232, 240, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.42);
    color: #dbeafe;
    font-size: 0.68rem;
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 0;
    display: inline-flex;
    width: fit-content;
}

.dashboard-role-switch {
    display: inline-flex;
    margin-top: 0.55rem;
    padding: 0.18rem;
    gap: 0.2rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: rgba(15, 23, 42, 0.35);
}

.dashboard-role-btn {
    border: none;
    border-radius: 999px;
    background: transparent;
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.24rem 0.62rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-role-btn.active {
    background: #e0f2fe;
    color: #0f172a;
}

.dashboard-role-btn:hover {
    color: #ffffff;
}

/* Main Panel */
.dashboard-main-panel {
    flex: 1;
    padding: 1rem 2.5rem 2.5rem;
    overflow-y: auto;
    background: #f8fafc;
}

.dashboard-main-panel>.panel-header {
    display: none;
}

.dashboard-main-panel.sourcing-workflow-scroll-lock {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.dashboard-sidebar:not(.hidden)~#dashboard-view.active,
.dashboard-sidebar:not(.hidden)~#spec-alignment-view.active,
.dashboard-sidebar:not(.hidden)~#messaging-view.active {
    margin-left: 240px;
    width: calc(100% - 240px);
}

@media (max-width: 1024px) {
    .dashboard-sidebar {
        width: 224px;
        min-width: 224px;
    }

    .dashboard-sidebar:not(.hidden)~#dashboard-view.active,
    .dashboard-sidebar:not(.hidden)~#spec-alignment-view.active,
    .dashboard-sidebar:not(.hidden)~#messaging-view.active {
        margin-left: 224px;
        width: calc(100% - 224px);
    }
}

.panel-header {
    margin-bottom: 3rem;
}

.panel-header h1 {
    font-size: 2.25rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.panel-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 100%;
}

.panel-content.sourcing-workflow-scroll-lock {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    gap: 0;
    overflow: hidden;
}

.dashboard-section {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dashboard-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--brand-gradient);
    opacity: 0.8;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-body);
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2 i {
    color: var(--accent);
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
}

.dropdown-toggle:hover {
    background: var(--bg-body);
    color: var(--accent);
}

.dropdown-toggle i {
    transition: transform 0.3s ease;
}

.dropdown-toggle.collapsed i {
    transform: rotate(-90deg);
}

.view-all-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.view-all-btn:hover {
    text-decoration: underline;
}

.tasks-list,
.orders-list {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.tasks-list.collapsed,
.orders-list.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
}

/* Trust/Rolling Banner */
.trust-banner-container {
    margin-top: 4rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.trust-banner-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 2rem;
}

.trust-marquee {
    display: flex;
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2.5rem 0;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-content {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    gap: 1.2rem;
    min-width: 100%;
    padding: 0 1.5rem;
    animation: scroll-marquee 40s linear infinite;
}

@keyframes scroll-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

.trust-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: white;
    padding: 0 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    min-width: 160px;
    height: 80px;
    box-shadow: var(--shadow-sm);
    filter: grayscale(1);
    opacity: 0.6;
}

.trust-logo:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: translateY(-4px) scale(1.05);
    border-color: var(--secondary);
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.15);
}

.trust-logo img {
    max-height: 35px;
    max-width: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.trust-logo:hover img {
    filter: grayscale(0);
    opacity: 1;
}

/* QC Procedure Styles */
.qc-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.qc-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--accent) !important;
}

/* Status Badges */
[class^="badge-"] {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Timeline/Audit Trail */
.audit-trail-container {
    margin-top: 1rem;
    padding: 1rem 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.audit-trail-horizontal {
    display: flex;
    justify-content: flex-start;
    /* Changed from space-between to allow scrolling with min-width */
    align-items: flex-start;
    position: relative;
    padding-bottom: 1.5rem;
    min-width: 800px;
    /* Ensure there is enough space to trigger scrolling */
    gap: 1rem;
}

/* The horizontal line connecting dots */
.audit-trail-horizontal::before {
    content: '';
    position: absolute;
    top: 6px;
    /* Align with middle of 12px dot */
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.audit-trail-item {
    position: relative;
    flex: 0 0 120px;
    /* Fixed width for better scrolling behavior */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 1;
}

/* Vertical styles (keeping for backward compatibility or different views) */
.audit-trail-vertical .audit-trail-item {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border);
    padding-bottom: 1.5rem;
    transition: all 0.3s ease;
    align-items: flex-start;
    text-align: left;
}

.audit-trail-vertical .audit-trail-item.finished {
    border-left-color: #94a3b8;
}

.audit-trail-vertical .audit-trail-item.current {
    border-left-color: var(--accent);
}

.audit-trail-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid white;
    z-index: 2;
    transition: all 0.3s ease;
    margin-bottom: 0.75rem;
}

.audit-trail-vertical .audit-trail-dot {
    position: absolute;
    left: -7px;
    top: 0;
    margin-bottom: 0;
}

.audit-trail-item.finished .audit-trail-dot {
    background: #475569;
}

.audit-trail-item.current .audit-trail-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
    transform: scale(1.2);
}

.audit-trail-content {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 100%;
    padding: 0 0.5rem;
}

.audit-trail-item.finished .audit-trail-content {
    color: #000;
}

.audit-trail-item.current .audit-trail-content {
    color: var(--primary);
    font-weight: 600;
}

.audit-trail-horizontal .audit-trail-item strong {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    height: 2.4em;
    /* Max 2 lines height */
    overflow: hidden;
}

.audit-trail-timestamp {
    display: block;
    color: var(--text-muted);
    font-size: 0.65rem;
    margin-top: 0.25rem;
}

.audit-trail-scheduled {
    font-size: 0.65rem;
    color: var(--accent);
    margin-top: 0.15rem;
}

.audit-trail-info-box {
    margin: 0.5rem auto 0;
    position: relative;
    max-width: 120px;
    z-index: 5;
}

.audit-trail-note {
    margin: 0;
    color: #475569;
    font-style: italic;
    background: #f1f5f9;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    overflow: hidden;
    line-height: 1.35;
    max-height: 3.1em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.audit-trail-item:hover .audit-trail-note {
    max-width: 250px;
    max-height: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
    z-index: 10;
    width: max-content;
    min-width: 150px;
}

.audit-trail-item.future {
    opacity: 0.5;
}


/* Action Modal & Optional Comment UI */
.action-modal {
    max-width: 400px;
    text-align: center;
}

.action-modal h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.action-modal p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Spec Summary Styles */
.spec-summary-list {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dotted var(--border);
}

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

.spec-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.spec-value {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.spec-total {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spec-total .spec-label {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
}

.spec-total .spec-value {
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 800;
}

/* Dual Side Label Styles */
.side-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.side-label.buyer {
    background: var(--side-buyer-bg);
    color: var(--side-buyer);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.side-label.supplier {
    background: var(--side-supplier-bg);
    color: var(--side-supplier);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.split-value {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.split-separator {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.5;
}

.toggle-comment-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.toggle-comment-btn:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.optional-comment-area {
    display: none;
    margin-top: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

.optional-comment-area.active {
    display: block;
}

.qc-report-card {
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.qc-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 2rem;
}

.qc-detail-hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.9rem;
}

.qc-detail-hero-toolbar {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.qc-detail-status-pill {
    align-self: flex-end;
}

.qc-report-card-full {
    border-width: 1px;
}

.qc-report-card-compact {
    width: 100%;
    border-width: 1px;
}

.qc-report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.qc-report-meta {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.qc-report-card-copy {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.qc-report-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.qc-report-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.9rem;
}

.qc-report-result {
    display: inline-block;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.qc-report-empty-note {
    margin: 0;
    color: var(--text-muted);
    font-style: italic;
}

.qc-report-comment-box {
    min-height: 8.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid #d8dee8;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
}

.qc-report-comment-box.is-empty {
    color: #94a3b8;
    font-style: italic;
}

.qc-detail-top-grid,
.qc-detail-bottom-grid {
    display: grid;
    gap: 2rem;
    align-items: stretch;
}

.qc-detail-top-grid {
    grid-template-columns: minmax(0, 4fr) minmax(320px, 1.35fr);
}

.qc-detail-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qc-comment-feed-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.qc-comment-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.qc-comment-feed-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.qc-comment-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 34rem;
    overflow: auto;
    padding-right: 0.2rem;
}

.qc-comment-entry {
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.qc-comment-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.qc-comment-entry-context {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.qc-comment-entry-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qc-comment-entry-meta {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: #64748b;
}

.qc-comment-entry-body {
    color: #334155;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.qc-comment-feed-empty {
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    color: #94a3b8;
    text-align: center;
}

.qc-comment-feed-empty i {
    font-size: 1.8rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1180px) {
    .qc-detail-hero,
    .qc-detail-top-grid,
    .qc-detail-bottom-grid {
        grid-template-columns: 1fr;
    }

    .qc-detail-hero-side {
        align-items: stretch;
    }

    .qc-detail-status-pill {
        align-self: flex-start;
    }

    .qc-comment-feed-list {
        max-height: none;
    }
}

/* Evidence Management in Modal */
.evidence-item-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.evidence-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    animation: slideDown 0.3s ease-out;
}

.evidence-item-name {
    color: var(--text-main);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.evidence-item-name i {
    color: var(--accent);
}

.evidence-item-remove {
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.evidence-item-remove:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

/* Mobile Friendly Adjustments */
@media (max-width: 768px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* QC Table Styles */
.table-container {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
}

.qc-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.qc-table th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

.qc-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--primary);
    vertical-align: middle;
}

.qc-table tr {
    transition: all 0.2s;
    cursor: pointer;
}

.qc-table tr:hover {
    background: #f1f5f9;
}

.qc-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    white-space: nowrap;
}

.project-cell {
    font-weight: 600;
}

.supplier-cell {
    color: var(--text-muted);
}

.inspector-cell i,
.date-cell i {
    color: var(--accent);
    margin-right: 0.5rem;
}

.unassigned {
    color: #f59e0b;
    font-style: italic;
}

.qc-filter-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.qc-folder-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    padding: 0.3rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.qc-folder-btn {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qc-folder-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 16px rgba(15, 39, 66, 0.15);
}

.qc-folder-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.qc-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.qc-dashboard-toolbar {
    display: flex;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.qc-toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 180px;
    flex: 1 1 180px;
}

.qc-toolbar-field label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.qc-toolbar-field input,
.qc-toolbar-field select {
    width: 100%;
    min-height: 42px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-main);
    font: inherit;
}

.qc-status-multiselect {
    position: relative;
}

.qc-status-multiselect summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    min-height: 42px;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

.qc-status-multiselect summary::-webkit-details-marker {
    display: none;
}

.qc-status-multiselect[open] summary {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

.qc-status-multiselect-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.qc-status-clear-btn {
    border: none;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    padding: 0;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.qc-status-options {
    display: grid;
    gap: 0.6rem;
    max-height: 16rem;
    overflow: auto;
}

.qc-status-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.92rem;
    color: var(--text-main);
}

.qc-status-option input {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

.qc-toolbar-search {
    flex: 2 1 280px;
}

.qc-toolbar-field-hidden {
    display: none;
}

.qc-filter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.qc-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qc-filter-tag,
.qc-data-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #eef6ff;
    color: #1e3a5f;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.qc-filter-rollout-note,
.qc-inline-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.qc-inline-note {
    max-width: 320px;
    text-align: right;
}

.qc-toolbar-actions {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    margin-left: auto;
}

.qc-table-shell {
    overflow-x: auto;
}

.qc-archive-cell-note {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f766e;
}

.shipment-cell {
    min-width: 180px;
}

.qc-empty-value {
    color: var(--text-muted);
    font-style: italic;
}

.qc-order-secondary {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.qc-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.qc-pagination-summary {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.qc-pagination-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.qc-pagination-page {
    min-width: 7rem;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

.qc-detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

@media (max-width: 768px) {
    .qc-filter-shell,
    .qc-dashboard-toolbar {
        padding: 1rem;
    }

    .qc-filter-grid {
        grid-template-columns: 1fr;
    }

    .qc-toolbar-field,
    .qc-toolbar-search {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .qc-folder-switch {
        width: 100%;
        justify-content: space-between;
    }

    .qc-folder-btn {
        flex: 1 1 0;
    }

    .qc-filter-footer {
        align-items: stretch;
    }

    .qc-inline-note {
        max-width: none;
        text-align: left;
    }

    .qc-toolbar-actions {
        width: 100%;
        margin-left: 0;
    }

    .qc-pagination {
        align-items: stretch;
    }

    .qc-pagination-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Result Selection Bar */
.result-selection-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 12px;
}

.result-option {
    flex: 1;
    cursor: pointer;
}

.result-option input {
    display: none;
}

.result-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #64748b;
    transition: all 0.2s;
    background: transparent;
}

.result-option input:checked+.result-chip.chip-pass {
    background: #10b981;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
}

.result-option input:checked+.result-chip.chip-conditional {
    background: #f59e0b;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.4);
}

.result-option input:checked+.result-chip.chip-fail {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
}

.result-option:hover .result-chip {
    background: rgba(15, 23, 42, 0.05);
}

.result-option input:checked+.result-chip {
    transform: scale(1.02);
}

/* Inspector Selection Modal Styles */
.inspector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.inspector-card {
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.inspector-card:hover {
    border-color: var(--secondary);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.1);
}

.inspector-card.selected {
    border-color: var(--accent);
    background: #eff6ff;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.inspector-avatar {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent);
    font-size: 1.5rem;
    transition: all 0.2s;
}

.inspector-card:hover .inspector-avatar {
    background: var(--accent);
    color: white;
}

.inspector-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.inspector-email {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.inspector-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    background: #e2e8f0;
    color: #475569;
    padding: 4px 10px;
    border-radius: 20px;
}

.inspector-card.selected .inspector-badge {
    background: var(--accent);
    color: white;
}

.selection-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--accent);
    font-size: 1.25rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.inspector-card.selected .selection-indicator {
    opacity: 1;
    transform: scale(1);
}

/* Admin Analytics Styles */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.analytics-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.analytics-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#element-clicks-chart-container,
#page-views-chart-container {
    height: 300px;
    width: 100%;
}

/* Footer Styles */
.site-footer {
    background: var(--primary);
    color: #e2e8f0;
    padding: 2rem 2rem;
    margin-top: 2rem;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo {
    height: 32px;
    filter: brightness(0) invert(1);
}

.footer-copyright {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.footer-imprint-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-imprint-link:hover {
    color: white;
}

.footer-tagline {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    align-items: center;
}

.footer-column h4 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 0.75rem;
    color: #94a3b8;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-column ul li i {
    color: var(--accent);
    width: 16px;
}

.footer-column ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-column ul li a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    color: #64748b;
    font-size: 0.9rem;
}

/* Imprint Page Styles */
.imprint-section {
    padding: 4rem 2rem;
}

.imprint-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.imprint-block h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.imprint-block p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* Spec Alignment View - New 3-Pane Layout */
.spec-three-pane-layout {
    display: flex;
    gap: 0.5rem;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 0;
    background: #f1f5f9;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    align-items: stretch;
    flex: 1;
}

/* Common Pane Styles */
.doc-pane,
.chat-pane,
.ai-pane {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.doc-pane {
    flex: 0 0 clamp(420px, 37vw, 675px);
    min-width: 420px;
    max-width: none;
}

@media (max-width: 1024px) {
    .doc-pane {
        flex: 0 0 clamp(300px, 40vw, 420px);
        min-width: 300px;
    }
}

.resizer-v {
    width: 4px;
    background: var(--border);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.2s, width 0.2s;
    position: relative;
    z-index: 10;
}

.resizer-v:hover,
.resizer-v.dragging {
    background: var(--accent);
    width: 6px;
}

.resizer-v::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -4px;
    right: -4px;
}

.chat-pane {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.ai-pane {
    flex: 0 0 240px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: right;
}

.ai-pane.collapsed {
    flex: 0 0 48px;
    min-width: 48px;
    max-width: 48px;
}

.ai-pane.collapsed .messages-area,
.ai-pane.collapsed .input-container,
.ai-pane.collapsed .pane-header h3 {
    display: none;
}

.ai-pane.collapsed .pane-header {
    padding: 1rem 0;
    justify-content: center;
}

.toggle-ai-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    border-radius: 4px;
}

.ai-pane.collapsed .toggle-ai-btn {
    transform: rotate(180deg);
}

.pane-header,
.block-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    flex-shrink: 0;
}

.pane-header h3,
.block-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pane-header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0 0;
}

.messages-area,
.wiki-container,
.checklist-container,
.files-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Documentation Pane Blocks */
.doc-block {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    /* Allow natural sizing when expanded */
}

.doc-block:not(.collapsed) {
    flex: 1;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.resizer {
    height: 6px;
    background: var(--border);
    cursor: row-resize;
    flex-shrink: 0;
    transition: background 0.2s, height 0.2s;
    position: relative;
    z-index: 10;
}

.resizer:hover,
.resizer.dragging {
    background: var(--accent);
    height: 8px;
}

.resizer::after {
    content: '';
    position: absolute;
    top: -5px;
    bottom: -5px;
    left: 0;
    right: 0;
}

.doc-block.collapsed {
    flex: 0 0 auto;
    /* Shrink to header only when collapsed */
}

.files-block {
    border-bottom: none;
}

/* Wiki Styles - "Wikipedia-like" */
.wiki-term {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

/* Hierarchical Wiki Styles */
.wiki-container {
    padding: 1rem !important;
    font-size: 0.9rem;
}

.wiki-category {
    margin-bottom: 0.75rem;
}

.wiki-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.wiki-category-header i {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.wiki-category-content {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
}

.wiki-category-content.hidden {
    display: none;
}

.wiki-term {
    padding-left: 1.25rem;
    position: relative;
}

.wiki-term-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    cursor: pointer;
    color: #3366cc;
    /* Wikipedia Blue */
    padding: 0.2rem 0;
    font-weight: 400;
}

.wiki-term-header i {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.wiki-term-header:hover {
    text-decoration: underline;
}

.wiki-term-content {
    margin: 0.25rem 0 0.5rem 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-left: 2px solid #3366cc;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.5;
}

.wiki-term-content.hidden {
    display: none;
}

/* Checklist Styles - Voting */
.checklist-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist-item-title {
    font-weight: 600;
    font-size: 0.85rem;
}

.voting-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.vote-side {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.vote-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.vote-buttons {
    display: flex;
    gap: 0.25rem;
}

.vote-btn {
    flex: 1;
    padding: 4px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.vote-btn:hover {
    background: #f1f5f9;
}

.vote-btn.approve.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.vote-btn.decline.active {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Files List Styles */
.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--primary);
}

.file-item:hover {
    background: #f1f5f9;
}

.file-item i {
    color: var(--accent);
}

/* Chat Input & Mentions */
.input-container {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    background: white;
    position: relative;
}

.spec-quote-preview {
    margin-bottom: 0.7rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.spec-quote-preview-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid #dbe4ef;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.spec-quote-preview-close:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.conversation-quote-card {
    border-left: 3px solid #60a5fa;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    min-width: 0;
}

.conversation-quote-card.is-preview {
    flex: 1;
}

.conversation-quote-meta {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}

.conversation-quote-title {
    margin-top: 0.18rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.conversation-quote-excerpt {
    margin-top: 0.22rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #334155;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.25rem;
    font-family: inherit;
    font-size: 0.85rem;
    resize: none;
    outline: none;
    min-height: 36px;
    max-height: 150px;
    line-height: 1.4;
}

.attach-btn,
.send-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    display: flex;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.attach-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.send-btn {
    background: var(--accent);
    color: white;
    border-radius: var(--radius-sm);
}

.send-btn:hover {
    background: var(--primary);
}

.mention-suggestions {
    position: absolute;
    bottom: 100%;
    left: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.mention-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.mention-item:hover {
    background: #f1f5f9;
}

.mention-item .wiki-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Messages Styling */
.supplier-message,
.ai-message {
    max-width: 85%;
    align-self: flex-start;
    margin-bottom: 1rem;
}

.supplier-user-message,
.user-message {
    max-width: 85%;
    align-self: flex-end;
    margin-bottom: 1rem;
}

.supplier-message-content,
.ai-message-content {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 16px 16px 16px 0;
    position: relative;
}

.supplier-message-content p,
.ai-message-content p {
    margin: 0;
    line-height: 1.5;
}

.supplier-user-message .supplier-message-content {
    background: var(--primary);
    color: white;
    border-radius: 16px 16px 0 16px;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
    display: block;
}

.supplier-user-message .message-sender {
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
}

.message-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    display: block;
}

.mention-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Settings View Styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.settings-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.settings-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.settings-role-card {
    background: linear-gradient(135deg, #f8fffc 0%, #ffffff 55%, #f0fdf4 100%);
}

.settings-role-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-role-current {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-role-current-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-role-current strong {
    font-size: 1.2rem;
    color: var(--primary);
}

.settings-dashboard-role-switch {
    margin-top: 0;
    padding: 0.25rem;
    border-color: rgba(15, 23, 42, 0.08);
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.08);
}

.settings-dashboard-role-switch .dashboard-role-btn {
    color: #166534;
}

.settings-dashboard-role-switch .dashboard-role-btn.active {
    background: #166534;
    color: #ffffff;
}

.settings-role-helper {
    margin: 1rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.settings-controls {
    margin-bottom: 1.5rem;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.settings-item-info {
    flex: 1;
}

.settings-item-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

.settings-item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.settings-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.btn-icon-danger {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: opacity 0.2s;
}

.btn-icon-danger:hover {
    opacity: 0.7;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Advanced Settings Layout */
.settings-advanced-layout {
    display: grid;
    grid-template-columns: 25% 35% 40%;
    gap: 1.5rem;
    height: 600px;
    margin-top: 1.5rem;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.current-context {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
}

.w-100 {
    width: 100%;
}

.settings-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-item:hover,
.settings-item.active {
    border-color: var(--accent);
    background: #eff6ff;
}

.settings-item .actions {
    display: none;
    gap: 0.25rem;
}

.settings-item:hover .actions {
    display: flex;
}

.settings-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}

.btn-icon-primary {
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
}

.btn-icon-danger {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
}

/* Wiki Preview Box */
.wiki-preview-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    height: 100%;
    overflow-y: auto;
    max-height: 540px;
}

.preview-card {
    display: flex;
    flex-direction: column;
}

/* Wiki Editor Modal (Email-like) */
.wiki-editor-content {
    max-width: 800px !important;
    width: 90% !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 600px !important;
}

.wiki-editor-body {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.editor-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.editor-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.editor-field input,
.editor-field select,
.editor-field textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.editor-field input:focus,
.editor-field textarea:focus {
    border-color: var(--accent);
}

.editor-field textarea {
    min-height: 250px;
    resize: none;
}

.full-height {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.full-height textarea {
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #f8fafc;
}

.empty-state-small {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 2rem;
}

/* Wiki Modal Styles */
.wiki-modal {
    max-width: 550px;
}

.wiki-modal .form-group {
    margin-bottom: 1.25rem;
}

.wiki-modal .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.wiki-modal .form-group input,
.wiki-modal .form-group select,
.wiki-modal .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.wiki-modal .form-group input:focus,
.wiki-modal .form-group select:focus,
.wiki-modal .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.wiki-modal .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.wiki-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Wiki Hierarchy Editor Styles */
.wiki-hierarchy-editor {
    margin-top: 1.5rem;
}

.wiki-category-section {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.wiki-category-header-edit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-info i {
    color: var(--accent);
    font-size: 1rem;
}

.category-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

.category-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.category-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.wiki-category-header-edit:hover .category-actions {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--border);
    color: var(--primary);
}

.btn-icon-danger {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    background: #fee2e2;
    color: #ef4444;
}

.wiki-terms-list {
    padding: 0.5rem;
}

.wiki-term-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.wiki-term-item:last-child {
    margin-bottom: 0;
}

.wiki-term-item:hover {
    border-color: var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.term-info {
    flex: 1;
    min-width: 0;
}

.term-title {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.95rem;
}

.term-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.5rem 0 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.term-source {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.term-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.wiki-term-item:hover .term-actions {
    opacity: 1;
}

/* Wiki Preview in Chat */
.wiki-preview-message {
    padding: 0.5rem 0;
}

.wiki-preview-message h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-category {
    margin-bottom: 0.5rem;
}

/* Settings Controls Enhancement */
.settings-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.wiki-management-card {
    grid-column: 1 / -1;
}

.checklist-management-card {
    grid-column: 1 / -1;
}

/* Checklist Item Header and Content (Spec Alignment View) */
.checklist-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
    color: var(--primary);
    font-weight: 600;
}

.checklist-item-header:hover {
    color: var(--accent);
}

.checklist-item-header i {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.checklist-item-content {
    margin: 0.25rem 0 0.5rem 1.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-left: 2px solid var(--accent);
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.5;
}

.checklist-item-content.hidden {
    display: none;
}

.checklist-item-description {
    margin: 0 0 0.5rem 0;
    color: var(--text-muted);
}

/* Sign-off Proposal Card (Chat) */
.signoff-proposal {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0.5rem 0;
}

.proposal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.proposal-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--primary);
}

.proposal-content p {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
}

.proposal-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.proposal-meta span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.proposal-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.proposal-accepted {
    color: #10b981;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.proposal-rejected {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Foldable Side Blocks */
.doc-block .block-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    user-select: none;
    padding-right: 0.5rem;
    /* Add some space for the icon */
}

.doc-block .block-header:hover {
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-sm);
}

.doc-block .toggle-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.doc-block.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.doc-block .block-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
}

.doc-block.collapsed .block-content {
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
    flex: 0;
}

/* Greeting Settings */
.greeting-management-card {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .greeting-management-card {
        grid-column: span 1;
    }
}

/* =====================================================
   CHECKLIST STATUS GROUPS - New Design
   ===================================================== */

.checklist-status-group {
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.checklist-status-group.status-warning {
    border-left: 4px solid #f59e0b;
}

.checklist-status-group.status-success {
    border-left: 4px solid #10b981;
}

.checklist-status-group.status-danger {
    border-left: 4px solid #ef4444;
}

.checklist-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-body);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.checklist-group-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.checklist-group-header i:first-child {
    font-size: 1rem;
}

.checklist-status-group.status-warning .checklist-group-header i:first-child {
    color: #f59e0b;
}

.checklist-status-group.status-success .checklist-group-header i:first-child {
    color: #10b981;
}

.checklist-status-group.status-danger .checklist-group-header i:first-child {
    color: #ef4444;
}

.checklist-group-header span:first-of-type {
    font-weight: 600;
    color: var(--text-main);
}

.group-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.checklist-group-header .toggle-icon {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.checklist-group-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.checklist-group-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.checklist-group-content.hidden {
    display: none;
}

.checklist-item {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

.checklist-item:first-child {
    border-top: none;
}

.checklist-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
}

.checklist-item-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.checklist-item-main i {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.checklist-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checklist-vote-summary {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.checklist-item-content {
    padding: 0.75rem 0 0.5rem 1.25rem;
}

.checklist-item-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.checklist-item-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   CHAT VOTING CARDS
   ===================================================== */

.signoff-voting-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0.5rem 0;
}

.voting-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #334155 100%);
    color: white;
}

.voting-card-header i {
    font-size: 1rem;
}

.voting-card-content {
    padding: 1rem;
}

.voting-card-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.voting-card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.voting-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.voting-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.voting-card-status {
    display: flex;
    gap: 1.5rem;
    padding: 0.6rem 1rem;
    background: white;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.vote-status-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.vote-status-item {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

.voting-card-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vote-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vote-section-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    min-width: 70px;
}

.vote-btn-chat {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.vote-btn-chat.approve {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.vote-btn-chat.approve:hover {
    background: #bbf7d0;
}

.vote-btn-chat.approve.active {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.vote-btn-chat.decline {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.vote-btn-chat.decline:hover {
    background: #fee2e2;
}

.vote-btn-chat.decline.active {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* =====================================================
   GAMIFICATION - Agreement Progress Dashboard
   ===================================================== */

.agreement-dashboard {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.dashboard-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-title i {
    color: #3b82f6;
}

.dashboard-level {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: levelPulse 2s ease-in-out infinite;
}

@keyframes levelPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}

/* Fallback color if gradient not supported */
.progress-ring-fill {
    stroke: #10b981;
}

.progress-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percent {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.progress-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-item.agreed {
    color: #10b981;
}

.stat-item.pending {
    color: #f59e0b;
}

.progress-message {
    text-align: center;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.progress-message i {
    color: #3b82f6;
}

.progress-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.progress-message.success i {
    color: #34d399;
}

.streak-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(239, 68, 68, 0.2) 100%);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: #f97316;
    animation: streakGlow 1.5s ease-in-out infinite;
}

.streak-counter.hidden {
    display: none;
}

.streak-counter i {
    color: #ef4444;
    animation: fireFlicker 0.5s ease-in-out infinite;
}

@keyframes streakGlow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
    }
}

@keyframes fireFlicker {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* =====================================================
   GAMIFICATION - Onboarding Tip
   ===================================================== */

.onboarding-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: var(--radius-md);
    padding: 0.85rem;
    margin-bottom: 1rem;
    position: relative;
    animation: tipSlideIn 0.5s ease-out;
}

.onboarding-tip.hidden {
    display: none;
}

@keyframes tipSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tip-icon {
    background: #f59e0b;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: tipPulse 2s ease-in-out infinite;
}

@keyframes tipPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

.tip-content {
    flex: 1;
}

.tip-content strong {
    display: block;
    color: #92400e;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.tip-content p {
    font-size: 0.8rem;
    color: #78350f;
    margin: 0;
    line-height: 1.4;
}

.tip-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
}

.tip-dismiss {
    background: none;
    border: none;
    color: #92400e;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tip-dismiss:hover {
    opacity: 1;
}

/* =====================================================
   GAMIFICATION - Celebration Effects
   ===================================================== */

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-in-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Success flash on items */
.checklist-item.just-agreed {
    animation: successFlash 0.6s ease-out;
}

@keyframes successFlash {
    0% {
        background: rgba(16, 185, 129, 0.4);
        transform: scale(1.02);
    }

    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* Voting button enhancements */
.vote-btn-chat {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vote-btn-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vote-btn-chat:active {
    transform: translateY(0) scale(0.95);
}

.vote-btn-chat.approve.active {
    animation: voteSuccess 0.4s ease-out;
}

.vote-btn-chat.decline.active {
    animation: voteDecline 0.4s ease-out;
}

@keyframes voteSuccess {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes voteDecline {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.9);
        background: #dc2626;
    }

    100% {
        transform: scale(1);
    }
}

/* Achievement Toast */
.achievement-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10001;
    animation: toastSlideUp 0.5s ease-out forwards;
}

.achievement-toast.hidden {
    display: none;
}

@keyframes toastSlideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.achievement-toast i {
    font-size: 1.5rem;
}

.achievement-toast .toast-text {
    font-weight: 600;
}

/* Enhanced voting card in chat */
.signoff-voting-card {
    animation: cardAppear 0.4s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.voting-card-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* Pulsing attention indicator for pending votes */
.vote-section-label::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
    margin-left: 0.5rem;
    animation: pendingPulse 1.5s ease-in-out infinite;
}

.vote-section.voted .vote-section-label::after {
    display: none;
}

@keyframes pendingPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* =====================================================
   SPEC THREE-PANE LAYOUT
   ===================================================== */

.spec-three-pane-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

/* =====================================================
   IDE-STYLE SIDEBAR
   ===================================================== */

.doc-pane.ide-sidebar {
    display: flex;
    flex-direction: row-reverse;
    padding: 0;
    gap: 0;
    background: var(--surface);
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

/* Vertical Icon Tab Bar */
.sidebar-tabs {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    padding: 0.5rem 0;
    width: 48px;
    flex-shrink: 0;
    height: 100%;
}

.tabs-top,
.tabs-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.sidebar-tab:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-tab.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.sidebar-tab.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #3b82f6;
    border-radius: 3px 0 0 3px;
}

.sidebar-tab i {
    font-size: 1.25rem;
}

/* Tab Badge */
.tab-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #f59e0b;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.tab-badge:empty,
.tab-badge[data-count="0"] {
    display: none;
}

/* Sidebar Content Area */
.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

/* Sidebar Panels */
.sidebar-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    min-height: 0;
    flex: 1 1 auto;
}

.sidebar-panel.active {
    display: flex;
}

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.panel-header h3 i {
    color: #3b82f6;
}

.panel-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.panel-action-btn {
    background: #3b82f6;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.panel-action-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.checklist-table-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem;
    border-radius: 999px;
    background: #e2e8f0;
}

.checklist-table-switch-btn {
    border: none;
    background: transparent;
    color: #475569;
    border-radius: 999px;
    padding: 0.32rem 0.72rem;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.checklist-table-switch-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.checklist-table-switch-count {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0 0.3rem;
}

.checklist-translate-group {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.checklist-translate-btn {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.checklist-translate-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.checklist-translate-btn.active {
    border-color: var(--accent);
    background: rgba(193, 127, 89, 0.08);
    color: var(--accent);
}

.checklist-translate-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Panel Body - Scrollable */
.panel-body {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    min-height: 0;
}

/* Custom scrollbar for panel body */
.panel-body::-webkit-scrollbar {
    width: 6px;
}

.panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Adjust agreement dashboard for panel */
.sidebar-panel .agreement-dashboard {
    margin-bottom: 1rem;
}

/* Files list in panel */
.panel-body.files-list {
    padding: 0.5rem;
}

.panel-body.files-list .file-item {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-body.files-list .file-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.panel-body.files-list .file-item i {
    color: #3b82f6;
}

/* Checklist items in panel */
#panel-checklist {
    min-height: 0;
}

.panel-body#checklist-container {
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* The wide checklist table can scroll horizontally within the scrollable body */
.checklist-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    min-width: 0;
}

.panel-body#checklist-container .checklist-status-group {
    margin-bottom: 0.5rem;
}

.panel-body#checklist-container .checklist-group-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

/* =====================================================
   SPEC LEFT SIDEBAR — Horizontal Tabs at Top
   ===================================================== */

.doc-pane.ide-sidebar.spec-left-sidebar {
    display: flex;
    flex-direction: column;
    /* No vertical tab bar; tabs are horizontal at top */
    height: 100%;
    max-height: 100%;
    min-height: 0;
    background: white;
    /* Match chat window background */
}

/* Hide the old vertical tab bar in this sidebar */
.spec-left-sidebar>.sidebar-tabs {
    display: none;
}

.spec-left-sidebar .sidebar-content {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.spec-left-sidebar .panel-header {
    margin-bottom: 0;
}

.spec-left-sidebar .sidebar-panel {
    height: 100%;
    flex: 1;
    overflow: hidden;
}

/* Horizontal Tab Bar */
.sidebar-tabs-horizontal {
    display: flex;
    align-items: center;
    gap: 0;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    flex-shrink: 0;
    padding: 0;
    height: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-htab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0 0.75rem;
    height: 100%;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-htab i {
    font-size: 0.8rem;
}

.sidebar-htab span {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.sidebar-htab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-htab.active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.sidebar-htab .tab-badge {
    position: static;
    background: #f59e0b;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    margin-left: 0.15rem;
}

.sidebar-htab .tab-badge:empty,
.sidebar-htab .tab-badge[data-count="0"] {
    display: none;
}

/* Back to Project button — align right, subtle style */
.sidebar-htab.back-btn {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.65rem;
    padding: 0 0.6rem;
}

.sidebar-htab.back-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-htab.back-btn i {
    font-size: 0.7rem;
}

/* Instructions bar — now sits in chat pane */
.signoff-instructions {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.signoff-instructions:empty {
    display: none;
}

.signoff-instructions .instruction-role {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.signoff-instructions .instruction-role.buyer {
    background: #dbeafe;
    color: #1e40af;
}

.signoff-instructions .instruction-role.supplier {
    background: #dcfce7;
    color: #166534;
}

.signoff-instructions .instruction-text {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
}

.signoff-instructions .instruction-text i {
    color: #3b82f6;
    margin-right: 0.2rem;
    font-size: 0.7rem;
}

/* ── Spec Alignment Sidebar Panel Layout — reinforces rules at ~7177 ── */
.sidebar-content {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-panel {
    display: none;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.sidebar-panel.active {
    display: flex;
}

.panel-body {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}


/* Sign-off Action Bar */
.signoff-action-bar {
    padding: 0.6rem 0.75rem;

    border-top: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.wechat-sync-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.wechat-sync-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 100%);
    border: 1px solid #bbf7d0;
}

.wechat-sync-hero-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #16a34a 0%, #0f766e 100%);
    color: #ffffff;
    font-size: 1.25rem;
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.16);
}

.wechat-sync-hero-copy h4 {
    margin: 0;
    font-size: 0.96rem;
    color: var(--primary);
}

.wechat-sync-hero-copy p {
    margin: 0.28rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.wechat-sync-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.wechat-sync-status-pill.is-linked {
    background: #dcfce7;
    color: #166534;
}

.wechat-sync-status-pill.is-pending {
    background: #fef3c7;
    color: #92400e;
}

.wechat-sync-status-pill.is-idle {
    background: #e2e8f0;
    color: #475569;
}

.wechat-sync-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    padding: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.wechat-sync-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.wechat-sync-section-head {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.wechat-sync-section-head strong {
    color: var(--text-main);
}

.wechat-sync-section-head span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.wechat-sync-inline-note {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.wechat-sync-inline-code {
    display: inline-block;
    max-width: 220px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    white-space: normal;
    word-break: break-all;
    color: #0f172a;
}

.wechat-sync-summary,
.wechat-sync-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.wechat-sync-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.wechat-sync-meta-row strong {
    color: var(--text-main);
}

.wechat-sync-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.wechat-sync-actions .btn-primary,
.wechat-sync-actions .btn-outline {
    justify-content: center;
}

.wechat-sync-note {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.8rem;
    line-height: 1.5;
}

.wechat-sync-note.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.wechat-sync-setup {
    display: grid;
    gap: 0.75rem;
}

.wechat-sync-setup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.wechat-sync-setup-list {
    display: grid;
    gap: 0.6rem;
}

.wechat-sync-setup-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
}

.wechat-sync-setup-item i {
    margin-top: 0.15rem;
}

.wechat-sync-setup-item.is-ready i {
    color: #15803d;
}

.wechat-sync-setup-item.is-missing i {
    color: #d97706;
}

.wechat-sync-setup-webhook {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    display: grid;
    gap: 0.4rem;
}

.wechat-sync-setup-webhook span {
    font-size: 0.74rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wechat-sync-setup-webhook code {
    display: block;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 0.76rem;
    line-height: 1.5;
    word-break: break-all;
    white-space: normal;
}

.wechat-sync-qr-card {
    margin-top: 0.2rem;
    align-items: center;
    text-align: center;
}

.wechat-sync-qr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.wechat-sync-qr-shell {
    width: 204px;
    max-width: 100%;
    padding: 0.9rem;
    border-radius: 20px;
    background: radial-gradient(circle at top, rgba(34, 197, 94, 0.12), rgba(15, 23, 42, 0.02));
    border: 1px solid #dcfce7;
    margin: 0 auto;
}

.wechat-sync-qr-preview-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 12px;
    cursor: zoom-in;
}

.wechat-sync-qr-preview-button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 4px;
}

.wechat-sync-qr-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #ffffff;
}

.wechat-sync-qr-card-wecom .wechat-sync-qr-shell {
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.03));
    border-color: #bfdbfe;
}

.wechat-sync-qr-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #ffffff;
}

.wechat-sync-dynamic-qr.is-fallback .wechat-sync-qr-canvas {
    display: none;
}

.wechat-sync-qr-fallback-link {
    display: inline-flex;
    width: 100%;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.wechat-sync-qr-fallback-link[hidden] {
    display: none;
}

.wechat-sync-qr-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.wechat-sync-qr-card-wecom .wechat-sync-qr-meta {
    max-width: 320px;
}

.wechat-sync-qr-card-wecom {
    display: grid;
    gap: 0.45rem;
    align-content: start;
    margin-top: 0;
}

.wechat-sync-qr-card-wecom .wechat-sync-qr-shell {
    width: min(174px, 100%);
    padding: 0.65rem;
}

.wechat-sync-qr-card-wecom .wechat-sync-qr-meta {
    gap: 0.22rem;
    font-size: 0.76rem;
    max-width: 240px;
    margin: 0 auto;
}

@media (max-width: 720px) {
    .wechat-sync-qr-grid {
        grid-template-columns: 1fr;
    }

    .wechat-sync-qr-card-wecom .wechat-sync-qr-shell {
        width: min(204px, 100%);
    }
}

.wechat-sync-empty {
    min-height: 220px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    text-align: center;
    color: var(--text-muted);
    padding: 1.2rem;
}

.wechat-sync-empty i {
    font-size: 2rem;
    color: #16a34a;
}

.price-payment-layout {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0.9rem;
}

.price-payment-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    padding: 0.95rem;
}

.price-payment-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.price-payment-card-head h4 {
    margin: 0;
    font-size: 0.96rem;
    color: var(--primary);
}

.price-payment-card-head p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.price-payment-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.price-payment-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
    white-space: nowrap;
}

.price-payment-pill.success {
    background: #dcfce7;
    color: #166534;
}

.price-payment-pill.warning {
    background: #fef3c7;
    color: #92400e;
}

.price-payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.price-payment-summary-field,
.price-payment-summary-metric {
    border: 1px solid #dbe7ef;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0.75rem;
}

.price-payment-summary-field span,
.price-payment-summary-metric span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.price-payment-summary-metric strong {
    font-size: 1rem;
    color: var(--primary);
}

.price-payment-summary-metric-total {
    background: linear-gradient(135deg, #ecfeff 0%, #f0fdf4 100%);
    border-color: #bae6fd;
}

.price-payment-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.6rem 0.7rem;
    font-size: 0.88rem;
    background: white;
    color: var(--primary);
}

.price-payment-input:disabled {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.price-payment-table-scroll {
    overflow-x: auto;
}

.price-payment-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.price-payment-table th,
.price-payment-table td {
    padding: 0.75rem 0.6rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.price-payment-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.price-payment-item-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.55rem;
    margin-bottom: 0.55rem;
    font-size: 0.74rem;
    color: #64748b;
}

.price-payment-item-meta label {
    font-weight: 700;
}

.price-payment-notes-input,
.price-payment-term-proposal,
.price-payment-summary-note {
    resize: vertical;
    min-height: 74px;
}

.price-payment-row-total {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.price-payment-term-label {
    min-width: 130px;
    font-weight: 700;
    color: var(--primary);
}

.price-payment-approval-buttons {
    display: inline-flex;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.price-payment-approval-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.price-payment-approval-btn.active {
    border-color: #16a34a;
    background: #dcfce7;
    color: #166534;
}

.price-payment-approval-btn.reject.active {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

.price-payment-approval-status {
    font-size: 0.78rem;
    color: #64748b;
}

.price-payment-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.price-payment-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.price-payment-footer-meta {
    font-size: 0.76rem;
    color: #64748b;
}

.payment-instruction-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.payment-instruction-card-list.compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.payment-instruction-card {
    border: 1px solid #d8e4ef;
    border-radius: 16px;
    background: #fff;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.payment-instruction-card.pending {
    background: #f8fafc;
}

.payment-instruction-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.payment-instruction-card-head h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary);
}

.payment-instruction-card-head p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    line-height: 1.45;
}

.payment-instruction-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem 0.9rem;
}

.payment-instruction-details dt {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.payment-instruction-details dd {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    word-break: break-word;
}

.payment-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.payment-status-badge.neutral {
    background: #e2e8f0;
    color: #475569;
}

.payment-status-badge.success {
    background: #dcfce7;
    color: #166534;
}

.payment-status-badge.warning {
    background: #fef3c7;
    color: #92400e;
}

.payment-status-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.price-payment-empty-state,
.price-payment-loading {
    padding: 1rem;
    color: #64748b;
    font-size: 0.85rem;
}

.price-payment-loading {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.order-execution-shell {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.order-execution-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.4rem 1.5rem;
    border: 1px solid #d4e4ee;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(31, 119, 153, 0.14), transparent 32%),
        radial-gradient(circle at bottom left, rgba(63, 182, 114, 0.12), transparent 26%),
        linear-gradient(135deg, #f8fcff 0%, #eef5fb 100%);
}

.order-execution-overline {
    display: inline-block;
    margin-bottom: 0.4rem;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1f6b8c;
}

.order-execution-hero h2 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary);
}

.order-execution-hero p {
    margin: 0.45rem 0 0;
    max-width: 720px;
    color: var(--text-muted);
    line-height: 1.55;
}

.order-execution-hero-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.order-execution-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.order-execution-order-card {
    border: 1px solid #d7e4ec;
    border-radius: 18px;
    background: #fff;
    padding: 1rem 1.05rem;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.order-execution-order-card:hover {
    transform: translateY(-2px);
    border-color: #97bfd3;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.order-execution-order-card.active {
    border-color: #1f6b8c;
    background: linear-gradient(135deg, #f6fbff 0%, #eef7ff 100%);
    box-shadow: 0 16px 36px rgba(31, 107, 140, 0.16);
}

.order-execution-order-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}

.order-execution-order-card-ref {
    font-size: 0.76rem;
    font-weight: 700;
    color: #1f6b8c;
}

.order-execution-order-card-status {
    font-size: 0.7rem;
    font-weight: 700;
    color: #5b6578;
    background: #edf2f7;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
}

.order-execution-order-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.order-execution-order-card-meta {
    margin-top: 0.2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.order-execution-order-card-total {
    margin-top: 0.9rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f5c78;
}

.order-execution-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.order-execution-detail-card,
.order-execution-status-card {
    padding: 1.4rem;
}

.order-execution-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.order-execution-card-head h3 {
    margin: 0;
    color: var(--primary);
}

.order-execution-card-head p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.order-execution-metadata {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.order-execution-metadata-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: #eef4f8;
    color: #526073;
    font-size: 0.76rem;
    font-weight: 700;
}

.order-execution-inline-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.95rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid #dbe7ef;
    background: #f8fbfe;
    color: #526073;
    font-size: 0.84rem;
}

.order-execution-inline-banner.loading {
    color: #1f6b8c;
}

.order-execution-table-scroll {
    overflow-x: auto;
}

.order-execution-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    border-radius: 18px;
    overflow: hidden;
}

.order-execution-table th,
.order-execution-table td {
    padding: 0.95rem 0.85rem;
    border: 1px solid #e2e8f0;
    vertical-align: top;
}

.order-execution-table th {
    background: #1f6b8c;
    color: #fff;
    font-size: 0.78rem;
    text-align: left;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.order-execution-summary-row td {
    background: #eef3f8;
}

.order-execution-installment-row td {
    background: #f8fafc;
}

.order-execution-cell-primary {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.45;
}

.order-execution-cell-meta {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.order-execution-note-card {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid #dbe7ef;
    background: linear-gradient(135deg, #f9fbfd 0%, #f2f7fb 100%);
}

.order-execution-note-card p {
    margin: 0.35rem 0 0;
    color: var(--primary);
    line-height: 1.55;
}

.order-execution-note-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.order-execution-installment-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
}

.order-execution-status-panel {
    border: 1px solid #bfd4e2;
    border-radius: 28px;
    background: linear-gradient(180deg, #eef5fb 0%, #e8f1fa 100%);
    padding: 1rem;
}

.order-execution-status-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.order-execution-status-ribbon-arrow {
    width: 0;
    height: 0;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-left: 0;
    border-right: 22px solid #1f6b8c;
}

.order-execution-status-ribbon-label {
    min-width: 160px;
    padding: 0.65rem 1rem;
    border-radius: 0;
    border: 1px solid #0f4f69;
    background: #1f6b8c;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.order-execution-status-current {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.order-execution-status-current strong {
    font-size: 1.15rem;
    color: var(--primary);
}

.order-execution-status-current span {
    color: #526073;
    line-height: 1.5;
}

.order-execution-status-next {
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f5c78;
}

.order-execution-status-track {
    margin-top: 1.2rem;
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 0.5rem;
}

.order-execution-step {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 10px;
    border: 2px solid #13445a;
    background: #fff;
    color: #c7cdd5;
    font-size: 0.8rem;
    font-weight: 700;
}

.order-execution-step.complete {
    background: #5aad33;
    border-color: #3d8621;
    color: #fff;
}

.order-execution-step.current {
    background: #1180d3;
    border-color: #0b5d9b;
    color: #fff;
}

.order-execution-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.7rem;
    padding: 2.75rem 1.5rem;
}

.order-execution-empty h3 {
    margin: 0;
    color: var(--primary);
}

.order-execution-empty p {
    margin: 0;
    max-width: 560px;
    color: var(--text-muted);
    line-height: 1.55;
}

.order-execution-empty-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e9f4fb 0%, #dcecf7 100%);
    color: #1f6b8c;
    font-size: 1.7rem;
}

@media (max-width: 1180px) {
    .order-execution-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .order-execution-hero,
    .order-execution-card-head {
        flex-direction: column;
    }

    .order-execution-hero-actions,
    .order-execution-metadata {
        justify-content: flex-start;
    }

    .order-execution-status-track {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.signoff-compact-editor {
    margin: 0.75rem;
    padding: 0.8rem;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.signoff-compact-editor-head {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 0.65rem;
}

.signoff-compact-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 0.65rem;
}

.signoff-compact-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.signoff-compact-field.signoff-compact-field-wide {
    grid-column: 1 / -1;
}

.signoff-compact-field label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
}

.signoff-compact-editor-actions {
    margin-top: 0.7rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.signoff-requirement-actions {
    margin-top: 0.45rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.signoff-requirement-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.signoff-requirement-action-btn:hover {
    border-color: #60a5fa;
    color: #2563eb;
    background: #eff6ff;
}

.signoff-empty-state {
    margin: 0.85rem;
    padding: 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.signoff-empty-state-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.3rem;
}

.signoff-empty-state-text {
    font-size: 0.78rem;
    line-height: 1.5;
    color: #64748b;
}

.signoff-inline-editor {
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 0.7rem;
}

.signoff-inline-editor-field+.signoff-inline-editor-field {
    margin-top: 0.6rem;
}

.signoff-inline-editor-input,
.signoff-inline-editor-textarea {
    width: 100%;
    margin-top: 0.28rem;
    background: rgba(255, 255, 255, 0.92);
}

.signoff-inline-editor-textarea {
    resize: vertical;
    min-height: 84px;
}

.signoff-inline-editor-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(22, 101, 52, 0.18);
}

.signoff-inline-type-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    padding: 0.18rem;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.signoff-inline-type-btn {
    border: none;
    background: transparent;
    color: #166534;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.signoff-inline-type-btn.active {
    background: #ffffff;
    color: #14532d;
    box-shadow: 0 1px 2px rgba(20, 83, 45, 0.12);
}

.signoff-inline-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.signoff-supplier-add-row td {
    padding: 0.7rem 0.85rem 0.85rem;
    border-top: 1px solid #dbe4f0;
    background: #ffffff;
    text-align: left;
}

.signoff-supplier-add-btn {
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: #ffffff;
    border-radius: 10px;
    padding: 0.48rem 0.78rem;
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.18s ease;
}

.signoff-supplier-add-btn:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.signoff-supplier-add-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.signoff-translation-card {
    margin: 0.75rem;
    padding: 0.75rem 0.8rem;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.signoff-translation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.signoff-translation-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e3a8a;
}

.signoff-translation-hint {
    font-size: 0.7rem;
    color: #64748b;
}

.signoff-translation-body {
    font-size: 0.83rem;
    line-height: 1.55;
    color: #1f2937;
    white-space: pre-wrap;
}

.signoff-changelog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.signoff-changelog-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.signoff-toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.signoff-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    padding: 0.34rem 0.52rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    line-height: 1;
}

.signoff-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.signoff-live-indicator[data-status="live"] {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
}

.signoff-live-indicator[data-status="live"] .signoff-live-dot {
    background: #16a34a;
}

.signoff-live-indicator[data-status="connecting"] {
    color: #92400e;
    border-color: #fcd34d;
    background: #fffbeb;
}

.signoff-live-indicator[data-status="connecting"] .signoff-live-dot {
    background: #f59e0b;
}

.signoff-live-indicator[data-status="offline"] {
    color: #991b1b;
    border-color: #fecaca;
    background: #fef2f2;
}

.signoff-live-indicator[data-status="offline"] .signoff-live-dot {
    background: #ef4444;
}

.signoff-changelog-pane {
    border-top: 1px solid var(--border);
    background: #ffffff;
    max-height: 340px;
    overflow: hidden;
}

.signoff-changelog-content {
    padding: 0.7rem;
}

.signoff-changelog-header h4 {
    margin: 0 0 0.55rem 0;
    font-size: 0.8rem;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.signoff-log-term-switches {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
}

.signoff-log-term-switch {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    font-size: 0.72rem;
    cursor: pointer;
    white-space: nowrap;
}

.signoff-log-term-switch.active {
    border-color: #2563eb;
    background: #dbeafe;
    color: #1e3a8a;
}

.signoff-log-list {
    margin-top: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.signoff-log-entry {
    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    background: #f8fafc;
}

.signoff-log-entry.buyer {
    border-left-color: #16a34a;
    background: #f0fdf4;
}

.signoff-log-entry.supplier {
    border-left-color: #2563eb;
    background: #eff6ff;
}

.signoff-log-entry.col-supplier-response {
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.22);
    background: #eef6ff;
}

.signoff-log-entry.col-buyer-approval {
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.24);
    background: #ecfdf3;
}

.signoff-log-entry.col-supplier-approval {
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.2);
    background-image: linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(251, 191, 36, 0));
}

.signoff-log-entry-meta {
    font-size: 0.68rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.signoff-log-entry-text {
    font-size: 0.74rem;
    color: #334155;
    line-height: 1.35;
}

.signoff-log-loading,
.signoff-changelog-empty {
    padding: 0.8rem;
    text-align: center;
    color: #64748b;
    font-size: 0.74rem;
}

.requirements-progress-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    font-size: 0.72rem;
    color: #0f4c81;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 0.22rem 0.6rem;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .signoff-instructions {
        flex-wrap: wrap;
    }

    .requirements-progress-notice {
        margin-left: 0;
    }
}

.signoff-final-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.signoff-final-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.signoff-final-btn:disabled i {
    opacity: 0.5;
}

.signoff-final-btn:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    animation: signoff-pulse 2s ease-in-out infinite;
}

.signoff-final-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.signoff-final-btn:not(:disabled):active {
    transform: translateY(0);
}

@keyframes signoff-pulse {

    0%,
    100% {
        box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.6);
    }
}


/* =====================================================
   CONVERSATIONS LIST
   ===================================================== */

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.conversation-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.conversation-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conversation-icon i {
    color: white;
    font-size: 1.25rem;
}

.conversation-details {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 0.35rem 0;
}

.conversation-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.conversation-meta i {
    margin-right: 0.25rem;
    color: var(--accent);
}

.conversation-date {
    display: flex;
    align-items: center;
}

.conversation-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-arrow {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.conversation-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delete-convo-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.conversation-item:hover .delete-convo-btn {
    opacity: 0.5;
}

.delete-convo-btn:hover {
    opacity: 1 !important;
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.1);
}

.conversation-item:hover .conversation-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

.checklist-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.repost-btn:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.repost-btn i {
    color: #3b82f6;
}

/* Quick Wiki Modal Items */
.quick-wiki-item:hover {
    background: #f1f5f9 !important;
    border-color: var(--accent) !important;
    transform: translateX(5px);
}

/* Wiki Cards in Chat */
.wiki-card {
    transition: all 0.2s ease;
}

.wiki-card:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.01);
}

.wiki-file-link {
    transition: opacity 0.2s;
    cursor: pointer;
}

.wiki-file-link:hover {
    opacity: 1;
    color: var(--accent);
}

.mention-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

/* File Visualization Styles */
.file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.file-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
    max-width: 300px;
    transition: all 0.2s;
    cursor: default;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.file-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.file-icon {
    font-size: 1.5rem;
    color: var(--accent);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    border-radius: var(--radius-sm);
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-thumbnail {
    width: 100%;
    max-width: 250px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
}

.file-thumbnail:hover {
    transform: scale(1.02);
}

.file-download-btn {
    color: var(--text-muted);
    transition: color 0.2s;
    cursor: pointer;
}

.file-download-btn:hover {
    color: var(--accent);
}

/* Wiki Card File Styling Overrides */
.wiki-card .file-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.wiki-card .file-name {
    color: white;
}

.wiki-card .file-meta {
    color: rgba(255, 255, 255, 0.6);
}

.wiki-card .file-icon {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1.5rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
    height: 24px;
}

.lang-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.lang-btn:hover {
    color: var(--accent);
}

.lang-btn.active {
    color: var(--text-main);
    font-weight: 700;
}

.lang-switcher .divider {
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Font Fallbacks for Chinese */
:root:lang(zh) {
    --font-display: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-main: 'DM Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* --- New UI/UX Pro Max Redesign Styles --- */

/* Protocol File Card - Bento Style */
.protocol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.file-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-light);
}

.file-card:hover::before {
    opacity: 1;
}

.file-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.file-card:hover .file-actions {
    opacity: 1;
}

.action-chip {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.action-chip:hover {
    background: var(--bg-elevated);
    color: var(--primary);
    border-color: var(--accent-light);
}

.action-chip.delete:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

.qc-protocol-preview-modal {
    max-width: 94vw;
    width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.qc-protocol-preview-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.qc-protocol-preview-sidebar {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
    padding: 0.85rem;
    min-height: 65vh;
    display: flex;
    flex-direction: column;
}

.qc-protocol-preview-sidebar-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.qc-protocol-preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow: auto;
}

.qc-protocol-preview-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.qc-protocol-preview-item:hover {
    border-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.qc-protocol-preview-item.active {
    border-color: var(--accent);
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.qc-protocol-preview-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e2e8f0;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qc-protocol-preview-item-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.qc-protocol-preview-item-copy strong,
.qc-protocol-preview-item-copy small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qc-protocol-preview-item-copy strong {
    color: var(--text-main);
    font-size: 0.9rem;
}

.qc-protocol-preview-item-copy small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.qc-protocol-preview-viewer {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    min-height: 65vh;
}

.qc-protocol-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.qc-protocol-preview-toolbar-copy {
    min-width: 0;
}

.qc-protocol-preview-toolbar-copy h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qc-protocol-preview-toolbar-copy p {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.qc-protocol-preview-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qc-protocol-preview-stage {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0.85rem;
    overflow: auto;
}

.qc-protocol-preview-image {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 10px;
}

.qc-protocol-preview-frame {
    width: 100%;
    height: 68vh;
    border: none;
    background: #fff;
    border-radius: 10px;
}

.qc-protocol-preview-note {
    margin: 0.7rem 0 0;
    color: #64748b;
    font-size: 0.8rem;
}

.qc-protocol-preview-empty {
    min-height: 52vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #64748b;
    text-align: center;
    padding: 1.5rem;
}

.qc-protocol-preview-empty i {
    font-size: 2.25rem;
}

@media (max-width: 900px) {
    .qc-protocol-preview-layout {
        grid-template-columns: 1fr;
    }

    .qc-protocol-preview-sidebar,
    .qc-protocol-preview-viewer {
        min-height: auto;
    }
}

/* Evidence Gallery Enhancement */
.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

.evidence-grid .evidence-item {
    border-radius: var(--radius-md);
    background: white;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    aspect-ratio: 4/5;
    display: flex;
    flex-direction: column;
}

.evidence-grid .evidence-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    z-index: 10;
}

.evidence-preview {
    flex: 1;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.evidence-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.evidence-grid .evidence-item:hover .evidence-preview img {
    transform: scale(1.1);
}

.evidence-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 31, 54, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    color: white;
}

.evidence-grid .evidence-item:hover .evidence-overlay {
    opacity: 1;
}

.evidence-data {
    padding: 0.75rem;
    border-top: 1px solid var(--border);
}

.evidence-type-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    display: inline-block;
}

.evidence-uploader {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.evidence-actions-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.4rem;
    pointer-events: none;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.2s ease;
}

.evidence-grid .evidence-item:hover .evidence-actions-overlay {
    pointer-events: auto;
    transform: translateY(0);
    opacity: 1;
}

.action-pill {
    padding: 0.4rem 0.8rem;
    background: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.action-pill:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.action-pill.delete:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* =====================================================
   TELEGRAM-STYLE MESSENGER
   Industrial Precision Aesthetic
   ===================================================== */

.messenger-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: 100%;
    min-height: calc(100vh - 80px);
    background: var(--bg-body);
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    width: 100%;
    min-width: 0;
    margin: 0;
}

/* Messenger Sidebar */
.messenger-sidebar {
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messenger-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #faf9f8 0%, #f5f3f1 100%);
}

.messenger-sidebar .sidebar-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.messenger-sidebar .sidebar-header h2 i {
    color: var(--accent);
}

.messenger-sidebar .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.messenger-sidebar .icon-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Messenger Tabs */
.messenger-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: #faf9f8;
}

.messenger-tabs .tab-btn {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.messenger-tabs .tab-btn:hover {
    color: var(--primary);
    background: rgba(193, 127, 89, 0.05);
}

.messenger-tabs .tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: white;
}

.messenger-tabs .badge {
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.messenger-tabs .badge.hidden {
    display: none;
}

/* Messenger Lists */
.messenger-list {
    flex: 1;
    overflow-y: auto;
    display: none;
}

.messenger-list.active {
    display: block;
}

.messenger-list .list-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* Chat List Items */
.chat-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 4px solid transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.chat-item:hover {
    background: #faf9f8;
}

.chat-item.active {
    background: linear-gradient(90deg, rgba(193, 127, 89, 0.1) 0%, rgba(193, 127, 89, 0.02) 100%);
    border-left-color: var(--accent);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #8B5A3C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    letter-spacing: -1px;
}

.chat-avatar.small {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
}

.chat-item-details {
    flex: 1;
    min-width: 0;
}

.chat-item-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.chat-item-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.chat-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

.chat-item-unread {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* Contacts Section */
.contacts-section {
    margin-bottom: 1rem;
}

.contacts-section .section-label {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #faf9f8;
    border-bottom: 1px solid var(--border);
}

.contacts-section .section-label i {
    color: var(--accent);
}

/* Contact Items */
.contact-item-msg {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.contact-item-msg:hover {
    background: #faf9f8;
}

.contact-item-msg .contact-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-main);
}

.contact-item-msg .contact-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Friend Request Items */
.request-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(193, 127, 89, 0.05) 0%, transparent 100%);
}

.request-item .request-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.request-item .request-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.request-actions {
    display: flex;
    gap: 0.5rem;
}

.request-actions button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.request-actions .accept-btn {
    background: var(--accent);
    color: white;
}

.request-actions .accept-btn:hover {
    background: var(--accent-light);
}

.request-actions .decline-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.request-actions .decline-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
}

/* Empty States */
.list-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.list-empty i {
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.list-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Messenger Main Area */
.messenger-main {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #faf9f8 0%, #f5f3f1 100%);
    position: relative;
}

/* Chat Empty State */
.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.chat-empty-state .empty-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(193, 127, 89, 0.1) 0%, rgba(193, 127, 89, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.chat-empty-state .empty-icon i {
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.6;
}

.chat-empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
    margin: 0 0 0.5rem;
}

.chat-empty-state p {
    color: var(--text-muted);
    margin: 0;
}

/* Active Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-container.hidden {
    display: none;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chat-user-details h3 {
    margin: 0;
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.online-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.chat-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-actions .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-actions .icon-btn:hover {
    background: var(--bg-elevated);
    color: var(--primary);
}

/* Messages Area */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message Bubbles - Industrial Style */
.message-bubble {
    max-width: 65%;
    padding: 0.875rem 1rem;
    position: relative;
    animation: messageIn 0.25s ease-out;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble.sent {
    background: linear-gradient(135deg, var(--accent) 0%, #A06B4A 100%);
    color: white;
    margin-left: auto;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 2px 8px rgba(193, 127, 89, 0.25);
}

.message-bubble.received {
    background: white;
    color: var(--text-main);
    border-radius: 16px 16px 16px 4px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message-bubble.bridge-ai {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #f8fffe;
    margin-right: auto;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
    border: 1px solid rgba(15, 118, 110, 0.18);
}

.message-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
    color: rgba(240, 253, 250, 0.92);
}

.message-bubble.bridge-ai .message-time {
    color: rgba(240, 253, 250, 0.82);
}

.message-bubble .message-content {
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-bubble .message-original-text {
    white-space: pre-wrap;
}

.message-bubble .message-translation-block {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(100, 116, 139, 0.35);
}

.message-bubble .message-translation-label {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.78;
    margin-bottom: 0.3rem;
}

.message-bubble .message-translated-text {
    white-space: pre-wrap;
}

.message-bubble .message-translate-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.message-bubble .message-translate-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    transition: all 0.15s ease;
}

.message-bubble .message-translate-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.message-bubble .message-translate-btn.clear {
    padding: 0.2rem 0.38rem;
}

.message-bubble .message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    font-family: 'Space Mono', monospace;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-bubble.sent .message-time {
    justify-content: flex-end;
}

.message-bubble.message-failed {
    outline: 1px solid #dc2626;
}

.chat-file-message-card {
    margin-top: 0.1rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.message-bubble.sent .chat-file-message-card,
.telegram-message.sent .chat-file-message-card {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow: none;
}

.message-bubble.received .chat-file-message-card,
.telegram-message.received .chat-file-message-card {
    background: #ffffff;
}

.chat-file-message-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
}

.chat-file-message-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
    background: rgba(219, 234, 254, 0.85);
    color: #1d4ed8;
}

.message-bubble.sent .chat-file-message-icon,
.telegram-message.sent .chat-file-message-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.chat-file-message-meta {
    flex: 1;
    min-width: 0;
}

.chat-file-message-name {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    word-break: break-word;
}

.message-bubble.sent .chat-file-message-name,
.telegram-message.sent .chat-file-message-name {
    color: #ffffff;
}

.chat-file-message-subtitle {
    margin-top: 0.18rem;
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.message-bubble.sent .chat-file-message-subtitle,
.telegram-message.sent .chat-file-message-subtitle {
    color: rgba(255, 255, 255, 0.78);
}

.chat-file-message-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.chat-file-message-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.chat-file-message-action-btn:hover {
    border-color: #60a5fa;
    color: #2563eb;
    background: #eff6ff;
}

.message-bubble.sent .chat-file-message-action-btn,
.telegram-message.sent .chat-file-message-action-btn {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.message-bubble.sent .chat-file-message-action-btn:hover,
.telegram-message.sent .chat-file-message-action-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.38);
    color: #ffffff;
}

.chat-file-message-preview {
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: transparent;
}

.message-bubble.sent .chat-file-message-preview,
.telegram-message.sent .chat-file-message-preview {
    border-top-color: rgba(255, 255, 255, 0.18);
}

.chat-file-message-preview.image {
    display: block;
    padding: 0.8rem;
    cursor: pointer;
}

.chat-file-message-preview.image img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
}

.chat-file-message-preview.pdf {
    padding: 0.8rem;
}

.chat-file-message-preview.pdf iframe {
    width: 100%;
    height: 220px;
    border: 0;
    border-radius: 12px;
    background: #ffffff;
}

@media (max-width: 640px) {
    .chat-file-message-head {
        align-items: flex-start;
    }

    .chat-file-message-preview.image img,
    .chat-file-message-preview.pdf iframe {
        max-height: 180px;
        height: 180px;
    }
}

/* Reactions Bar */
.message-reactions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reaction-chip:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.reaction-chip.user-reacted {
    background: rgba(193, 127, 89, 0.1);
    border-color: var(--accent);
}

.reaction-chip .count {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Reaction Button */
.message-bubble .react-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.message-bubble.sent .react-btn {
    left: -40px;
}

.message-bubble.received .react-btn {
    right: -40px;
}

.message-bubble:hover .react-btn {
    opacity: 1;
}

.message-bubble .react-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Emoji Picker */
.emoji-picker {
    position: fixed;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.emoji-picker.hidden {
    display: none;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.25rem;
}

.emoji-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.emoji-btn:hover {
    background: var(--bg-elevated);
    transform: scale(1.15);
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid var(--border);
}

.chat-input-area .attach-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-input-area .attach-btn:hover {
    background: var(--bg-elevated);
    color: var(--accent);
    border-color: var(--accent);
}

.chat-input-area .input-wrapper {
    flex: 1;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
}

.chat-input-area .input-wrapper textarea {
    width: 100%;
    border: none;
    background: none;
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-main);
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
}

.chat-input-area .input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.chat-input-area .send-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-input-area .send-btn:hover {
    background: var(--accent-light);
    transform: scale(1.05);
}

/* New Chat Modal Enhancements */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(193, 127, 89, 0.1);
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-result-item:hover {
    background: var(--bg-elevated);
}

.search-result-item .result-info {
    flex: 1;
}

.search-result-item .result-name {
    font-weight: 600;
    color: var(--text-main);
}

.search-result-item .result-email {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-result-item .is-contact-badge {
    font-size: 0.7rem;
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .messenger-container {
        grid-template-columns: 1fr;
    }

    .messenger-sidebar {
        display: none;
    }

    .messenger-sidebar.show-mobile {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
    }

    .message-bubble {
        max-width: 85%;
    }
}

/* =====================================================
   FRIENDS PANE - Spec Alignment View Integration
   Industrial Precision Aesthetic
   ===================================================== */

.friends-pane {
    width: 280px;
    min-width: 280px;
    background: white;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.friends-pane .pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.friends-pane .pane-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.friends-pane .pane-header h3 i {
    color: var(--accent);
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.icon-btn-sm:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Invitations Section */
.invitations-section {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: #fffbf5;
}

.section-header-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.section-header-mini i {
    color: var(--accent);
}

.notification-badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-left: auto;
}

.notification-badge:empty,
.notification-badge[data-count="0"] {
    display: none;
}

.conversation-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.16);
    flex: 0 0 auto;
    display: inline-block;
}

.invitations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
}

.invitation-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.invitation-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.invitation-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.invitation-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #e89b78 100%);
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invitation-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
}

.invitation-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.invitation-actions {
    display: flex;
    gap: 0.5rem;
}

.invitation-btn {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.invitation-btn.accept {
    background: #10b981;
    color: white;
}

.invitation-btn.accept:hover {
    background: #059669;
}

.invitation-btn.decline {
    background: #fee2e2;
    color: #ef4444;
}

.invitation-btn.decline:hover {
    background: #fecaca;
}

/* Contacts Panel Section */
.contacts-panel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow: hidden;
}

.contacts-panel-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.contact-panel-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.contact-panel-item:hover {
    background: #f1f5f9;
}

.contact-panel-item.active {
    background: linear-gradient(135deg, rgba(194, 127, 89, 0.1) 0%, rgba(194, 127, 89, 0.05) 100%);
    border-left: 3px solid var(--accent);
}

.contact-panel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-panel-info {
    flex: 1;
    min-width: 0;
}

.contact-panel-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-panel-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-panel-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.contact-panel-empty i {
    font-size: 2rem;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    display: block;
}

/* Telegram-Style Chat in Spec Alignment */
.chat-pane.telegram-style .pane-header {
    padding: 0.35rem 1rem;
    border-bottom: 1px solid var(--border);
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
}

.chat-pane.telegram-style .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-checklist-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.72rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.mobile-checklist-toggle:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.mobile-checklist-toggle.active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.mobile-checklist-toggle i {
    font-size: 0.78rem;
}

.chat-pane.telegram-style .signoff-status-bar-container {
    order: 2;
}

.chat-pane.telegram-style .spec-goal-banner {
    order: 3;
}

.chat-pane.telegram-style .messages-area.telegram-messages {
    order: 4;
}

.chat-pane.telegram-style .input-container {
    order: 5;
}

.chat-pane.telegram-style .pane-header h3 {
    font-size: 0.85rem;
    margin: 0;
    font-weight: 600;
}

.chat-partner-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #e89b78 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

#header-edit-proposal-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    height: 28px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 6px;
}

/* Partner UI components */
.chat-partner-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Top chat bar for latest checklist update */
.spec-goal-banner {
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.45rem 1rem;
    animation: fadeInDown 0.25s ease-out;
    transition: all 0.2s ease;
}

.spec-signoff-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

#signoff-instructions {
    display: none !important;
}

.spec-signoff-banner-main {
    flex: 1;
    min-width: 0;
}

.spec-signoff-banner-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.12rem;
}

.spec-signoff-banner-text {
    font-size: 0.82rem;
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spec-signoff-banner-meta {
    margin-top: 0.08rem;
    font-size: 0.72rem;
    color: #64748b;
}

.spec-signoff-banner-btn {
    flex-shrink: 0;
    padding: 0.32rem 0.58rem;
    font-size: 0.72rem;
}

/* Proposal Enhancement Styles */
.proposal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.75rem;
}

.proposal-actions-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.proposal-sheet {
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
}

.proposal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.proposal-table th {
    background: #f8fafc;
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 700;
    color: var(--primary);
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border);
}

.proposal-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
}

.proposal-table tr:last-child td {
    border-bottom: none;
}

.version-badge {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.75rem;
    border-radius: 4px;
    margin-right: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Handshake Overlay */
.handshake-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.handshake-overlay.active {
    display: flex;
}

.handshake-content {
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.handshake-animation {
    font-size: 8rem;
    margin-bottom: 2rem;
    animation: shakeHand 1.5s infinite;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shakeHand {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* New Proposal Form Table */
.proposal-form-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 800px;
}

.proposal-form-table th {
    text-align: left;
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    color: var(--primary);
    font-weight: 700;
}

.proposal-form-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.proposal-form-table input,
.proposal-form-table select,
.proposal-form-table textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.proposal-form-table input:focus,
.proposal-form-table select:focus,
.proposal-form-table textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.proposal-form-table tr:hover {
    background: #fbfcfd;
}

.cell-qty input {
    text-align: center;
}

.cell-price input {
    text-align: right;
}

/* Agreement Status Badges */
.agreement-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.agreement-status.agreed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.agreement-status.pending {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.agreement-status.buyer-theme {
    border-color: var(--side-buyer) !important;
    background: var(--side-buyer-bg) !important;
    color: var(--side-buyer) !important;
}

.agreement-status.supplier-theme {
    border-color: var(--side-supplier) !important;
    background: var(--side-supplier-bg) !important;
    color: var(--side-supplier) !important;
}

/* Requirement Overview Badges */
.req-badge-yes,
.req-badge-no,
.req-badge-nego {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.req-badge-yes {
    background: #d1fae5;
    color: #065f46;
}

.req-badge-no {
    background: #fee2e2;
    color: #991b1b;
}

.req-badge-nego {
    background: #fefce8;
    color: #854d0e;
    border: 1px solid #fde047;
}

/* Requirement Inputs in Checklist */
.req-select-wrapper {
    position: relative;
    width: 100%;
}

.req-select {
    width: 100%;
    padding: 4px 8px;
    font-size: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.req-textarea {
    width: 100%;
    padding: 6px;
    font-size: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.req-textarea.req-textarea-offer {
    min-height: 88px;
    resize: both;
}

.req-textarea:focus,
.req-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

/* Rich Message Cards */
.system-msg .telegram-message-bubble {
    background: #f8fafc !important;
    border: 1px dashed var(--border) !important;
    color: var(--primary) !important;
    max-width: 100%;
}

.handshake-message-card {
    text-align: center;
    padding: 0.5rem;
}

.handshake-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    animation: shakeHand 2s infinite ease-in-out;
}

.handshake-text {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

.order-message-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.order-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
    color: white;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-card-body {
    padding: 1rem;
}

.order-summary-text {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.order-actions {
    display: flex;
    justify-content: flex-end;
}

/* Order Summary */
.order-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.order-summary-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.order-summary-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.order-total-row td {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    border-top: 2px solid var(--border);
    background: #f8fafc;
}

.order-payment-summary-modal {
    max-width: 980px;
    width: min(96vw, 980px);
    position: relative;
    padding: 2rem;
    background: linear-gradient(180deg, #d9f99d 0%, #bbf7d0 100%);
}

.order-payment-summary-close {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
}

.order-payment-summary-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1.4rem;
}

.order-payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.order-payment-summary-card {
    background: rgba(15, 39, 66, 0.92);
    color: white;
    border: 2px solid #0f2742;
    border-radius: 12px;
    padding: 1.4rem;
    min-height: 220px;
}

.order-payment-summary-card h3 {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
}

.order-payment-summary-card p {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.84);
}

.order-payment-summary-card-accent {
    background: linear-gradient(135deg, rgba(15, 39, 66, 0.95) 0%, rgba(8, 145, 178, 0.88) 100%);
}

.order-payment-summary-warning {
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(254, 240, 138, 0.18);
    border: 1px solid rgba(254, 240, 138, 0.38);
    color: #fff7cc;
}

.order-payment-summary-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.order-payment-summary-metric {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.7rem;
    margin-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.9rem;
}

.order-payment-summary-metric strong {
    font-size: 1rem;
}

.order-payment-viban {
    display: block;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 1rem;
    font-weight: 700;
    word-break: break-word;
    margin-bottom: 0.75rem;
}

.order-payment-summary-meta {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.84);
    margin-top: 0.35rem;
}

.order-payment-summary-preview {
    margin-top: 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1rem;
}

.order-payment-summary-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.3rem;
}

@media (max-width: 900px) {
    .price-payment-summary-grid,
    .order-payment-summary-grid {
        grid-template-columns: 1fr;
    }

    .price-payment-card-head,
    .price-payment-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .price-payment-pill-row {
        justify-content: flex-start;
    }

    .price-payment-item-meta {
        grid-template-columns: 1fr;
    }

    .order-payment-summary-modal {
        padding: 1.25rem;
    }

    .order-payment-summary-title {
        font-size: 1.5rem;
        padding-right: 2rem;
    }

    .payment-instruction-details {
        grid-template-columns: 1fr;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-partner-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.chat-partner-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Telegram Messages Area */
.messages-area.telegram-messages {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

/* Telegram-Style Message Bubbles in Spec View */
.telegram-message {
    max-width: 85%;
    position: relative;
    margin-bottom: 1.25rem;
    animation: messageSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.telegram-message.sent {
    align-self: flex-end;
    padding-left: 60px;
}

.telegram-message.received {
    align-self: flex-start;
    padding-right: 60px;
    /* Actions gutter on right */
    padding-left: 0;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.telegram-message.sent {
    align-self: flex-end;
}

.telegram-message.received {
    align-self: flex-start;
}

.telegram-message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    position: relative;
    word-break: break-word;
}

.telegram-message.sent .telegram-message-bubble {
    background: linear-gradient(135deg, var(--accent) 0%, #e5a07a 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.telegram-message.received .telegram-message-bubble {
    background: white;
    border: 1px solid var(--border);
    color: var(--primary);
    border-bottom-left-radius: 4px;
}

.telegram-message.bridge-ai .telegram-message-bubble {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #f8fffe;
    border: 1px solid rgba(15, 118, 110, 0.16);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.16);
}

.telegram-message.bridge-ai .telegram-sender-name {
    color: rgba(236, 253, 245, 0.95);
}

.telegram-message.bridge-ai .telegram-message-footer {
    color: rgba(236, 253, 245, 0.82);
}

.telegram-message-content {
    font-size: 0.95rem;
    line-height: 1.5;
}

.telegram-message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    opacity: 0.7;
}

.telegram-message.sent .telegram-message-footer {
    color: rgba(255, 255, 255, 0.8);
}

.telegram-message.received .telegram-message-footer {
    color: var(--text-muted);
}

/* Sender Name */
.telegram-sender-name {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.telegram-message.sent .telegram-sender-name {
    color: rgba(255, 255, 255, 0.8);
}

.telegram-message.received .telegram-sender-name {
    color: var(--accent);
}

/* Message Reactions in Telegram Style */
.telegram-message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.reaction-pill:hover {
    background: rgba(0, 0, 0, 0.1);
}

.reaction-pill.user-reacted {
    background: rgba(194, 127, 89, 0.15);
    border-color: var(--accent);
}

.reaction-pill .count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Message Actions - Vertical Stack */
.telegram-message-actions {
    position: absolute;
    top: 6px;
    width: 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    align-items: center;
}

.telegram-message.sent .telegram-message-actions {
    left: 8px;
    /* Left of bubble for sent */
}

.telegram-message.received .telegram-message-actions {
    right: 8px;
    /* Right of bubble for received */
}

.telegram-more-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: white;
    color: #475569;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.telegram-more-btn:hover {
    transform: scale(1.12);
    border-color: #60a5fa;
    color: #1d4ed8;
    background: #eff6ff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.telegram-translate-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: white;
    color: #3b82f6;
    /* Azure Blue */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    order: 1;
    /* Translation on top */
}

.telegram-quote-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: white;
    color: #475569;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    order: 1;
}

.telegram-react-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    order: 3;
    /* React button below it */
}

.telegram-translate-btn {
    order: 2;
}

.telegram-quote-btn:hover {
    transform: scale(1.15);
    border-color: #60a5fa;
    color: #1d4ed8;
    background: #eff6ff;
}

.telegram-translate-btn:hover {
    transform: scale(1.15);
    background: #f1f5f9;
    color: #2563eb;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.telegram-react-btn:hover {
    transform: scale(1.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* Adjustments for message sub-elements */
.telegram-message-reactions {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.telegram-message.sent .telegram-message-reactions {
    justify-content: flex-end;
}

.telegram-message-content .conversation-quote-card {
    margin-bottom: 0.45rem;
}

/* Telegram Input Style */
.input-wrapper.telegram-input {
    border-radius: 24px;
    padding: 0.5rem 0.75rem;
}

/* Empty Chat State */
.empty-chat-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.empty-chat-state i {
    font-size: 4rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.empty-chat-state h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.empty-chat-state p {
    font-size: 0.9rem;
}

/* Animation for toasts */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* =====================================================
   DASHBOARD CONVERSATIONS GRID LAYOUT
   ===================================================== */

.conversations-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.conversations-column,
.friends-column {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.column-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-title i {
    color: var(--accent);
}

.project-dm-toolbar {
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-dm-sort-control {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
}

.project-dm-sort-select {
    border: 1px solid #dbe4ef;
    background: #ffffff;
    color: #0f172a;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.project-dm-sort-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.project-dm-metrics {
    margin-top: 0.18rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.project-dm-metric-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.14rem 0.42rem;
    border-radius: 999px;
    background: #eef6ff;
    color: #1d4ed8;
    font-size: 0.64rem;
    font-weight: 700;
}

/* Invitations Section Dashboard */
.invitations-section-dashboard {
    background: #fffbf5;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.contacts-section-dashboard {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.contacts-list-dashboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item-dashboard {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border: 1px solid var(--border);
}

.contact-item-dashboard:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

.contact-email {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-full {
    width: 100%;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Responsive */
@media (max-width: 900px) {
    .conversations-grid {
        grid-template-columns: 1fr;
    }
}

/* Proposal Grid Interactive Styles */
.proposal-table-cell {
    position: relative;
    padding: 0.5rem !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

.proposal-table-cell:hover {
    filter: brightness(0.95);
}

.cell-agreed {
    background-color: #dcfce7 !important;
    /* Soft Green */
    color: #166534 !important;
}

.cell-reproposed {
    background-color: #fef3c7 !important;
    /* Soft Amber/Yellow */
    color: #92400e !important;
}

.cell-diff {
    font-weight: bold;
    color: #ef4444;
}

/* Sidebar Checklist Table */
.checklist-table-scroll {
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.checklist-table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.checklist-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.55);
    border-radius: 999px;
}

.checklist-table-scroll::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.12);
}

.checklist-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.checklist-table th,
.checklist-table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
}

.checklist-table th {
    background: #e2e8f0;
    font-weight: 700;
    color: #1e293b;
    position: sticky;
    top: 0;
    z-index: 1;
}

.checklist-table .row-header {
    text-align: left;
    background: #f1f5f9;
    font-weight: 600;
}

.checklist-table .row-header a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    background: #f0f9ff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

.check-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #cbd5e1;
    transition: all 0.2s;
}

.check-btn.active {
    color: var(--success);
}

/* -----------------------------------------------------
   Supplier sourcing + DM checklist scroll hardening
   Keeps spec chat header/input fixed while messages scroll,
   and keeps checklist table scroll confined to sidebar body.
------------------------------------------------------ */
#spec-chat-region.chat-pane.telegram-style {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#spec-chat-region .pane-header,
#spec-chat-region .signoff-instructions,
#spec-chat-region .spec-goal-banner,
#spec-chat-region .input-container {
    flex: 0 0 auto;
}

#spec-chat-region #supplier-messages-area.messages-area.telegram-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#panel-checklist {
    flex-direction: column;
    min-height: 0;
}

#panel-checklist #checklist-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#panel-checklist #checklist-container .checklist-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: auto;
}

/* Keep sourcing project workspace non-scrollable at page level.
   Only the chat message window should scroll inside the project view. */
.dashboard-main-panel.sourcing-workflow-scroll-lock,
.panel-content.sourcing-workflow-scroll-lock,
.sourcing-workflow-page {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.sourcing-workflow-page>.sourcing-workflow-topbar,
.sourcing-workflow-section-product>.sourcing-chat-composer {
    flex: 0 0 auto;
}

.sourcing-workflow-page>.sourcing-workflow-sections,
.sourcing-workflow-sections[data-active-section="spec"] .sourcing-workflow-section-product,
.sourcing-workflow-section-product>.sourcing-chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.sourcing-workflow-section-product>.sourcing-chat-shell>.sourcing-chat-window {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Buyer Approval Buttons in Sidebar */
.approval-btns {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

.approval-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: #cbd5e1;
    font-size: 0.75rem;
}

.approval-btn.approve.active {
    background: #dcfce7;
    color: #16a34a;
    border-color: #16a34a;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.15);
}

.approval-btn.reject.active {
    background: #fee2e2;
    color: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

.approval-btn:hover:not(.active) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #94a3b8;
}

.approval-btn.active i {
    transform: scale(1.1);
}

.check-btn:hover {
    transform: scale(1.2);
}

.proposal-table tr.buyer-row td {
    border-bottom: 1px dashed var(--border);
}

.proposal-table tr.seller-row td {
    border-top: none;
}

/* System notice for centered chat notifications */
.system-notice {
    align-self: center;
    max-width: 80%;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.03);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-style: italic;
    line-height: 1.4;
    border: 1px dashed rgba(0, 0, 0, 0.05);
}

.sidebar-top {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.back-to-dash-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.back-to-dash-btn:hover {
    background: white;
    color: var(--primary);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* Business Card & Settings UI Rework */
.business-card-card,
.greeting-management-card,
.mail-notification-card {
    grid-column: 1 / -1;
}

.settings-card-disabled {
    opacity: 0.88;
}

.form-hint {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.settings-rollout-note {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.9rem;
    line-height: 1.5;
}

.settings-rollout-note i {
    margin-top: 0.1rem;
}

.business-card-editor {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .business-card-editor {
        flex-direction: row;
        align-items: flex-start;
    }

    .card-preview-container {
        flex: 1;
        position: sticky;
        top: 2rem;
    }

    .card-form {
        flex: 1.5;
    }
}

.card-form .form-group {
    margin-bottom: 1.25rem;
}

.card-form .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.card-form .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-card);
}

.card-form .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.card-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.business-card-preview {
    width: 350px;
    height: 220px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.business-card-preview:hover {
    transform: translateY(-5px);
}

.business-card-preview::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    border-radius: 4px;
    margin-bottom: 1rem;
    position: relative;
}

.card-chip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-header p {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-body {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-item {
    font-size: 0.75rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-item i {
    width: 12px;
    color: var(--accent);
}

.card-footer {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
}

.card-logo {
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* Greeting Preview Bubble */
.greeting-editor-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.greeting-preview-bubble {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border);
    position: relative;
    max-width: 400px;
}

.greeting-preview-bubble .preview-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.greeting-preview-bubble .preview-header img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.greeting-preview-bubble .preview-header span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.greeting-preview-bubble .preview-body {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    font-style: italic;
}

/* Reworked Textarea */
.greeting-management-card textarea,
.mail-notification-card textarea {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: var(--bg-card);
    resize: vertical;
    width: 100%;
}

@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.greeting-management-card textarea:focus,
.mail-notification-card textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(13, 138, 188, 0.1);
}

.mail-notification-card textarea:disabled,
.mail-notification-card button:disabled {
    cursor: not-allowed;
}

.mail-notification-card textarea:disabled {
    background: #f8fafc;
    color: var(--text-muted);
}

.mail-notification-card button:disabled {
    opacity: 0.6;
    box-shadow: none;
}

/* Styling for New Chat Modal - Premium UI */
#new-chat-modal .modal-content {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
}

#new-chat-modal .modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem 2rem;
}

#new-chat-modal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

#new-chat-modal .modal-header i {
    color: var(--accent);
}

#new-chat-modal .close-btn {
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #64748b;
}

#new-chat-modal .close-btn:hover {
    background: #e2e8f0;
    color: #ef4444;
}

#new-chat-modal .modal-body {
    padding: 2rem;
}

#new-chat-modal .form-group {
    margin-bottom: 1.5rem;
}

#new-chat-modal .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0;
}

#new-chat-modal .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#new-chat-modal .search-input-wrapper i {
    position: absolute;
    left: 1.25rem;
    color: #94a3b8;
    pointer-events: none;
}

#new-chat-modal #user-search-input {
    padding-left: 3rem !important;
    height: 52px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 100%;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#new-chat-modal input:focus,
#new-chat-modal textarea:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 138, 188, 0.1);
    outline: none;
}

#new-chat-modal .divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 2rem 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#new-chat-modal .divider-text::before,
#new-chat-modal .divider-text::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e9eff6;
}

#new-chat-modal .divider-text span {
    padding: 0 1.25rem;
}

#new-chat-modal #invite-email-input {
    height: 52px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 100%;
    padding: 0 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#new-chat-modal #invite-message-input {
    min-height: 120px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    resize: none;
    transition: all 0.3s ease;
    line-height: 1.5;
}

#new-chat-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

#new-chat-modal .btn-primary {
    padding: 0.85rem 1.75rem;
    font-weight: 700;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

#new-chat-modal .btn-outline {
    padding: 0.85rem 1.75rem;
    font-weight: 700;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

#new-chat-modal .btn-outline:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Hierarchical Conversations View */
.conversations-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 2rem;
    margin-top: 0;
}

.conversations-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.friends-column {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.column-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-title i {
    color: var(--accent);
}

.invitations-section-dashboard,
.contacts-section-dashboard {
    margin-top: 2rem;
}

.section-header-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.btn-full {
    width: 100%;
}

.contact-panel-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.contact-panel-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.contact-panel-empty p {
    font-size: 0.875rem;
    line-height: 1.4;
}

@media (max-width: 1024px) {
    .conversations-grid {
        grid-template-columns: 1fr;
    }

    .friends-column {
        position: static;
    }
}

/* Requirement Matrix Redesign */
.requirements-overview-toolbar-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.requirements-overview-status-pill {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: white;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.req-matrix-container {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-top: 1rem;
    font-family: var(--font-main);
}

.req-matrix-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 950px;
}

.req-matrix-thead {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.req-matrix-th {
    padding: 0.7rem 0.9rem;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

.req-matrix-td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    transition: background 0.15s;
}

tbody tr:last-child .req-matrix-td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #fcfcfc;
}

.req-criteria-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.product-spec-cell {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.62rem 0.72rem;
}

.product-spec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.product-spec-head-main {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    gap: 0.45rem;
    min-width: 0;
}

.product-spec-head-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.product-spec-label {
    display: inline-block;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
}

.product-spec-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 20px;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.product-spec-required {
    color: #dc2626;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.checklist-overflow-btn {
    flex-shrink: 0;
}

.product-spec-title {
    font-size: 0.84rem;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 0.2rem;
}

.product-spec-content-wrap {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #dbe4ef;
}

.product-spec-content {
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #334155;
    line-height: 1.45;
}

.product-spec-cell.compact {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
}

.product-spec-cell.compact .product-spec-title {
    font-size: 0.8rem;
}

.product-spec-cell.compact .product-spec-content {
    font-size: 0.75rem;
}

.req-criteria-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.req-type-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid #e2e8f0;
}

.req-type-badge.hard {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.req-type-badge.soft {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fef08a;
}

.req-header-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.req-header-pill {
    background: #fff;
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.req-select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.req-select:focus,
.req-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.req-textarea {
    width: 100%;
    min-height: 2.8rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
}

.req-badge-yes {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

.req-badge-no {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

.req-badge-nego {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

.req-badge-pending {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
}

.req-summary-supplier-cell {
    min-width: 220px;
}

.req-summary-supplier-card {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.req-summary-supplier-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.req-summary-supplier-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    word-break: break-word;
}

.req-summary-message-btn {
    margin-top: 0.35rem;
    align-self: flex-start;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-muted);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.req-summary-message-btn:hover {
    background: #eef6ff;
    color: var(--accent);
    border-color: #bfdbfe;
}

.req-summary-approval-cell {
    min-width: 180px;
}

.req-manage-actions {
    display: flex;
    gap: 0.4rem;
    opacity: 0;
    transition: all 0.2s ease;
    margin-left: auto;
}

tbody tr:hover .req-manage-actions {
    opacity: 1;
}

.req-action-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.req-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #f8fafc;
}

.req-action-btn.danger:hover {
    border-color: #fca5a5;
    color: #dc2626;
    background: #fef2f2;
}

/* Edit Pane / Modal Styles */
.edit-pane-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.edit-pane {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: 16px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.edit-pane-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.edit-pane-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.edit-pane-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.edit-pane-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.type-toggle-group {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    gap: 3px;
}

.type-toggle-btn {
    flex: 1;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    color: var(--text-muted);
}

.type-toggle-btn.active {
    background: white;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.type-toggle-btn.active[data-type="hard"] {
    color: #991b1b;
}

.type-toggle-btn.active[data-type="soft"] {
    color: #854d0e;
}

/* Sign-off Status Bar */
.signoff-status-bar-container {
    background: #f8fafc;
    border-bottom: 2px solid #cbd5e1;
    padding: 0;
    overflow-x: auto;
    max-height: 80px;
    z-index: 20;
}

.signoff-bar-wrapper {
    min-width: 100%;
}

.signoff-status-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.75rem;
}

.signoff-status-table th,
.signoff-status-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    text-align: center;
    white-space: nowrap;
}

.signoff-status-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-top: none;
}

.signoff-status-table td.row-label,
.signoff-status-table th.row-label {
    width: 120px;
    background: #f8fafc;
    font-weight: 800;
    color: #1e293b;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #cbd5e1;
}

.signoff-status-table .vote-cell {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: #e2e8f0;
    text-align: center;
    padding: 0.5rem;
}

.signoff-status-table .vote-cell:hover {
    background: #f1f5f9;
    color: #94a3b8;
}

.signoff-status-table .vote-cell.active {
    background: #dcfce7;
    color: #16a34a;
}

.signoff-status-table .vote-cell.active i {
    transform: scale(1.25);
}

.signoff-status-table tr:last-child td {
    border-bottom: none;
}

.required-content-inline {
    margin-left: 0.45rem;
    color: #dc2626;
    font-size: 0.73rem;
    text-transform: none;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
}

.edit-requirement-modal .edit-pane-header {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.edit-requirement-modal .edit-pane-body {
    background: #fcfdff;
}

.edit-requirement-modal .edit-pane-footer {
    background: #f8fafc;
}

.edit-requirement-modal .input-main,
.edit-requirement-modal textarea,
.edit-requirement-modal input[type="text"] {
    background: #ffffff;
    border: 1px solid #cbd5e1 !important;
}

.edit-requirement-modal .input-main:focus,
.edit-requirement-modal textarea:focus,
.edit-requirement-modal input[type="text"]:focus {
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
    outline: none;
}

.visibility-option-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: var(--text-main);
    padding: 0.3rem 0.2rem;
    border-bottom: 1px dashed #e5e7eb;
}

.visibility-option-row:last-child {
    border-bottom: none;
}

.file-group-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 0.45rem;
    background: #fff;
}

.file-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
}

.file-group-count {
    background: #e2e8f0;
    color: #334155;
    border-radius: 999px;
    font-size: 0.7rem;
    padding: 0.08rem 0.45rem;
}

.file-group-list {
    padding: 0.25rem;
}

/* =====================================================
   Mobile Layout Optimization
   ===================================================== */
@media (max-width: 900px) {
    main {
        padding: 1rem;
    }

    .main-header {
        height: auto;
        min-height: 64px;
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        align-items: center;
        flex-wrap: wrap;
    }

    .logo img {
        height: 48px !important;
        width: auto;
    }

    nav {
        width: 100%;
        margin-left: 0;
        gap: 0.65rem;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-main-links {
        width: 100%;
        gap: 1rem;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 0.15rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-main-links .nav-btn {
        flex: 0 0 auto;
    }

    .nav-action-group {
        width: 100%;
        margin-left: 0;
        gap: 0.75rem;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .nav-btn,
    .nav-dash-btn,
    .login-btn,
    .btn-primary,
    .btn-secondary {
        font-size: 0.82rem;
        letter-spacing: 0.5px;
    }

    .nav-dash-btn,
    .login-btn {
        padding: 0.55rem 1rem;
    }

    .hero.reworked {
        padding: 3.5rem 0.5rem 2.5rem;
        gap: 1.75rem;
    }

    .hero-title.large-left {
        font-size: clamp(2rem, 10vw, 3rem);
        letter-spacing: -0.8px;
        line-height: 1.08;
    }

    .mission-statement {
        margin-top: 1.25rem;
        padding-left: 1rem;
        border-left-width: 3px;
    }

    .hero .subtitle {
        font-size: 1rem;
        line-height: 1.55;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .cta-group .btn-primary,
    .cta-group .btn-secondary {
        width: 100%;
        padding: 0.85rem 1rem;
    }

    .section-container {
        padding: 3rem 0;
    }

    .section-title.align-left {
        width: 100%;
        font-size: 2rem;
        letter-spacing: -0.8px;
        margin-bottom: 1rem;
    }

    .section-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .problem-grid,
    .value-grid,
    .about-content,
    .contact-grid,
    .chevron-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .problem-card {
        padding: 1.25rem;
    }

    .problem-card h3 {
        font-size: 1.1rem;
    }

    .problem-card p {
        font-size: 0.95rem;
    }

    .chevron-flow-container {
        padding: 0.5rem 0;
    }

    .chevron-bar {
        flex-direction: column;
        height: auto;
        gap: 0.6rem;
    }

    .chevron-step,
    .chevron-step:first-child,
    .chevron-step:last-child {
        clip-path: none;
        margin-left: 0;
        border-radius: 10px;
        min-height: 56px;
        padding: 0.75rem 1rem;
    }

    .chevron-step:hover {
        transform: none;
    }

    .chevron-detail-item {
        padding-left: 0;
    }

    .chevron-detail-item h3 {
        font-size: 0.72rem;
        letter-spacing: 1.2px;
    }

    .chevron-detail-item p {
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .about-text p {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .contact-form {
        padding: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .modal-content {
        max-width: calc(100vw - 1.5rem);
        padding: 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .requirement-modal-wrapper {
        left: 0;
        width: 100vw;
        top: 64px;
        height: calc(100vh - 64px);
    }

    #dashboard-view.active,
    #spec-alignment-view.active,
    #messaging-view.active {
        flex-direction: column;
        overflow: auto;
    }

    .dashboard-sidebar {
        position: fixed;
        top: var(--dashboard-mobile-top-offset);
        left: 0;
        width: min(82vw, 320px);
        min-width: 0;
        height: calc(100vh - var(--dashboard-mobile-top-offset));
        max-height: none;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: none;
        padding: 0.85rem 0.6rem;
        z-index: 900;
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(calc(-100% - 16px));
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.28);
        transition: transform 0.28s ease, opacity 0.2s ease, visibility 0s linear 0.28s;
        will-change: transform;
    }

    .dashboard-sidebar.mobile-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transition: transform 0.28s ease, opacity 0.2s ease;
    }

    .dashboard-mobile-backdrop {
        display: block;
    }

    .sidebar-header {
        display: flex;
        padding: 0 0.4rem 0.8rem;
    }

    .sidebar-nav {
        flex-direction: column;
        flex-wrap: nowrap;
        overflow: visible;
        gap: 0.45rem;
        padding: 0.1rem 0 0;
    }

    .workflow-steps-group {
        flex-direction: column;
        gap: 0.45rem;
        margin: 0;
    }

    .sidebar-btn,
    .sidebar-btn.workflow-step {
        min-width: 0;
        padding: 0.65rem 0.7rem;
        font-size: 0.82rem;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
    }

    .sidebar-btn i {
        width: 18px;
        font-size: 0.9rem;
    }

    .step-number {
        width: 17px;
        height: 17px;
        font-size: 0.6rem;
    }

    #btn-dash-analytics {
        margin-top: 0;
    }

    .sidebar-footer {
        margin-top: auto;
        padding-top: 0.6rem;
        display: flex;
        align-items: flex-start;
        gap: 0.6rem;
        flex-wrap: wrap;
    }

    .user-guide-toggle {
        width: auto;
        margin-bottom: 0;
        font-size: 0.78rem;
        padding: 0.4rem 0.6rem;
    }

    .sidebar-footer #sidebar-username {
        font-size: 0.85rem;
    }

    .dashboard-sidebar:not(.hidden)~#dashboard-view.active,
    .dashboard-sidebar:not(.hidden)~#spec-alignment-view.active,
    .dashboard-sidebar:not(.hidden)~#messaging-view.active {
        margin-left: 0;
        width: 100%;
    }

    .dashboard-main-panel {
        padding: 1rem;
    }

    .panel-header {
        margin-bottom: 1.25rem;
    }

    .panel-header h1 {
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .panel-header p {
        font-size: 0.95rem;
    }

    .panel-content {
        gap: 1.25rem;
    }

    .dashboard-section {
        padding: 1.1rem;
    }

    .section-header {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .nav-dash-btn.mobile-sidebar-open {
        box-shadow: 0 8px 18px rgba(14, 165, 233, 0.2);
    }

    .spec-three-pane-layout {
        flex-direction: column;
        gap: 0.75rem;
        overflow: auto;
        padding: 0.5rem;
        min-height: calc(100vh - var(--dashboard-mobile-top-offset) - 1rem);
    }

    .doc-pane,
    .chat-pane,
    .ai-pane {
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        max-height: none;
        flex: 1 1 auto;
    }

    .doc-pane {
        flex: 1 1 auto;
    }

    .spec-three-pane-layout.mobile-sidebar-collapsed .spec-left-sidebar {
        display: none;
    }

    .spec-three-pane-layout.mobile-sidebar-expanded .spec-left-sidebar {
        display: flex;
        flex: 0 0 auto;
        min-height: 240px;
        max-height: min(46vh, 420px);
    }

    .spec-left-sidebar .sidebar-content {
        height: auto;
        flex: 1 1 auto;
        min-height: 0;
    }

    .sidebar-tabs-horizontal {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wechat-sync-hero {
        grid-template-columns: 1fr;
        justify-items: flex-start;
    }

    .wechat-sync-status-pill {
        justify-self: flex-start;
    }

    .wechat-sync-actions {
        flex-direction: column;
    }

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

    .wechat-sync-actions .btn-primary,
    .wechat-sync-actions .btn-outline {
        width: 100%;
    }

    .chat-pane.telegram-style {
        min-height: calc(100vh - var(--dashboard-mobile-top-offset) - 1rem);
    }

    .chat-pane.telegram-style .pane-header {
        padding: 0.55rem 0.75rem;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .chat-pane.telegram-style .pane-header h3 {
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .chat-pane.telegram-style .header-actions {
        margin-left: auto;
        align-self: center;
    }

    .mobile-checklist-toggle {
        display: inline-flex;
    }

    .signoff-instructions {
        padding: 0.5rem 0.75rem;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .signoff-inline-editor-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .signoff-compact-editor-grid {
        grid-template-columns: 1fr;
    }

    .spec-goal-banner {
        padding: 0.45rem 0.75rem;
    }

    .spec-signoff-banner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .messages-area.telegram-messages {
        padding: 1rem 0.85rem;
    }

    .input-container {
        padding: 0.5rem 0.75rem;
    }

    .checklist-table-scroll {
        height: auto;
        max-height: none;
    }

    .ai-pane {
        flex: 1 1 auto;
    }

    .resizer-v {
        display: none;
    }
}

@media (max-width: 640px) {
    main {
        padding: 0.75rem;
    }

    .main-header {
        padding: 0.6rem 0.75rem;
    }

    .logo img {
        height: 40px !important;
    }

    .hero.reworked {
        padding: 2.75rem 0 2rem;
    }

    .hero-title.large-left {
        font-size: clamp(1.7rem, 11.5vw, 2.35rem);
    }

    .section-title.align-left {
        font-size: 1.65rem;
    }

    .problem-card h3 {
        font-size: 1rem;
    }
}

/* -----------------------------------------------------
   Final layout guardrails for sourcing + DM checklist
   Keep page-level scroll disabled in sourcing project mode,
   and keep DM checklist scrolling inside sidebar table area.
------------------------------------------------------ */
.dashboard-main-panel.sourcing-workflow-scroll-lock,
.dashboard-main-panel.sourcing-workflow-scroll-lock .panel-content.sourcing-workflow-scroll-lock,
.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-container.sourcing-workflow-page {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-container.sourcing-workflow-page {
    display: flex;
    flex-direction: column;
}

.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-workflow-topbar,
.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-workflow-section-product>.sourcing-chat-composer {
    flex: 0 0 auto;
}

.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-workflow-sections,
.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-workflow-sections[data-active-section="spec"] .sourcing-workflow-section-product,
.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-workflow-section-product>.sourcing-chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.dashboard-main-panel.sourcing-workflow-scroll-lock .sourcing-workflow-section-product>.sourcing-chat-shell>.sourcing-chat-window {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#spec-left-sidebar,
#spec-left-sidebar .sidebar-content,
#spec-left-sidebar #panel-checklist,
#spec-left-sidebar #panel-checklist #checklist-container {
    min-height: 0;
}

#spec-left-sidebar #panel-checklist {
    flex-direction: column;
    overflow: hidden;
}

#spec-left-sidebar #panel-checklist #checklist-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 0;
    overflow: hidden;
}

#spec-left-sidebar #panel-checklist #checklist-container .checklist-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: auto;
}

/* Keep sidebar tabs mutually exclusive even when narrower desktop windows
   pick up the mobile breakpoint styles. */
#spec-left-sidebar .sidebar-panel:not(.active) {
    display: none !important;
}

#spec-left-sidebar .sidebar-panel.active {
    display: flex !important;
}
