* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Arial, sans-serif;

    background: #f7f8fa;
    color: #1f2937;
}

.cdj-app {
    width: 100%;
    height: 100vh;
    display: flex;
    overflow: hidden;
}


/* =========================================================
   SIDEBAR
========================================================= */

.cdj-sidebar {
    width: 270px;
    min-width: 270px;
    height: 100vh;

    background: #101828;
    color: #ffffff;

    display: flex;
    flex-direction: column;

    position: relative;
    z-index: 1050;
}

.sidebar-header {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;

    border-radius: 11px;

    background: #ffffff;
    color: #101828;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,.55);
    margin-top: 2px;
}

.sidebar-content {
    flex: 1;
    padding: 18px 14px;
    overflow-y: auto;
}

.new-chat-btn {
    width: 100%;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #ffffff;

    border-radius: 10px;

    padding: 11px 14px;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 14px;
    font-weight: 600;

    transition: .2s;
}

.new-chat-btn:hover {
    background: rgba(255,255,255,.12);
}

.chat-history-title {
    margin: 28px 8px 12px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 1px;

    color: rgba(255,255,255,.42);
}

.empty-history {
    padding: 18px 10px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    text-align: center;

    color: rgba(255,255,255,.35);
    font-size: 12px;
}

.empty-history i {
    font-size: 20px;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;

    border-radius: 50%;

    background: rgba(255,255,255,.1);

    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info strong {
    font-size: 13px;
}

.user-info small {
    font-size: 11px;
    color: rgba(255,255,255,.45);
}


/* =========================================================
   MAIN
========================================================= */

.cdj-main {
    flex: 1;
    min-width: 0;
    height: 100vh;

    display: flex;
    flex-direction: column;

    background: #ffffff;
}

.cdj-navbar {
    height: 64px;
    min-height: 64px;

    border-bottom: 1px solid #e5e7eb;

    display: flex;
    align-items: center;

    padding: 0 22px;
}

.navbar-spacer {
    flex: 1;
}

.navbar-icon-btn,
.mobile-menu-btn {
    width: 38px;
    height: 38px;

    border: 0;
    background: transparent;

    border-radius: 9px;

    color: #475467;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;
}

.navbar-icon-btn:hover,
.mobile-menu-btn:hover {
    background: #f2f4f7;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 16px;
}

.mobile-brand i {
    font-size: 19px;
}


/* =========================================================
   CHAT
========================================================= */

.chat-container {
    flex: 1;
    min-height: 0;

    overflow-y: auto;

    display: flex;
    flex-direction: column;
}

.welcome-screen {
    width: min(850px, 100%);

    margin: auto;

    padding: 50px 25px 30px;

    text-align: center;
}

.welcome-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 22px;

    border-radius: 18px;

    background: #101828;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 28px;
}

.welcome-screen h1 {
    margin: 0;

    font-size: clamp(27px, 4vw, 38px);

    font-weight: 700;

    color: #101828;
}

.welcome-screen p {
    max-width: 620px;

    margin: 12px auto 32px;

    color: #667085;

    font-size: 15px;
    line-height: 1.6;
}

.suggestion-grid {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 12px;

    max-width: 700px;

    margin: auto;
}

.suggestion-card {
    text-align: left;

    border: 1px solid #e4e7ec;

    background: #ffffff;

    border-radius: 13px;

    padding: 16px;

    display: flex;
    align-items: center;
    gap: 12px;

    color: #344054;

    font-size: 13px;

    transition: .2s;
}

.suggestion-card:hover {
    border-color: #98a2b3;
    box-shadow: 0 5px 18px rgba(16,24,40,.07);
}

.suggestion-card i {
    font-size: 19px;
    color: #344054;
}


/* =========================================================
   CHAT MESSAGES
========================================================= */

.messages-wrapper {
    width: min(1000px, 100%);
    margin: 0 auto;
    padding: 35px 25px 120px;
}


/* Common row */

.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 32px;
}


/* =========================================================
   CDJ GPT — LEFT
========================================================= */

.message-ai {
    justify-content: flex-start;
}

.message-ai .message-content {
    max-width: 85%;
}

.message-ai .message-avatar {
    order: 1;
}

.message-ai .message-content {
    order: 2;
}


/* =========================================================
   USER — RIGHT
========================================================= */

.message-user {
    justify-content: flex-end;
}

.message-user .message-content {
    max-width: 75%;
    text-align: right;
}

.message-user .message-avatar {
    order: 2;
    margin-left: 12px;
}

.message-user .message-content {
    order: 1;
}


/* =========================================================
   AVATAR
========================================================= */

.message-avatar {
    width: 36px;
    min-width: 36px;
    height: 36px;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 15px;
}


/* User avatar */

.message-user .message-avatar {
    background: #eef2f6;
    color: #344054;
}


/* CDJ GPT avatar */

.message-ai .message-avatar {
    background: #101828;
    color: #ffffff;

    margin-right: 12px;
}


/* =========================================================
   MESSAGE CONTENT
========================================================= */

.message-role {
    font-size: 12px;
    font-weight: 700;

    color: #475467;

    margin-bottom: 7px;
}


/* User role */

.message-user .message-role {
    text-align: right;
}


/* AI role */

.message-ai .message-role {
    text-align: left;
}


/* Message text */

.message-text {
    font-size: 14px;
    line-height: 1.75;

    color: #344054;

    word-break: break-word;
}


/* =========================================================
   USER MESSAGE
========================================================= */

.message-user .message-text {
    display: inline-block;

    padding: 11px 15px;

    background: #f2f4f7;

    border-radius: 16px 16px 4px 16px;

    text-align: left;

    color: #101828;
}


/* =========================================================
   AI MESSAGE
========================================================= */

.message-ai .message-text {
    text-align: left;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 575.98px) {

    .messages-wrapper {
        padding: 25px 12px 120px;
    }

    .message-row {
        margin-bottom: 25px;
    }

    .message-avatar {
        width: 32px;
        min-width: 32px;
        height: 32px;

        font-size: 13px;
    }

    .message-ai .message-content {
        max-width: calc(100% - 44px);
    }

    .message-user .message-content {
        max-width: 82%;
    }

    .message-text {
        font-size: 13px;
        line-height: 1.65;
    }

    .message-user .message-avatar {
        margin-left: 8px;
    }

    .message-ai .message-avatar {
        margin-right: 8px;
    }

}

/* =========================================================
   CHAT INPUT
========================================================= */

.chat-input-area {
    padding: 12px 20px 18px;

    background: #ffffff;
}

.input-wrapper {
    width: min(900px, 100%);

    margin: 0 auto;

    border: 1px solid #d0d5dd;

    border-radius: 17px;

    background: #ffffff;

    box-shadow: 0 4px 20px rgba(16,24,40,.07);

    overflow: hidden;
}

.message-input {
    width: 100%;

    border: 0;
    outline: 0;

    resize: none;

    padding: 17px 18px 7px;

    min-height: 52px;
    max-height: 180px;

    font-size: 14px;

    color: #101828;
}

.message-input::placeholder {
    color: #98a2b3;
}

.input-toolbar {
    min-height: 45px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 3px 8px 8px 12px;
}

.input-tools {
    display: flex;
    gap: 5px;
}

.input-tool-btn {
    border: 0;
    background: transparent;

    color: #667085;

    padding: 7px 9px;

    border-radius: 8px;

    font-size: 12px;
}

.input-tool-btn:hover {
    background: #f2f4f7;
}

.input-tool-btn i {
    font-size: 16px;
    margin-right: 4px;
}

.send-btn {
    width: 36px;
    height: 36px;

    border: 0;
    border-radius: 10px;

    background: #101828;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: .2s;
}

.send-btn:disabled {
    background: #e4e7ec;
    color: #98a2b3;
}

.input-disclaimer {
    width: min(900px, 100%);

    margin: 8px auto 0;

    text-align: center;

    font-size: 10px;

    color: #98a2b3;
}


/* =========================================================
   DOCUMENT
========================================================= */

.document-preview {
    margin: 10px 12px 0;

    padding: 9px;

    background: #f8fafc;

    border: 1px solid #e4e7ec;

    border-radius: 10px;

    display: flex;
    align-items: center;

    gap: 9px;
}

.document-preview-icon {
    width: 34px;
    height: 34px;

    border-radius: 8px;

    background: #eef2f6;

    display: flex;
    align-items: center;
    justify-content: center;
}

.document-preview-info {
    flex: 1;

    min-width: 0;

    display: flex;
    flex-direction: column;
}

.document-preview-info strong {
    font-size: 12px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.document-preview-info small {
    color: #98a2b3;

    font-size: 10px;
}

.remove-document {
    border: 0;

    background: transparent;

    color: #667085;

    font-size: 17px;
}


/* =========================================================
   MOBILE
========================================================= */

.sidebar-overlay {
    display: none;
}

@media (max-width: 991.98px) {

    .cdj-sidebar {
        position: fixed;

        left: -290px;
        top: 0;

        transition: left .25s ease;
    }

    .cdj-sidebar.show {
        left: 0;
    }

    .sidebar-overlay {
        position: fixed;

        inset: 0;

        background: rgba(16,24,40,.45);

        z-index: 1040;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .cdj-navbar {
        padding: 0 14px;
    }

    .mobile-menu-btn {
        margin-right: 10px;
    }

    .welcome-screen {
        padding: 40px 18px 25px;
    }

    .suggestion-grid {
        grid-template-columns: 1fr;
    }

    .messages-wrapper {
        padding: 25px 15px 120px;
    }

    .chat-input-area {
        padding: 9px 10px 13px;
    }

    .input-disclaimer {
        font-size: 9px;
    }
}

@media (max-width: 575.98px) {

    .welcome-icon {
        width: 55px;
        height: 55px;

        font-size: 23px;
    }

    .welcome-screen h1 {
        font-size: 27px;
    }

    .welcome-screen p {
        font-size: 13px;
    }

    .suggestion-card {
        padding: 13px;
    }

    .input-tool-btn span {
        display: none;
    }

    .message-row {
        gap: 9px;
        margin-bottom: 25px;
    }

    .message-avatar {
        width: 30px;
        min-width: 30px;
        height: 30px;
    }

    .message-text {
        font-size: 13px;
    }
}

/* =========================================================
   CDJ GPT CHAT
========================================================= */

.chat-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}


/* =========================================================
   MESSAGES
========================================================= */

.chat-messages {
    padding: 25px 10px 150px;
    min-height: 400px;
    max-height: 65vh;
    overflow-y: auto;
}


/* =========================================================
   CHAT ROW
========================================================= */

.chat-row {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    width: 100%;
}


/* =========================================================
   AI LEFT
========================================================= */

.assistant-row {
    justify-content: flex-start;
}


/* =========================================================
   USER RIGHT
========================================================= */

.user-row {
    flex-direction: row-reverse;
    justify-content: flex-start;
}


/* =========================================================
   AVATAR
========================================================= */

.chat-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    font-weight: 600;
}


.ai-avatar {
    background: #101828;
    color: #fff;
}


.user-avatar {
    background: #eef2f6;
    color: #17324d;
}


.chat-content {
    max-width: 82%;
}


.user-row .chat-content {
    text-align: right;
}


.chat-name {
    font-weight: 700;
    font-size: 14px;
    color: #243b53;
    margin-bottom: 7px;
}


/* =========================================================
   USER MESSAGE
========================================================= */

.user-message {
    display: inline-block;

    background: #f2f5f8;

    border-radius: 18px 18px 4px 18px;

    padding: 12px 17px;

    color: #17324d;

    line-height: 1.6;

    text-align: left;

    word-break: break-word;
}


/* =========================================================
   AI EXPLANATION
========================================================= */

.ai-explanation {
    color: #243b53;
    line-height: 1.75;
    font-size: 15px;
}


/* =========================================================
   RESULT COUNT
========================================================= */

.result-count {
    margin-top: 15px;
    margin-bottom: 12px;

    font-size: 13px;
    color: #6b7c93;
}


/* =========================================================
   JUDGMENT CARD
========================================================= */

.judgment-card {

    border: 1px solid #e5eaf0;

    border-radius: 14px;

    padding: 18px;

    margin-top: 12px;

    background: #fff;

    box-shadow:
        0 4px 15px rgba(20, 40, 70, 0.04);
}


.judgment-number {

    font-size: 12px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .05em;

    color: #6b7c93;

    margin-bottom: 10px;
}


.judgment-description {

    color: #26384d;

    line-height: 1.7;

    font-size: 14px;

    margin-bottom: 15px;
}


/* =========================================================
   META
========================================================= */

.judgment-meta {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    padding-top: 14px;

    border-top: 1px solid #edf0f3;
}


.meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.meta-label {

    font-size: 11px;

    text-transform: uppercase;

    color: #8996a8;

    font-weight: 600;

    letter-spacing: .04em;
}


.meta-value {

    font-size: 13px;

    color: #243b53;

    word-break: break-word;
}


/* =========================================================
   INPUT
========================================================= */

.chat-input-area {

    position: sticky;

    bottom: 0;

    background: #fff;

    padding: 10px 0;
}


.chat-input-box {

    display: flex;

    align-items: flex-end;

    gap: 8px;

    border: 1px solid #d4dce5;

    border-radius: 20px;

    padding: 12px 10px 10px 16px;

    box-shadow:
        0 8px 30px rgba(30, 50, 80, .08);

    background: #fff;
}


.chat-input-box textarea {

    flex: 1;

    border: 0;

    outline: 0;

    box-shadow: none !important;

    resize: none;

    min-height: 42px;

    max-height: 150px;

    color: #17324d;

    padding: 8px 4px;
}


.chat-input-box textarea:focus {
    outline: none;
}


/* =========================================================
   UPLOAD
========================================================= */

.upload-btn {

    border: 0;

    background: transparent;

    color: #64748b;

    padding: 10px;

    display: flex;

    align-items: center;

    gap: 7px;

    cursor: pointer;
}


.upload-btn:hover {
    color: #17324d;
}


/* =========================================================
   SEND
========================================================= */

.send-btn {

    width: 44px;

    height: 44px;

    border: 0;

    border-radius: 12px;

    background: #e8edf3;

    color: #7a8796;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 19px;

    cursor: pointer;
}


.send-btn:hover {
    background: #dce4ed;
}


.send-btn:disabled {
    opacity: .5;

    cursor: not-allowed;
}


/* =========================================================
   LOADING
========================================================= */

.typing-indicator {

    display: flex;

    align-items: center;

    gap: 5px;

    color: #64748b;

    font-size: 13px;
}


.typing-indicator span {

    width: 6px;

    height: 6px;

    border-radius: 50%;

    background: #64748b;

    animation: cdjTyping 1.2s infinite;
}


.typing-indicator span:nth-child(2) {
    animation-delay: .15s;
}


.typing-indicator span:nth-child(3) {
    animation-delay: .3s;
}


.typing-indicator small {
    margin-left: 7px;
}


@keyframes cdjTyping {

    0%,
    60%,
    100% {
        opacity: .3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }

}


/* =========================================================
   ERROR
========================================================= */

.chat-error {

    color: #b42318;

    background: #fef3f2;

    border: 1px solid #fecdca;

    border-radius: 10px;

    padding: 12px 15px;

    line-height: 1.5;
}


/* =========================================================
   SYSTEM
========================================================= */

.system-message {

    text-align: center;

    color: #667085;

    font-size: 13px;

    margin: 15px 0;
}


/* =========================================================
   DISCLAIMER
========================================================= */

.chat-disclaimer {

    text-align: center;

    font-size: 11px;

    color: #8492a6;

    padding: 5px 10px 15px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .chat-messages {
        padding: 15px 5px 130px;
        max-height: 70vh;
    }


    .chat-row {
        gap: 9px;
        margin-bottom: 22px;
    }


    .chat-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
        border-radius: 10px;
        font-size: 11px;
    }


    .chat-content {
        max-width: 86%;
    }


    .chat-name {
        font-size: 13px;
    }


    .user-message,
    .ai-explanation {
        font-size: 14px;
    }


    .judgment-card {
        padding: 13px;
    }


    .judgment-meta {
        grid-template-columns: 1fr;
    }


    .upload-btn span {
        display: none;
    }


    .chat-input-box {
        border-radius: 17px;
        padding-left: 12px;
    }

}

/* =========================================================
   CDJ GPT - AI RESPONSE
========================================================= */

.cdj-ai-response {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}


/* =========================================================
   AI SUMMARY CARD
========================================================= */

.ai-summary-card {
    position: relative;
    margin-bottom: 28px;
    padding: 24px 26px;
    border: 1px solid #e4e9f2;
    border-radius: 18px;
    background: linear-gradient(
        145deg,
        #ffffff 0%,
        #f8faff 100%
    );
    box-shadow:
        0 8px 30px rgba(15, 23, 42, 0.06);
}


.ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}


.ai-summary-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    color: #17233c;
    font-size: 17px;
    font-weight: 700;
}


.ai-summary-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #eef2ff;
    color: #3446a8;
    font-size: 17px;
}


.ai-result-count {
    padding: 7px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}


.ai-summary-content {
    color: #334155;
    font-size: 14px;
    line-height: 1.85;
}


.ai-summary-content p {
    margin-bottom: 13px;
}


.ai-summary-content p:last-child {
    margin-bottom: 0;
}


.ai-summary-content strong {
    color: #17233c;
    font-weight: 700;
}


/* =========================================================
   WARNING
========================================================= */

.ai-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    padding: 13px 15px;
    border: 1px solid #fde68a;
    border-radius: 11px;
    background: #fffbeb;
    color: #854d0e;
    font-size: 12px;
    line-height: 1.6;
}


.ai-disclaimer i {
    margin-top: 2px;
    font-size: 15px;
}


/* =========================================================
   RESULT HEADER
========================================================= */

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}


.search-results-title {
    margin: 0;
    color: #17233c;
    font-size: 18px;
    font-weight: 700;
}


.search-results-subtitle {
    color: #64748b;
    font-size: 12px;
}


/* =========================================================
   JUDGMENT CARD
========================================================= */

.judgment-card {
    position: relative;
    margin-bottom: 16px;
    padding: 22px 24px;
    border: 1px solid #e5eaf1;
    border-radius: 16px;
    background: #ffffff;
    box-shadow:
        0 4px 18px rgba(15, 23, 42, 0.04);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}


.judgment-card:hover {
    transform: translateY(-2px);

    border-color: #d5ddef;

    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.08);
}


/* =========================================================
   CARD TOP
========================================================= */

.judgment-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}


.judgment-number {
    flex: 0 0 auto;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #17233c;
    color: #ffffff;

    font-size: 15px;
    font-weight: 700;
    width: 41px;
}


.judgment-heading {
    flex: 1;
    min-width: 0;
}


.judgment-title {
    margin: 0;

    color: #17233c;

    font-size: 15px;
    line-height: 1.5;

    font-weight: 700;
}


.judgment-title a {
    color: inherit;
    text-decoration: none;
}


.judgment-title a:hover {
    color: #3446a8;
}


/* =========================================================
   META
========================================================= */

.judgment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;

    margin-top: 7px;

    color: #64748b;

    font-size: 12px;
}


.judgment-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


.judgment-meta-item i {
    color: #7c8db5;
}


/* =========================================================
   DIVIDER
========================================================= */

.judgment-divider {
    height: 1px;

    margin: 18px 0;

    background: #edf0f5;
}


/* =========================================================
   DESCRIPTION
========================================================= */

.judgment-label {
    margin-bottom: 7px;

    color: #7b8798;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


.judgment-description {
    color: #334155;

    font-size: 13px;

    line-height: 1.75;
}


.judgment-description p {
    margin-bottom: 8px;
}


.judgment-description p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   PARTIES
========================================================= */

.judgment-parties {
    margin-top: 15px;

    padding: 11px 13px;

    border-radius: 10px;

    background: #f8fafc;

    color: #475569;

    font-size: 12px;

    line-height: 1.6;
}


.judgment-parties strong {
    color: #17233c;
}


/* =========================================================
   TAGS
========================================================= */

.judgment-tags {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    margin-top: 15px;
}


.judgment-tag {
    display: inline-flex;

    align-items: center;

    padding: 5px 9px;

    border-radius: 7px;

    background: #f1f5f9;

    color: #475569;

    font-size: 10px;

    font-weight: 600;
}


/* =========================================================
   MARKDOWN CONTENT
========================================================= */

.ai-markdown h1,
.ai-markdown h2,
.ai-markdown h3 {
    margin-top: 22px;
    margin-bottom: 10px;

    color: #17233c;

    font-weight: 700;
}


.ai-markdown h3 {
    font-size: 14px;
}


.ai-markdown ul,
.ai-markdown ol {
    margin: 10px 0 15px;
    padding-left: 22px;
}


.ai-markdown li {
    margin-bottom: 6px;
}


.ai-markdown blockquote {
    margin: 15px 0;

    padding: 12px 16px;

    border-left: 3px solid #3446a8;

    background: #f8fafc;

    color: #475569;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .ai-summary-card {
        padding: 18px;
        border-radius: 14px;
    }


    .ai-summary-header {
        align-items: flex-start;
    }


    .ai-result-count {
        font-size: 11px;
    }


    .search-results-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }


    .judgment-card {
        padding: 17px;
        border-radius: 13px;
    }


    .judgment-top {
        gap: 10px;
    }


    .judgment-number {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }


    .judgment-title {
        font-size: 14px;
    }


    .judgment-meta {
        flex-direction: column;
        gap: 6px;
    }


    .ai-summary-content {
        font-size: 13px;
        line-height: 1.75;
    }

}

.cdj-search-highlight {
    background-color: #fff176;
    color: #111827;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

.cdj-case-link {
    color: #0d6efd;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cdj-case-link:hover {
    color: #084298;
    text-decoration: underline;
}
/* =========================================================
   APP
========================================================= */

.cdj-app {
    width: 100%;
    height: 100vh;

    display: flex;

    overflow: hidden;
}


/* =========================================================
   SIDEBAR
========================================================= */

.cdj-sidebar {

    width: 312px;
    min-width: 312px;
    height: 100vh;

    background: #0d1728;
    color: #ffffff;

    display: flex;
    flex-direction: column;

    position: relative;
    z-index: 100;

}


/* =========================================================
   SIDEBAR HEADER
========================================================= */

.sidebar-header {

    height: 101px;
    min-height: 101px;

    padding: 0 21px;

    border-bottom: 1px solid rgba(255,255,255,.08);

    display: flex;
    align-items: center;
    justify-content: space-between;

}


.brand-logo {

    display: flex;
    align-items: center;

    gap: 14px;

}


.brand-icon {

    width: 48px;
    height: 48px;

    border-radius: 13px;

    background: #ffffff;

    color: #0d1728;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;

}


.brand-name {

    font-size: 20px;

    font-weight: 700;

    line-height: 1.1;

}


.brand-subtitle {

    font-size: 12px;

    color: #a9b7ce;

    margin-top: 5px;

}


.sidebar-close {

    width: 38px;
    height: 38px;

    border: 0;

    background: transparent;

    color: #ffffff;

    font-size: 18px;

}


/* =========================================================
   SIDEBAR CONTENT
========================================================= */

.sidebar-content {

    flex: 1;

    min-height: 0;

    padding: 20px 16px;

    overflow-y: auto;

}


.new-chat-btn {

    width: 100%;

    height: 53px;

    border-radius: 11px;

    border: 1px solid rgba(255,255,255,.13);

    background: #1c2739;

    color: #ffffff;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 0 16px;

    font-size: 15px;

    font-weight: 600;

    cursor: pointer;

    transition: .2s ease;

}


.new-chat-btn:hover {

    background: #253247;

}


.new-chat-btn i {

    font-size: 19px;

}


.chat-history-title {

    margin:

        32px 9px 17px;

    font-size: 11px;

    font-weight: 700;

    letter-spacing: .5px;

    color: #7889a5;

}


.empty-history {

    min-height: 180px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    gap: 14px;

    color: #637594;

    font-size: 13px;

    padding: 20px;

}


.empty-history i {

    font-size: 25px;

    color: #60718d;

}


/* =========================================================
   SIDEBAR FOOTER
========================================================= */

.sidebar-footer {

    min-height: 84px;

    padding: 16px;

    border-top: 1px solid rgba(255,255,255,.08);

}


.user-profile {

    display: flex;
    align-items: center;

    gap: 12px;

}


.user-avatar {

    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    border-radius: 50%;

    background: #f8fafc;

    color: #29415f;

    display: flex;
    align-items: center;
    justify-content: center;

}


.user-info {

    display: flex;

    flex-direction: column;

    min-width: 0;

}


.user-info strong {

    font-size: 13px;

    color: #ffffff;

}


.user-info small {

    margin-top: 3px;

    font-size: 11px;

    color: #8191aa;

}


/* =========================================================
   MAIN
========================================================= */

.cdj-main {

    flex: 1;

    min-width: 0;

    height: 100vh;

    display: flex;

    flex-direction: column;

    background: #ffffff;

    overflow: hidden;

}


/* =========================================================
   NAVBAR
========================================================= */

.cdj-navbar {

    height: 70px;
    min-height: 70px;

    width: 100%;

    border-bottom: 1px solid #e5e7eb;

    background: #ffffff;

    display: flex;
    align-items: center;

    padding: 0 22px;

    position: relative;

    z-index: 20;

}


.navbar-spacer {

    flex: 1;

}


.navbar-icon-btn {

    width: 40px;
    height: 40px;

    border: 0;

    background: transparent;

    color: #1e293b;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 21px;

    cursor: pointer;

}


.navbar-icon-btn:hover {

    background: #f1f5f9;

    border-radius: 9px;

}


.mobile-menu-btn {

    width: 40px;
    height: 40px;

    border: 0;

    background: transparent;

    color: #1e293b;

    font-size: 24px;

}


.mobile-brand {

    display: flex;

    align-items: center;

    gap: 8px;

    color: #0f172a;

    font-size: 16px;

}


/* =========================================================
   CONTENT
   THIS IS THE IMPORTANT SCROLL AREA
========================================================= */

.cdj-content {

    flex: 1;

    min-height: 0;

    width: 100%;

    overflow-y: auto;
    overflow-x: hidden;

    scroll-behavior: smooth;

    position: relative;

}


/* =========================================================
   HOME
========================================================= */

.cdj-home {

    width: 100%;

    padding:

        55px 5% 100px;

}


.home-header {

    width: 100%;

    max-width: 900px;

    margin: 0 auto 38px;

    text-align: center;

}


.home-icon {

    width: 65px;
    height: 65px;

    margin: 0 auto 17px;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #172554,
            #2563eb
        );

    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 28px;

    box-shadow:
        0 10px 30px rgba(37,99,235,.15);

}


.home-header h1 {

    margin: 0;

    color: #0f172a;

    font-size: 31px;

    font-weight: 700;

}


.home-header p {

    margin: 9px 0 0;

    color: #64748b;

    font-size: 15px;

}


/* =========================================================
   FEATURE GRID
========================================================= */

.feature-grid {

    width: 100%;

    max-width: 1100px;

    margin: 0 auto;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;

}


.feature-card {

    min-height: 165px;

    padding: 23px;

    border: 1px solid #e2e8f0;

    border-radius: 17px;

    background: #ffffff;

    position: relative;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;

}


.feature-card:hover {

    transform: translateY(-3px);

    border-color: #bfdbfe;

    box-shadow:
        0 15px 35px rgba(15,23,42,.08);

}


.feature-icon {

    width: 46px;
    height: 46px;

    border-radius: 12px;

    background: #eff6ff;

    color: #2563eb;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 21px;

    margin-bottom: 16px;

}


.feature-content h3 {

    margin: 0 35px 7px 0;

    font-size: 17px;

    font-weight: 650;

    color: #0f172a;

}


.feature-content p {

    margin: 0;

    max-width: 90%;

    font-size: 13px;

    line-height: 1.55;

    color: #64748b;

}


.feature-arrow {

    position: absolute;

    top: 24px;
    right: 22px;

    color: #94a3b8;

    font-size: 17px;

}


/* =========================================================
   CHAT SCREEN
========================================================= */

.chat-screen {

    display: none;

    width: 100%;

    min-height: 100%;

    padding: 25px 5% 140px;

}


.messages-wrapper {

    width: 100%;

}


.chat-messages {

    width: 100%;

}


/* =========================================================
   CHAT INPUT
========================================================= */

.chat-input-area {

    display: none;

    width: 100%;

    background: #ffffff;

    border-top: 1px solid #eef0f3;

    flex-shrink: 0;

}


.chat-wrapper {

    width: 100%;

    max-width: 1000px;

    margin: 0 auto;

    padding: 15px 20px 14px;

}


#chatForm {

    width: 100%;

    margin: 0;

}


.chat-input-box {

    width: 100%;

    min-height: 58px;

    border: 1px solid #d9dee7;

    border-radius: 15px;

    padding: 7px 8px 7px 14px;

    display: flex;

    align-items: flex-end;

    gap: 7px;

    background: #ffffff;

    box-shadow:
        0 5px 18px rgba(15,23,42,.05);

}


.chat-input-box textarea {

    flex: 1;

    width: 100%;

    min-height: 40px;

    max-height: 150px;

    resize: none;

    border: 0;

    box-shadow: none !important;

    outline: 0 !important;

    padding: 9px 5px;

    font-size: 14px;

}


.upload-btn {

    height: 40px;

    padding: 0 10px;

    border: 0;

    background: transparent;

    color: #475569;

    display: flex;

    align-items: center;

    gap: 5px;

    border-radius: 8px;

    cursor: pointer;

}


.upload-btn:hover {

    background: #f1f5f9;

}


.upload-btn i {

    font-size: 18px;

}


.upload-btn span {

    font-size: 12px;

}


.send-btn {

    width: 40px;
    height: 40px;

    border: 0;

    border-radius: 10px;

    background: #2563eb;

    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 19px;

    cursor: pointer;

}


.send-btn:hover {

    background: #1d4ed8;

}


.chat-disclaimer {

    text-align: center;

    font-size: 10px;

    line-height: 1.5;

    color: #94a3b8;

    margin-top: 7px;

}


/* =========================================================
   WORKSPACE
========================================================= */

.cdj-workspace {

    display: none;

    width: 100%;

    padding: 40px 5% 100px;

}


.workspace-header {

    width: 100%;

    max-width: 1400px;

    margin: 0 auto 28px;

    display: flex;

    align-items: center;

    gap: 16px;

}


.workspace-back {

    width: 47px;
    height: 47px;

    flex: 0 0 47px;

    border: 1px solid #e2e8f0;

    border-radius: 12px;

    background: #ffffff;

    color: #334155;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;

    cursor: pointer;

    transition: .2s ease;

}


.workspace-back:hover {

    background: #f8fafc;

    border-color: #cbd5e1;

}


.workspace-heading h2 {

    margin: 0;

    color: #0f172a;

    font-size: 29px;

    font-weight: 700;

}


.workspace-heading p {

    margin: 5px 0 0;

    color: #64748b;

    font-size: 14px;

}


/* =========================================================
   WORKSPACE CARD
========================================================= */

.workspace-card {

    width: 100%;

    max-width: 1400px;

    margin: 0 auto;

    padding: 34px;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 18px;

    box-shadow:
        0 5px 25px rgba(15,23,42,.045);

}


/* =========================================================
   WORKSPACE FORM
========================================================= */

.workspace-form {

    width: 100%;

}


.form-section-title {

    font-size: 15px;

    font-weight: 700;

    color: #0f172a;

    margin: 5px 0 20px;

}


.form-group {

    margin-bottom: 24px;

}


.form-label {

    display: block;

    margin-bottom: 8px;

    font-size: 14px;

    font-weight: 600;

    color: #1e293b;

}


.workspace-card .form-control,
.workspace-card .form-select {

    width: 100%;

    min-height: 48px;

    border: 1px solid #dbe2ea;

    border-radius: 11px;

    color: #1e293b;

    font-size: 14px;

    padding: 11px 13px;

    background: #ffffff;

}


.workspace-card textarea.form-control {

    min-height: 180px;

    resize: vertical;

    line-height: 1.65;

}


.workspace-card .form-control:focus,
.workspace-card .form-select:focus {

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37,99,235,.10);

}


.workspace-submit {

    min-height: 46px;

    padding: 10px 20px;

    border: 0;

    border-radius: 10px;

    background: #2563eb;

    color: #ffffff;

    font-size: 14px;

    font-weight: 600;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    cursor: pointer;

}


.workspace-submit:hover {

    background: #1d4ed8;

}


/* =========================================================
   UPLOAD
========================================================= */

.case-upload-box {

    width: 100%;

    min-height: 230px;

    border: 2px dashed #cbd5e1;

    border-radius: 15px;

    background: #f8fafc;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    text-align: center;

    cursor: pointer;

    transition: .2s ease;

}


.case-upload-box:hover {

    border-color: #2563eb;

    background: #f8fbff;

}


.case-upload-box i {

    font-size: 40px;

    color: #2563eb;

    margin-bottom: 12px;

}


.case-upload-box strong {

    font-size: 15px;

    color: #1e293b;

}


.case-upload-box span {

    margin-top: 5px;

    font-size: 12px;

    color: #64748b;

}


.selected-file {

    margin-top: 12px;

    padding: 10px 12px;

    background: #eff6ff;

    border-radius: 8px;

    color: #1d4ed8;

    font-size: 13px;

    display: none;

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1199px) {

    .cdj-sidebar {

        width: 280px;

        min-width: 280px;

    }

    .feature-grid {

        max-width: 950px;

    }

    .workspace-card,
    .workspace-header {

        max-width: 1100px;

    }

}


@media (max-width: 991px) {

    .cdj-sidebar {

        position: fixed;

        left: -320px;

        top: 0;

        width: 300px;

        min-width: 300px;

        transition: left .25s ease;

    }


    .cdj-sidebar.sidebar-open {

        left: 0;

    }


    .sidebar-overlay {

        display: none;

        position: fixed;

        inset: 0;

        background: rgba(15,23,42,.45);

        z-index: 90;

    }


    .sidebar-overlay.active {

        display: block;

    }


    .feature-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }


    .cdj-home {

        padding-left: 25px;

        padding-right: 25px;

    }


    .cdj-workspace {

        padding-left: 25px;

        padding-right: 25px;

    }

}


@media (max-width: 767px) {

    .cdj-navbar {

        height: 60px;

        min-height: 60px;

        padding: 0 12px;

    }


    .feature-grid {

        grid-template-columns: 1fr;

    }


    .cdj-home {

        padding:
            35px 15px 80px;

    }


    .home-header {

        margin-bottom: 28px;

    }


    .home-header h1 {

        font-size: 25px;

    }


    .home-header p {

        font-size: 13px;

    }


    .feature-card {

        min-height: 145px;

        padding: 20px;

    }


    .cdj-workspace {

        padding:
            25px 15px 90px;

    }


    .workspace-header {

        margin-bottom: 20px;

    }


    .workspace-heading h2 {

        font-size: 23px;

    }


    .workspace-heading p {

        font-size: 12px;

    }


    .workspace-card {

        padding: 20px;

        border-radius: 14px;

    }


    .workspace-card textarea.form-control {

        min-height: 150px;

    }


    .workspace-submit {

        width: 100%;

    }


    .chat-wrapper {

        padding:
            10px 10px 10px;

    }


    .upload-btn span {

        display: none;

    }

}
/* ==========================================================
   DRAFT RESULT
========================================================== */

.draft-result-box {
    width: 100%;
    margin-top: 25px;

    background: #ffffff;

    border: 1px solid #dce4ed;

    border-radius: 16px;

    overflow: hidden;

    box-shadow:
        0 8px 25px rgba(15, 23, 42, 0.05);
}


/* ==========================================================
   RESULT HEADER
========================================================== */

.draft-result-header {

    min-height: 64px;

    padding: 14px 20px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    background: #f8fafc;

    border-bottom: 1px solid #e5e7eb;
}


.draft-result-header strong {

    color: #17365d;

    font-size: 16px;

}


/* ==========================================================
   RESULT ACTIONS
========================================================== */

.draft-result-actions {

    display: flex;

    align-items: center;

    gap: 8px;
}


.draft-result-btn {

    border: 1px solid #d5dee9;

    background: #ffffff;

    color: #334155;

    border-radius: 8px;

    padding: 8px 13px;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition: 0.2s;
}


.draft-result-btn:hover {

    background: #f1f5f9;

}


/* ==========================================================
   RESULT TEXTAREA
========================================================== */

.draft-result-textarea {

    display: block;

    width: 100%;

    min-height: 650px;

    padding: 30px;

    border: 0;

    outline: 0;

    resize: vertical;

    background: #ffffff;

    color: #1e293b;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 15px;

    line-height: 1.85;
}


.draft-result-textarea:focus {

    outline: none;

    box-shadow: none;

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 767px) {

    .draft-result-header {

        align-items: flex-start;

        flex-direction: column;

    }


    .draft-result-actions {

        width: 100%;
    }


    .draft-result-btn {

        flex: 1;

        text-align: center;

    }


    .draft-result-textarea {

        min-height: 550px;

        padding: 20px;

        font-size: 14px;

    }

}
/* ============================================================
   SUBMISSION RESULT
   ============================================================ */

.submission-result-box {
    width: 100%;
    margin-top: 25px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.submission-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.submission-result-title {
    font-weight: 600;
    font-size: 15px;
}

.submission-result-title i {
    margin-right: 6px;
}

.submission-result-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.submission-action-btn {
    border: 1px solid #dbe2ea;
    background: #ffffff;
    border-radius: 7px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
}

.submission-action-btn:hover {
    background: #f8fafc;
}

.submission-result-textarea {
    display: block;
    width: 100%;
    min-height: 600px;
    resize: vertical;
    border: 0;
    outline: 0;
    padding: 22px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: #1e293b;
    background: #ffffff;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 767px) {

    .submission-result-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .submission-result-actions {
        width: 100%;
    }

    .submission-action-btn {
        flex: 1;
    }

    .submission-result-textarea {
        min-height: 500px;
        padding: 16px;
    }

}
.case-upload-box.has-file {
    border-color: #2563eb;
    background: #f8fbff;
}

.case-upload-box .selected-file {
    display: none;
    margin-top: 18px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #eef5ff;
    color: #173b7a;
    font-size: 14px;
}

.case-upload-box .selected-file i {
    color: #2563eb;
    margin-right: 5px;
}

.case-upload-box .selected-file span {
    color: #64748b;
}

/* ============================================================
   RICH TEXT EDITOR
   ============================================================ */

.rich-editor-wrapper {
    width: 100%;
    border: 1px solid #dbe2eb;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}


.rich-editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid #e5e9ef;
    background: #f8fafc;
}


.rich-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}


.rich-btn:hover {
    background: #e9eef5;
}


.rich-btn:active {
    background: #dfe7f1;
}


.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #dbe2eb;
    margin: 0 5px;
}


.rich-text-editor {
    min-height: 360px;
    max-height: 650px;
    overflow-y: auto;
    padding: 18px;
    outline: none;
    font-size: 15px;
    line-height: 1.75;
    color: #1e293b;
    background: #ffffff;
}


.rich-text-editor:focus {
    box-shadow:
        inset 0 0 0 2px rgba(40, 100, 232, 0.08);
}


.rich-text-editor:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}


.editor-help-text {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
}


/* ============================================================
   ANALYSIS RESULT
   ============================================================ */

.analysis-result-box {
    width: 100%;
    margin-top: 30px;
    border: 1px solid #dfe5ed;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}


.analysis-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e9ef;
}


.analysis-result-content {
    padding: 25px;
    font-size: 15px;
    line-height: 1.85;
    color: #26344d;
    overflow-wrap: anywhere;
}


.analysis-error {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 10px;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
}