/* Legal Advisory Result Page - match /home compact design */

.ml-ai-page,
.ml-ai-page * {
    box-sizing: border-box;
}

.ml-ai-page {
    --ml-text: #334155;
    --ml-muted: #64748b;
    --ml-dark: #1e293b;
    --ml-border: #e2e8f0;
    --ml-soft: #f8fafc;
    --ml-pink: #f06292;
    --ml-pink-dark: #e91e63;
    --ml-gold: #f5b400;
    --ml-hero-bg: #575756;

    background: #ffffff;
    color: var(--ml-text);
    font-family: inherit;
    overflow-x: hidden;
    padding: 0 0 24px;
}

.ml-ai-page,
.ml-ai-page * {
    font-family: inherit;
}

/* Force icon fonts */
.ml-ai-page .feather-menu,
.ml-ai-page .feather-x,
.ml-ai-page [class^="feather-"],
.ml-ai-page [class*=" feather-"] {
    font-family: feather !important;
}

.ml-ai-page [class^="jvic-"],
.ml-ai-page [class*=" jvic-"] {
    font-family: jv-icons !important;
}

.ml-ai-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* Top ask section same as /home */
.ml-ai-search {
    width: 100vw;
    min-height: clamp(340px, 32vw, 510px);
    margin: 0 calc(50% - 50vw) 30px;
    padding: clamp(58px, 8vw, 112px) max(24px, calc((100vw - 1180px) / 2));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ml-hero-bg);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
}

.ml-ai-search h1 {
    margin: 0 0 42px;
    color: #ffffff;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0;
}

.ml-ai-search-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: min(980px, 100%);
    min-height: 64px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.ml-ai-search-row button {
    flex: 0 0 auto;
    min-width: 166px;
    height: 64px;
    padding: 0 28px;
    border: 0;
    background: var(--ml-pink);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    /* Hover handled by theme effects */
}

.ml-ai-search-row textarea {
    flex: 1 1 auto;
    width: 100%;
    height: 64px;
    min-height: 64px;
    max-height: 140px;
    padding: 21px 24px;
    border: 0;
    outline: 0;
    resize: none;
    color: var(--ml-dark);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    background: #ffffff;
}

.ml-ai-search-row textarea::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Result layout */
.ml-ai-result-grid {
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr) minmax(320px, 390px);
    gap: 36px;
    align-items: start;
}

/* Left law firm cards */
.ml-ai-firms,
.ml-ai-lawyers {
    min-width: 0;
}

.ml-ai-firm-list,
.ml-ai-lawyer-list {
    display: grid;
    gap: 14px;
    width: 100%;
}

.ml-ai-firm-card,
.ml-ai-lawyer-card,
.ml-ai-answer-card,
.ml-ai-disclaimer {
    background: #ffffff;
    border: 1px solid var(--ml-border);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.ml-ai-firm-card,
.ml-ai-lawyer-card {
    width: 100%;
}

/* Firm card */
.ml-ai-firm-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
}

.ml-ai-firm-photo {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ml-dark);
    font-size: 22px;
    font-weight: 800;
}

.ml-ai-firm-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ml-ai-firm-info {
    min-width: 0;
}

.ml-ai-firm-card h2 {
    margin: 0 0 6px;
    color: var(--ml-dark);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.25;
}

.ml-ai-firm-card h2 a {
    color: inherit;
    text-decoration: none;
}

.ml-ai-firm-card h2 a:hover,
.ml-ai-firm-card h2 a:focus {
    color: var(--ml-pink-dark);
}

.ml-ai-firm-card p {
    margin: 0 0 6px;
    color: var(--ml-muted);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.45;
}

.ml-ai-firm-card p:last-child {
    margin-bottom: 0;
}

.ml-ai-firm-status {
    color: #dc2626 !important;
    font-weight: 700 !important;
}

.ml-ai-firm-status.is-open {
    color: #16a34a !important;
}

/* Main answer */
.ml-ai-answer-area {
    min-width: 0;
}

.ml-ai-answer-card {
    position: relative;
    padding: 22px 26px;
    border-top: 4px solid var(--ml-gold);
}

.ml-ai-answer-text {
    color: #475569;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    white-space: pre-line;
}

.ml-ai-answer-text strong {
    color: var(--ml-dark);
    font-weight: 800;
}

.ml-ai-empty {
    margin: 0;
    color: var(--ml-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* Disclaimer */
.ml-ai-disclaimer {
    margin-top: 14px;
    padding: 14px 16px;
    background: #fff7ed;
    border-color: #fed7aa;
    box-shadow: none;
}

.ml-ai-disclaimer h2 {
    margin: 0 0 6px;
    color: #9a3412;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.2;
}

.ml-ai-disclaimer p {
    margin: 0;
    color: #7c2d12;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.5;
}

/* Right lawyer cards */
.ml-ai-lawyer-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
}

.ml-ai-lawyer-photo {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ml-dark);
    font-size: 22px;
    font-weight: 800;
}

.ml-ai-lawyer-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 24%;
}

.ml-ai-lawyer-info {
    min-width: 0;
}

.ml-ai-lawyer-info h2 {
    margin: 0 0 8px;
    color: var(--ml-dark);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.18;
}

.ml-ai-lawyer-info h2 a {
    color: inherit;
    text-decoration: none;
}

.ml-ai-lawyer-info h2 a:hover,
.ml-ai-lawyer-info h2 a:focus {
    color: var(--ml-pink-dark);
}

.ml-ai-lawyer-info p {
    margin: 0 0 8px;
    color: var(--ml-muted);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
}

.ml-ai-lawyer-info p:nth-of-type(2) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
}

.ml-ai-lawyer-contact {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef2f7;
    display: grid;
    gap: 5px;
    color: #d97706;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

/* Hover effects are now handled by .ml-theme-hover-lift class */

/* Responsive */
@media (max-width: 1200px) {
    .ml-ai-result-grid {
        grid-template-columns: 1fr;
    }

    .ml-ai-firm-list,
    .ml-ai-lawyer-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .ml-ai-page {
        padding: 0 0 26px;
    }

    .ml-ai-shell {
        width: min(100% - 24px, 1180px);
    }

    .ml-ai-search {
        min-height: 340px;
        padding: 52px 16px;
        margin-bottom: 24px;
    }

    .ml-ai-search h1 {
        margin-bottom: 28px;
        font-size: 28px;
    }

    .ml-ai-search-row {
        display: grid;
        grid-template-columns: 1fr;
        width: min(100%, 520px);
        border-radius: 14px;
    }

    .ml-ai-search-row textarea {
        order: 1;
        height: 54px;
        min-height: 54px;
        max-height: 120px;
        padding: 17px 18px;
        font-size: 13px;
    }

    .ml-ai-search-row button {
        order: 2;
        width: 100%;
        height: 50px;
    }

    .ml-ai-answer-card {
        padding: 20px;
    }

    .ml-ai-answer-text {
        font-size: 14px;
        line-height: 1.6;
    }

    .ml-ai-firm-list,
    .ml-ai-lawyer-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .ml-ai-lawyer-card {
        text-align: center;
    }

    .ml-ai-lawyer-photo {
        margin: 0;
    }
}
