@font-face { font-family: 'IRANSans'; src: url('../fonts/IRANSans.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
:root {
    --ink: #172033;
    --muted: #748097;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --surface: #ffffff;
    --canvas: #f6f8fc;
    --line: #e6eaf2;
    --soft-primary: #eef0ff;
    --shadow: 0 18px 55px rgba(34, 45, 79, .10);
}

html, body { min-height: 100%; margin: 0; background: var(--canvas); color: var(--ink); font-family: 'IRANSans', Tahoma, Arial, sans-serif; }
body { direction: rtl; }
*, *::before, *::after { box-sizing: border-box; }
a { color: inherit; }
.app-background { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 8% 5%, rgba(99, 102, 241, .12), transparent 27rem), var(--canvas); }
.app-header { display: flex; align-items: center; min-height: 78px; padding: 1rem clamp(1rem, 4vw, 4rem); }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #6366f1, #4338ca); box-shadow: 0 10px 22px rgba(79, 70, 229, .28); font-size: 1.3rem; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; font-weight: 800; }
.brand small { color: var(--muted); font-size: .7rem; margin-top: .1rem; }
.app-content { flex: 1; display: flex; flex-direction: column; }
.app-footer { padding: 1rem; color: #9aa4b7; text-align: center; font-size: .72rem; }
.auth-page { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); max-width: 1260px; width: 100%; margin: auto; padding: 2rem clamp(1rem, 5vw, 4rem) 4rem; gap: clamp(2rem, 7vw, 7rem); align-items: center; }
.auth-visual { position: relative; min-height: 560px; align-items: center; overflow: hidden; border-radius: 36px; padding: clamp(2rem, 5vw, 5rem); background: linear-gradient(145deg, #211d68, #4f46e5 60%, #818cf8); color: #fff; box-shadow: var(--shadow); }
.visual-content { position: relative; z-index: 1; max-width: 480px; }
.visual-content h2 { margin: 1rem 0; font-size: clamp(2.4rem, 5vw, 4.5rem); line-height: 1.25; letter-spacing: -.06em; font-weight: 800; }
.visual-content p { max-width: 390px; color: rgba(255,255,255,.77); line-height: 2; }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .03em; }
.visual-points { display: grid; gap: .8rem; margin-top: 2rem; color: rgba(255,255,255,.88); font-size: .86rem; }
.visual-points i { color: #a5f3fc; margin-left: .4rem; }
.visual-orbit { position: absolute; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.orbit-one { width: 560px; height: 560px; inset: -200px auto auto -170px; }
.orbit-two { width: 390px; height: 390px; inset: auto -170px -170px auto; }
.auth-card-wrap { display: flex; justify-content: center; }
.auth-card { width: min(100%, 470px); padding: clamp(1.5rem, 4vw, 3rem); background: var(--surface); border: 1px solid rgba(230,234,242,.82); border-radius: 28px; box-shadow: var(--shadow); }
.auth-card h1, .auth-card h2 { margin: .9rem 0 .5rem; font-weight: 800; letter-spacing: -.035em; }
.auth-card h1 { font-size: clamp(1.55rem, 3vw, 2rem); }
.auth-card h2 { font-size: 2rem; }
.auth-description { color: var(--muted); line-height: 1.95; margin-bottom: 2rem; font-size: .9rem; }
.auth-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 1.3rem; border-radius: 18px; color: var(--primary); background: var(--soft-primary); font-size: 1.35rem; }
.mobile-brand { display: flex; align-items: center; gap: .65rem; margin-bottom: 2rem; }
.form-label { color: #344054; font-size: .82rem; font-weight: 700; margin-bottom: .55rem; }
.form-control, .input-group-text { border-color: var(--line); }
.form-control { color: var(--ink); }
.form-control::placeholder { color: #aeb6c6; }
.form-control:focus { border-color: #818cf8; box-shadow: 0 0 0 .25rem rgba(99,102,241,.13); }
.input-group-text { color: var(--muted); background: #fafbfe; font-size: .88rem; }
.ltr-input input { direction: ltr; text-align: left; }
.form-hint { display: block; color: #98a2b3; margin-top: .5rem; font-size: .7rem; }
.validation-message { color: #dc3545; margin-top: .4rem; font-size: .74rem; }
.soft-alert { border: 0; border-radius: 13px; font-size: .78rem; }
.submit-button { padding: .82rem 1rem; border: 0; background: linear-gradient(135deg, #6366f1, #4338ca); box-shadow: 0 10px 20px rgba(79,70,229,.2); transition: transform .2s, box-shadow .2s; }
.submit-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 25px rgba(79,70,229,.27); }
.code-input { direction: ltr; text-align: center; letter-spacing: .75rem; font-size: 1.4rem; font-weight: 700; padding-left: .1rem; }
.center-page { flex: 1; display: grid; place-items: center; padding: 2rem 1rem 4rem; }
.verify-card { text-align: center; }
.verify-card .auth-icon { margin-inline: auto; }
.verify-card .auth-description { margin-bottom: 1.5rem; }
.stepper { display: flex; align-items: center; justify-content: center; direction: ltr; margin-bottom: 2.1rem; }
.step { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #dce1ed; border-radius: 50%; color: #a1a9b9; font-size: .75rem; }
.step.current { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 5px 14px rgba(79,70,229,.25); }
.step.done { color: #fff; background: #22c55e; border-color: #22c55e; }
.step-line { width: 55px; height: 2px; background: #e6eaf2; }
.step-line.active { background: #a5b4fc; }
.chat-page { width: min(100%, 1000px); margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2rem) 2rem; }
.chat-header-card { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 1rem 0 1.2rem; }
.chat-header-card h1 { margin: .4rem 0; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.04em; }
.chat-header-card p { color: var(--muted); margin: 0; font-size: .82rem; }
.chat-status { display: inline-flex; align-items: center; gap: .4rem; color: #667085; white-space: nowrap; font-size: .75rem; }
.chat-status span { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.13); }
.chat-window { min-height: 470px; max-height: calc(100vh - 300px); overflow-y: auto; padding: clamp(1rem, 3vw, 2rem); background: rgba(255,255,255,.72); border: 1px solid rgba(230,234,242,.86); border-radius: 28px; box-shadow: 0 12px 35px rgba(34,45,79,.05); }
.chat-empty { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.chat-empty-icon { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 1rem; border-radius: 24px; color: var(--primary); background: var(--soft-primary); font-size: 1.5rem; }
.chat-empty h2 { margin: 0 0 .45rem; font-size: 1.25rem; font-weight: 800; }
.chat-empty p { color: var(--muted); margin-bottom: 1.25rem; font-size: .8rem; }
.suggestion-list { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; max-width: 650px; }
.suggestion-chip { border: 1px solid #dfe3ef; border-radius: 999px; padding: .55rem .85rem; color: #566078; background: #fff; font: inherit; font-size: .75rem; transition: .2s; }
.suggestion-chip:hover { color: var(--primary); border-color: #a5b4fc; background: #f5f6ff; }
.messages-list { display: grid; gap: 1.3rem; }
.answer-card { display: grid; gap: .5rem; }
.answer-page { padding-block: .55rem; }
.answer-page + .answer-page { border-top: 1px dashed var(--line); }
.answer-page-label {
    margin-bottom: .35rem;
    color: var(--primary);
    font-size: .64rem;
    font-weight: 800;
}
.answer-page-label + .message-text { margin-top: 0; }
.pager-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    justify-self: end;
    margin-inline-start: 2.9rem;
    padding: .5rem 1.1rem;
    border: 1px solid #dcdcf7;
    border-radius: 999px;
    background: linear-gradient(135deg, #f2f3ff, #ffffff);
    color: var(--primary);
    font-size: .73rem;
    font-weight: 700;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pager-more:hover:not(:disabled) { transform: translateY(-1px); border-color: #c3c4f0; box-shadow: 0 8px 18px rgba(79,70,229,.16); }
.pager-more:disabled { opacity: .6; cursor: wait; }
.pager-more:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.pager-note { display: inline-flex; align-items: center; gap: .4rem; margin-inline-start: 2.9rem; padding: .45rem .8rem; border-radius: 11px; font-size: .71rem; }
.pager-note.is-error { background: #fef3f2; color: #b42318; }
.ad-card {
    display: grid;
    grid-template-columns: minmax(0, 168px) minmax(0, 1fr);
    gap: .9rem;
    margin: .35rem 0 1.4rem;
    padding: .7rem;
    border: 1px solid #e3e5f4;
    border-radius: 18px;
    background: linear-gradient(135deg, #fbfbff, #f4f5fd);
    box-shadow: 0 10px 26px rgba(34, 45, 79, .06);
    overflow: hidden;
}
.ad-card-media { position: relative; border-radius: 13px; overflow: hidden; background: #eef0f8; min-height: 108px; }
.ad-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-card-badge {
    position: absolute;
    inset-block-start: .4rem;
    inset-inline-start: .4rem;
    padding: .12rem .5rem;
    border-radius: 999px;
    background: rgba(23, 32, 51, .72);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
}
.ad-card-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.ad-card-title { font-size: .85rem; font-weight: 800; color: var(--ink); }
.ad-card-text { margin: 0; color: #5c6679; font-size: .75rem; line-height: 1.95; }
.ad-card-action {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: auto;
    padding: .42rem .95rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 16px rgba(79, 70, 229, .22);
    transition: transform .18s, box-shadow .18s;
}
.ad-card-action:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 22px rgba(79, 70, 229, .3); }
@media (max-width: 575.98px) {
    .ad-card { grid-template-columns: 1fr; }
    .ad-card-media { min-height: 150px; }
}
.message-row { display: flex; align-items: flex-start; gap: .75rem; max-width: 88%; }
.user-message { margin-right: auto; flex-direction: row-reverse; }
.assistant-message { margin-left: auto; }
.message-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; color: #fff; background: var(--primary); font-size: .8rem; font-weight: 800; }
.user-message .message-avatar { background: #0f766e; }
.message-bubble { padding: .82rem 1rem; border: 1px solid var(--line); border-radius: 18px; border-top-right-radius: 5px; background: #fff; box-shadow: 0 7px 18px rgba(34,45,79,.04); }
.user-message .message-bubble { border-top-right-radius: 18px; border-top-left-radius: 5px; background: #f0fdfa; border-color: #ccfbf1; }
.message-label { margin-bottom: .35rem; color: #8a94a7; font-size: .67rem; font-weight: 700; }
.message-text { white-space: pre-wrap; color: #344054; line-height: 2; font-size: .84rem; }
.composer-wrap { margin-top: 1rem; }
.composer { display: flex; align-items: end; gap: .65rem; padding: .65rem; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 12px 30px rgba(34,45,79,.07); }
.composer-input { resize: none; max-height: 130px; border: 0; box-shadow: none !important; padding: .65rem .75rem; line-height: 1.8; }
.send-button { display: grid; place-items: center; flex: 0 0 auto; width: 43px; height: 43px; border: 0; border-radius: 14px; color: #fff; background: var(--primary); font-size: 1.05rem; transition: .2s; }
.send-button:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); }
.send-button:disabled { cursor: not-allowed; opacity: .45; }
.composer-hint { display: flex; align-items: center; gap: .35rem; margin-top: .55rem; padding-inline: .4rem; color: #98a2b3; font-size: .68rem; }
.chat-actions { display: flex; justify-content: center; margin-top: .35rem; }
.typing-dots { display: flex; gap: .28rem; padding: .5rem 0 .1rem; direction: ltr; }
.typing-dots span { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: bounce 1s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.7); opacity: .55; } 40% { transform: scale(1); opacity: 1; } }
.empty-state-card { display: grid; place-items: center; gap: .8rem; width: min(92%, 460px); margin: auto; padding: 3rem 1.5rem; border-radius: 28px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.empty-state-card h1 { margin: 0; font-size: 1.3rem; }
.empty-state-icon { color: var(--primary); font-size: 2rem; font-weight: 800; }
.loading-screen h1 { margin: 0; padding: 0 1rem; text-align: center; color: var(--ink); font-size: 1rem; font-weight: 800; }
.loading-screen p { margin: 0; padding: 0 1rem; text-align: center; }
.loading-screen { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 1rem; color: var(--muted); font-size: .8rem; }
#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 4px rgba(0,0,0,.12); display: none; left: 0; padding: .75rem 1rem; position: fixed; width: 100%; z-index: 1000; font-size: .8rem; }
#blazor-error-ui .dismiss { cursor: pointer; float: left; }
@media (max-width: 767.98px) {
    .app-header { min-height: 67px; padding: .75rem 1rem; }
    .auth-page { grid-template-columns: 1fr; padding-top: 1rem; }
    .auth-card { border-radius: 24px; }
    .chat-header-card { align-items: flex-start; flex-direction: column; }
    .chat-window { min-height: 430px; max-height: none; border-radius: 22px; }
    .message-row { max-width: 100%; }
}

button, input, textarea { font-family: inherit; }
.search-workspace {
    display: grid;
    grid-template-columns: minmax(255px, 285px) minmax(0, 1fr);
    gap: clamp(1rem, 2.5vw, 2rem);
    align-items: start;
    width: min(100%, 1380px);
    margin: 0 auto;
    padding: 1rem clamp(1rem, 3vw, 2rem) 2rem;
}
.search-workspace .chat-page { width: 100%; min-width: 0; padding: 0; }
.history-panel {
    position: sticky;
    top: 1.25rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-height: calc(100dvh - 2.5rem);
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid #e9eaf3;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(31, 37, 83, .06);
}
.history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1.2rem 1.2rem 1rem;
    background: linear-gradient(155deg, #f5f5ff, #fff 75%);
}
.history-heading-main { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.history-heading-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--primary);
    background: #e9e9ff;
    font-size: 1.1rem;
}
.history-heading-copy { display: grid; min-width: 0; gap: .12rem; }
.history-heading-copy strong { font-size: .91rem; font-weight: 800; }
.history-heading-copy small { color: var(--muted); font-size: .68rem; }
.history-toggle {
    display: none;
    flex: 0 0 auto;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: #f1f1fc;
    color: var(--primary);
}
.history-body { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: .3rem .55rem .8rem; }
.history-list { flex: 1; min-height: 0; overflow-y: auto; padding: .25rem .2rem .4rem; scrollbar-color: #d9daf1 transparent; scrollbar-width: thin; }
.history-group-label { padding: .95rem .7rem .38rem; color: #959db0; font-size: .68rem; font-weight: 700; }
.history-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    min-height: 72px;
    margin: .12rem 0;
    padding: .65rem .7rem;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: #344054;
    text-align: right;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .18s;
}
.history-item:hover { background: #f6f6fe; transform: translateX(-2px); }
.history-item.active { border-color: #dbdcfa; background: #efefff; color: #302b8d; }
.history-item:focus-visible, .history-more:focus-visible, .history-toggle:focus-visible, .history-retry:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.history-item:disabled { cursor: wait; opacity: .7; }
.history-item-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 33px;
    height: 33px;
    border-radius: 11px;
    background: #f0f1fa;
    color: #858ba8;
    font-size: .85rem;
}
.history-item.active .history-item-icon { background: #dedffd; color: var(--primary); }
.history-item-content { display: block; min-width: 0; flex: 1; }
.history-item-content strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.8;
    font-size: .75rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.history-item-content small { display: block; margin-top: .2rem; color: #9aa2b5; font-size: .66rem; direction: ltr; text-align: right; }
.history-item-arrow { color: #aab0c5; font-size: .7rem; }
.history-item.active .history-item-arrow { color: var(--primary); }
.history-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: calc(100% - .4rem);
    min-height: 38px;
    margin: .4rem .2rem 0;
    border: 1px solid #e4e6f0;
    border-radius: 11px;
    background: #fff;
    color: var(--primary);
    font-size: .72rem;
    font-weight: 700;
}
.history-more:hover { background: #f7f7ff; border-color: #d5d6f5; }
.history-more:disabled { opacity: .55; cursor: wait; }
.history-feedback { display: grid; justify-items: center; gap: .5rem; margin: 1rem .25rem; padding: 1.7rem .8rem; border-radius: 18px; background: #f8f9fd; text-align: center; }
.history-feedback > i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--primary); background: #e9e9ff; font-size: 1.05rem; }
.history-feedback strong { font-size: .77rem; }
.history-feedback p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.9; }
.history-retry { padding: .3rem .8rem; border: 1px solid #d9daf8; border-radius: 10px; background: #fff; color: var(--primary); font-size: .7rem; }
.history-skeleton { display: grid; gap: .8rem; padding: 1.2rem .65rem; }
.history-skeleton span { height: 52px; border-radius: 12px; background: linear-gradient(100deg, #f3f4f8 20%, #e9ebf3 45%, #f3f4f8 70%); background-size: 200% 100%; animation: history-shimmer 1.5s linear infinite; }
@keyframes history-shimmer { to { background-position-x: -200%; } }
.history-detail { display: grid; gap: 1.2rem; }
.history-detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.history-detail-title { display: grid; gap: .25rem; }
.history-detail-title strong { color: var(--ink); font-size: .85rem; font-weight: 800; }
.history-detail-title strong i { color: var(--primary); margin-left: .3rem; }
.history-detail-title small { color: var(--muted); font-size: .68rem; direction: ltr; text-align: right; }
.history-detail .message-row { max-width: 100%; }
@media (max-width: 900px) {
    .search-workspace { grid-template-columns: 1fr; gap: .7rem; }
    .history-panel { position: static; max-height: none; margin-top: 0; border-radius: 18px; }
    .history-heading { padding: .75rem .9rem; }
    .history-heading-icon { width: 36px; height: 36px; border-radius: 11px; }
    .history-heading-copy small { display: none; }
    .history-toggle { display: grid; }
    .history-body { display: none; }
    .history-body.is-open { display: flex; }
    .history-list { max-height: 290px; }
    .search-workspace .chat-header-card { margin-top: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .history-item { transition: none; }
    .history-skeleton span { animation: none; }
}

/* ---------- Subscription & quota ---------- */
.app-header { justify-content: space-between; }
.app-nav { display: flex; align-items: center; gap: .5rem; }
.app-nav-link { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border: 1px solid #e3e5f4; border-radius: 999px; background: #fff; color: var(--primary); font-size: .78rem; font-weight: 700; text-decoration: none; box-shadow: 0 6px 16px rgba(34,45,79,.05); transition: transform .18s, box-shadow .18s, border-color .18s; }
.app-nav-link:hover { transform: translateY(-1px); border-color: #c3c4f0; box-shadow: 0 10px 20px rgba(79,70,229,.14); }
.quota-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: -.35rem 0 1rem; }
.quota-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .8rem; border: 1px solid #e3e5f4; border-radius: 999px; background: #fff; color: #4c5568; font-size: .72rem; font-weight: 700; }
.quota-chip.is-muted { color: var(--muted); background: #f8f9fd; }
.quota-chip.is-sub { color: #067647; background: #ecfdf3; border-color: #bbf7d0; }
.quota-chip.is-cta { color: #fff; background: linear-gradient(135deg, #6366f1, #4338ca); border: 0; text-decoration: none; box-shadow: 0 8px 16px rgba(79,70,229,.22); }
.quota-chip.is-cta:hover { color: #fff; }
.quota-exceeded-card { display: flex; align-items: center; gap: 1rem; margin-top: .9rem; padding: 1rem 1.1rem; border: 1px solid #fed7aa; border-radius: 18px; background: linear-gradient(135deg, #fffbf5, #fff7ed); }
.quota-exceeded-icon { display: grid; flex: 0 0 auto; place-items: center; width: 46px; height: 46px; border-radius: 15px; color: #c2410c; background: #ffedd5; font-size: 1.25rem; }
.quota-exceeded-body { flex: 1; min-width: 0; }
.quota-exceeded-body strong { display: block; font-size: .86rem; font-weight: 800; color: #7c2d12; }
.quota-exceeded-body p { margin: .25rem 0 0; color: #9a3412; font-size: .76rem; line-height: 1.9; }
.quota-exceeded-action { flex: 0 0 auto; padding: .5rem 1.05rem; border-radius: 999px; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; font-size: .74rem; font-weight: 700; text-decoration: none; box-shadow: 0 8px 16px rgba(79,70,229,.22); }
.quota-exceeded-action:hover { color: #fff; }
.subscription-page { width: min(100%, 1120px); margin: 0 auto; padding: 1.2rem clamp(1rem, 4vw, 2rem) 3rem; }
.subscription-hero { display: grid; gap: .55rem; margin-bottom: 1.6rem; }
.subscription-hero h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -.04em; }
.subscription-hero p { margin: 0; max-width: 640px; color: var(--muted); font-size: .86rem; line-height: 2; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; margin-top: .35rem; color: var(--primary); font-size: .78rem; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--primary-dark); }
.subscription-loading { display: grid; place-items: center; gap: 1rem; padding: 4rem 1rem; color: var(--muted); font-size: .82rem; }
.status-card { margin-bottom: 2rem; padding: 1.4rem clamp(1rem, 3vw, 1.8rem); border: 1px solid #e6eaf2; border-radius: 24px; background: #fff; box-shadow: 0 14px 38px rgba(34,45,79,.06); }
.status-card.is-active { border-color: #bbf7d0; background: linear-gradient(150deg, #f6fffa, #fff 60%); }
.status-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.status-card-head h2 { margin: .45rem 0 .2rem; font-size: 1.3rem; font-weight: 800; }
.status-card-head small { color: var(--muted); font-size: .74rem; }
.status-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; background: #f1f2f8; color: #5b6478; font-size: .68rem; font-weight: 800; }
.status-badge.active { color: #067647; background: #ecfdf3; }
.quota-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-top: 1.3rem; }
.quota-item { display: grid; gap: .2rem; padding: .9rem 1rem; border: 1px solid #eceef6; border-radius: 16px; background: #fafbff; }
.quota-label { color: #8a94a7; font-size: .68rem; font-weight: 700; }
.quota-item strong { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.quota-item strong small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.quota-note { color: #98a2b3; font-size: .65rem; }
.status-message { display: flex; align-items: center; gap: .45rem; margin-top: 1rem; padding: .6rem .85rem; border-radius: 12px; background: #fff7ed; color: #9a3412; font-size: .74rem; }
.plans-title { margin: 0 0 1rem; font-size: 1.15rem; font-weight: 800; }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: .6rem; padding: 1.5rem 1.3rem; border: 1px solid #e6eaf2; border-radius: 24px; background: #fff; box-shadow: 0 12px 32px rgba(34,45,79,.05); overflow: hidden; }
.plan-card.is-featured { border-color: #c7d2fe; box-shadow: 0 18px 45px rgba(79,70,229,.16); }
.plan-ribbon { position: absolute; inset-block-start: 0; inset-inline-end: 0; padding: .3rem .9rem; border-end-start-radius: 14px; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; font-size: .65rem; font-weight: 800; }
.plan-title { margin: 0; font-size: 1.15rem; font-weight: 800; }
.plan-desc { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.9; min-height: 2.6rem; }
.plan-price { display: grid; margin: .3rem 0 .5rem; }
.plan-price strong { font-size: 1.6rem; font-weight: 800; color: var(--primary-dark); }
.plan-price span { color: var(--muted); font-size: .7rem; }
.plan-features { display: grid; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.plan-features li { display: flex; align-items: center; gap: .5rem; color: #4c5568; font-size: .76rem; line-height: 1.8; }
.plan-features i { color: #22c55e; font-size: .85rem; }
.plan-buy { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; margin-top: auto; padding: .7rem 1rem; border: 0; border-radius: 14px; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; font: inherit; font-size: .8rem; font-weight: 700; box-shadow: 0 10px 20px rgba(79,70,229,.2); transition: transform .18s, box-shadow .18s; }
.plan-buy:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 25px rgba(79,70,229,.27); }
.plan-buy:disabled { cursor: wait; opacity: .65; }
.result-card { text-align: center; }
.result-card h1 { margin: .9rem 0 .5rem; font-size: 1.5rem; font-weight: 800; }
.result-icon { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto .5rem; border-radius: 24px; font-size: 2rem; }
.result-icon.is-pending { color: var(--primary); background: var(--soft-primary); }
.result-icon.is-success { color: #16a34a; background: #ecfdf3; }
.result-icon.is-failed { color: #dc2626; background: #fef2f2; }
.result-details { display: grid; gap: .55rem; margin: 1.2rem 0 1.4rem; padding: 1rem; border: 1px solid #eceef6; border-radius: 16px; background: #fafbff; text-align: right; }
.result-details > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .78rem; }
.result-details dt { color: var(--muted); font-weight: 700; }
.result-details dd { margin: 0; color: var(--ink); font-weight: 800; }
@media (max-width: 900px) { .plans-grid { grid-template-columns: 1fr; } .quota-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .quota-grid { grid-template-columns: 1fr; } .quota-exceeded-card { flex-direction: column; align-items: stretch; text-align: center; } }

/* ---------- Expert support ---------- */
.expert-ask-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    justify-self: end;
    margin-inline-start: 2.9rem;
    padding: .55rem 1.25rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(217, 119, 6, .32);
    animation: expert-pulse 2.2s ease-in-out infinite;
    transition: transform .18s, box-shadow .18s;
}
.expert-ask-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(217, 119, 6, .42); }
.expert-ask-btn:disabled { cursor: default; animation: none; opacity: .85; }
.expert-ask-btn:focus-visible { outline: 3px solid #fcd34d; outline-offset: 2px; }
.expert-ask-glow { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,.55) 45%, transparent 70%); transform: translateX(-120%); animation: expert-shine 2.6s ease-in-out infinite; }
@keyframes expert-pulse {
    0%, 100% { box-shadow: 0 10px 22px rgba(217, 119, 6, .28); }
    50% { box-shadow: 0 10px 26px rgba(217, 119, 6, .55); }
}
@keyframes expert-shine { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .expert-ask-btn, .expert-ask-glow { animation: none; } }
.expert-page { width: min(100%, 1240px); margin: 0 auto; padding: 1.2rem clamp(1rem, 4vw, 2rem) 2.5rem; }
.expert-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.expert-hero h1 { margin: .35rem 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.04em; }
.expert-hero p { margin: 0; color: var(--muted); font-size: .82rem; }
.expert-body { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.expert-requests { display: flex; flex-direction: column; gap: .6rem; padding: .9rem; border: 1px solid #e9eaf3; border-radius: 22px; background: #fff; box-shadow: 0 14px 40px rgba(31, 37, 83, .06); }
.expert-requests-head { display: grid; gap: .6rem; }
.expert-requests-head strong { font-size: .88rem; font-weight: 800; }
.expert-filter { display: flex; flex-wrap: wrap; gap: .35rem; }
.expert-filter-btn { padding: .32rem .75rem; border: 1px solid #e4e6f0; border-radius: 999px; background: #fff; color: #5b6478; font: inherit; font-size: .7rem; font-weight: 700; }
.expert-filter-btn.active { border-color: #c7d2fe; background: #eef0ff; color: var(--primary); }
.expert-request-list { display: grid; gap: .4rem; max-height: 68vh; overflow-y: auto; padding-inline-end: .15rem; }
.expert-request-item { display: grid; gap: .35rem; width: 100%; padding: .7rem .8rem; border: 1px solid transparent; border-radius: 15px; background: #fafbff; text-align: right; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.expert-request-item:hover { background: #f3f4ff; transform: translateX(-2px); }
.expert-request-item.active { border-color: #c7d2fe; background: #eef0ff; }
.expert-request-item strong { font-size: .76rem; font-weight: 700; line-height: 1.9; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.expert-request-item small { color: #98a2b3; font-size: .66rem; }
.expert-request-status { justify-self: start; padding: .14rem .55rem; border-radius: 999px; font-size: .62rem; font-weight: 800; background: #f1f2f8; color: #5b6478; }
.expert-request-status.is-pending { background: #fff7ed; color: #b45309; }
.expert-request-status.is-answered { background: #ecfdf3; color: #067647; }
.expert-request-status.is-closed { background: #f2f4f7; color: #667085; }
.expert-conversation { display: grid; gap: .8rem; min-height: 460px; padding: clamp(1rem, 3vw, 1.6rem); border: 1px solid #e9eaf3; border-radius: 22px; background: #fff; box-shadow: 0 14px 40px rgba(31, 37, 83, .06); }
.expert-conversation-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.expert-conversation-head h2 { margin: .45rem 0 .25rem; font-size: 1.05rem; font-weight: 800; }
.expert-conversation-head small { color: var(--muted); font-size: .72rem; }
.expert-assigned { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: #eef0ff; color: var(--primary); font-size: .7rem; font-weight: 800; }
.expert-context { border: 1px solid #e9eaf3; border-radius: 14px; background: #fafbff; padding: .6rem .8rem; }
.expert-context summary { cursor: pointer; color: var(--primary); font-size: .76rem; font-weight: 800; }
.expert-context-page { padding-top: .6rem; }
.expert-context-page > span { color: #98a2b3; font-size: .66rem; font-weight: 700; }
.expert-related { display: grid; gap: .4rem; padding-top: .6rem; }
.expert-related-item { display: grid; gap: .15rem; padding: .5rem .65rem; border-radius: 11px; background: #fff; border: 1px solid #eef0f8; }
.expert-related-item strong { font-size: .74rem; }
.expert-related-item small { color: #98a2b3; font-size: .64rem; }
.expert-thread { display: grid; gap: .8rem; max-height: 52vh; overflow-y: auto; padding-inline-end: .2rem; }
.expert-bubble { padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 16px; background: #fbfcff; }
.expert-bubble.is-user { background: #f0fdfa; border-color: #ccfbf1; }
.expert-bubble.is-expert { background: #eef0ff; border-color: #dcdcf7; }
.expert-bubble-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; }
.expert-bubble-head strong { font-size: .74rem; font-weight: 800; }
.expert-bubble-head small { color: #98a2b3; font-size: .64rem; }
.expert-bubble-avatar { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: #fff; color: var(--primary); font-size: .7rem; }
.expert-edited { padding: .1rem .45rem; border-radius: 999px; background: #fff7ed; color: #b45309; font-size: .58rem; font-weight: 800; }
.expert-edit-btn { margin-inline-start: auto; border: 0; background: transparent; color: #98a2b3; font-size: .75rem; }
.expert-edit-btn:hover { color: var(--primary); }
.expert-edit-input { font-size: .8rem; }
.expert-edit-actions { display: flex; gap: .4rem; margin-top: .45rem; }
.expert-composer { display: grid; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.expert-composer textarea { resize: vertical; font-size: .82rem; line-height: 1.9; }
.expert-composer-actions { display: flex; align-items: center; justify-content: space-between; }
.expert-token-hint { color: #98a2b3; font-size: .7rem; }
.expert-empty { display: grid; justify-items: center; gap: .45rem; padding: 2rem .8rem; text-align: center; color: var(--muted); }
.expert-empty i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #eef0ff; color: var(--primary); font-size: 1.15rem; }
.expert-empty strong { color: var(--ink); font-size: .82rem; }
.expert-empty p { margin: 0; font-size: .72rem; line-height: 1.9; }
.expert-empty.is-large { min-height: 380px; align-content: center; }
.expert-detail-loading { display: grid; place-items: center; gap: .8rem; min-height: 380px; color: var(--muted); font-size: .78rem; }
.expert-skeleton { display: grid; gap: .7rem; padding: .4rem 0; }
.expert-skeleton span { height: 58px; border-radius: 12px; background: linear-gradient(100deg, #f3f4f8 20%, #e9ebf3 45%, #f3f4f8 70%); background-size: 200% 100%; animation: history-shimmer 1.5s linear infinite; }
@media (max-width: 900px) {
    .expert-body { grid-template-columns: 1fr; }
    .expert-request-list { max-height: 320px; }
    .expert-ask-btn { margin-inline-start: 0; width: 100%; }
}

/* ---------- Lawyer panel ---------- */
.lawyer-locked { display: grid; justify-items: center; gap: .7rem; max-width: 620px; margin: 2rem auto; padding: clamp(1.6rem, 4vw, 2.6rem); border: 1px solid #e6eaf2; border-radius: 26px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.lawyer-locked-icon { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 24px; background: linear-gradient(145deg, #eef0ff, #e0e3ff); color: var(--primary); font-size: 1.9rem; }
.lawyer-locked h2 { margin: .4rem 0 0; font-size: 1.3rem; font-weight: 800; }
.lawyer-locked p { margin: 0; max-width: 460px; color: var(--muted); font-size: .82rem; line-height: 2; }
.lawyer-locked-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .7rem; margin-top: .6rem; }
.lawyer-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.lawyer-tool-card { display: grid; gap: .45rem; padding: 1.3rem; border: 1px solid #e6eaf2; border-radius: 20px; background: #fff; box-shadow: 0 12px 32px rgba(34,45,79,.05); }
.lawyer-tool-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #eef0ff; color: var(--primary); font-size: 1.15rem; }
.lawyer-tool-card strong { font-size: .86rem; font-weight: 800; }
.lawyer-tool-card p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.9; }
@media (max-width: 900px) { .lawyer-tools { grid-template-columns: 1fr; } }


/* ===== case management (lawyer panel) ===== */
.case-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.case-search { position: relative; flex: 1; min-width: 220px; max-width: 520px; }
.case-search i { position: absolute; top: 50%; inset-inline-start: .85rem; transform: translateY(-50%); color: #98a2b3; font-size: .8rem; }
.case-search input { padding-inline-start: 2.2rem; padding-inline-end: 2.2rem; height: 44px; border-radius: 14px; border: 1px solid #e6eaf2; font-size: .8rem; }
.case-search input:focus { border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.case-search-clear { position: absolute; top: 50%; inset-inline-end: .5rem; transform: translateY(-50%); padding: .15rem .4rem; border: 0; border-radius: 8px; background: #f2f4f7; color: #667085; font-size: .7rem; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.case-card { display: grid; gap: .7rem; padding: 1.1rem 1.15rem; border: 1px solid #e6eaf2; border-radius: 22px; background: #fff; box-shadow: 0 12px 32px rgba(34,45,79,.05); transition: transform .18s, box-shadow .18s; }
.case-card:hover { transform: translateY(-3px); box-shadow: 0 18px 42px rgba(34,45,79,.10); }
.case-card-head { display: flex; align-items: center; gap: .7rem; }
.case-card-icon { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(145deg, #eef0ff, #e0e3ff); color: var(--primary); font-size: 1.05rem; }
.case-card-title { min-width: 0; }
.case-card-title strong { display: block; overflow: hidden; font-size: .92rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.case-card-title small { color: var(--muted); font-size: .68rem; }
.case-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem .7rem; margin: 0; }
.case-card-meta div { display: flex; align-items: baseline; gap: .3rem; min-width: 0; }
.case-card-meta dt { flex: 0 0 auto; color: #98a2b3; font-size: .66rem; font-weight: 700; }
.case-card-meta dd { margin: 0; overflow: hidden; color: #4c5568; font-size: .72rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.case-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.case-tag { padding: .18rem .6rem; border-radius: 999px; background: #f2f4ff; color: #4f46e5; font-size: .64rem; font-weight: 700; }
.case-card-actions { display: flex; align-items: center; gap: .4rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.case-open { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .8rem; border-radius: 12px; background: var(--soft-primary); color: var(--primary); font-size: .74rem; font-weight: 800; text-decoration: none; }
.case-open:hover { color: var(--primary-dark); background: #e4e7ff; }
.case-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #e6eaf2; border-radius: 11px; background: #fff; color: #667085; font-size: .78rem; transition: background .15s, color .15s, border-color .15s; }
.case-icon-btn:hover { border-color: #c7d2fe; background: #f5f6ff; color: var(--primary); }
.case-icon-btn.is-danger:hover { border-color: #fda4af; background: #fff1f2; color: #be123c; }
.case-empty { display: grid; justify-items: center; gap: .5rem; margin-top: 1.5rem; padding: clamp(1.8rem, 5vw, 3rem); border: 1px dashed #d7dbf0; border-radius: 26px; background: #fbfcff; text-align: center; }
.case-empty.is-compact { margin-top: .8rem; padding: 1.6rem; }
.case-empty > i { font-size: 2rem; color: #b7bce0; }
.case-empty h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.case-empty p { margin: 0; max-width: 420px; color: var(--muted); font-size: .78rem; line-height: 2; }
.case-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.4rem; }
.case-pager-label { color: var(--muted); font-size: .74rem; font-weight: 700; }
.case-modal-backdrop { position: fixed; inset: 0; z-index: 1050; display: grid; place-items: center; padding: 1rem; background: rgba(17, 24, 39, .5); backdrop-filter: blur(3px); }
.case-modal { width: min(100%, 680px); max-height: 92vh; overflow-y: auto; padding: clamp(1.1rem, 3vw, 1.6rem); border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(15, 23, 42, .35); }
.case-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.case-modal-head h3 { margin: 0; font-size: 1.02rem; font-weight: 800; }
.case-modal-hint { margin: 0 0 .9rem; color: var(--muted); font-size: .76rem; line-height: 2; }
.case-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; }
.case-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.case-field { display: grid; gap: .3rem; }
.case-field.is-full { grid-column: 1 / -1; }
.case-field > span { color: #667085; font-size: .7rem; font-weight: 700; }
.case-field > span em { color: #dc2626; font-style: normal; }
.case-field .form-control { border-radius: 12px; font-size: .8rem; }
.case-picker-list { display: grid; gap: .45rem; max-height: 52vh; overflow-y: auto; }
.case-picker-item { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .75rem .85rem; border: 1px solid #e6eaf2; border-radius: 16px; background: #fafbff; text-align: right; transition: background .15s, border-color .15s, transform .15s; }
.case-picker-item:hover:not(:disabled) { border-color: #c7d2fe; background: #f3f4ff; transform: translateX(-2px); }
.case-picker-item > i { color: var(--primary); font-size: 1.05rem; }
.case-picker-item > span { display: grid; flex: 1; min-width: 0; }
.case-picker-item strong { overflow: hidden; font-size: .82rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.case-picker-item small { color: var(--muted); font-size: .66rem; }
.case-detail-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.case-side { display: grid; gap: 1rem; }
.case-side-card { display: grid; gap: .55rem; padding: 1.05rem 1.1rem; border: 1px solid #e6eaf2; border-radius: 22px; background: #fff; box-shadow: 0 12px 32px rgba(34,45,79,.05); }
.case-side-card h3 { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .84rem; font-weight: 800; }
.case-side-card h3 i { color: var(--primary); }
.case-side-hint { margin: 0; color: #98a2b3; font-size: .68rem; line-height: 1.9; }
.case-report-block { display: grid; gap: .35rem; }
.case-ai-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem .85rem; border: 1px solid #c7d2fe; border-radius: 13px; background: linear-gradient(135deg, #eef0ff, #e4e7ff); color: var(--primary); font: inherit; font-size: .74rem; font-weight: 800; transition: transform .15s, box-shadow .15s; }
.case-ai-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79,70,229,.20); }
.case-ai-btn:disabled { opacity: .7; cursor: not-allowed; }
.case-ai-btn.is-inline { padding: .4rem .7rem; font-size: .7rem; }
.case-report, .case-extracted, .case-analysis { border: 1px solid #e9eaf3; border-radius: 14px; background: #fafbff; }
.case-report summary, .case-extracted summary, .case-analysis summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .75rem; cursor: pointer; color: var(--primary); font-size: .72rem; font-weight: 800; }
.case-analysis summary { color: #b45309; }
.case-report summary small, .case-analysis summary small { color: #98a2b3; font-size: .62rem; font-weight: 700; }
.case-report-body, .case-extracted-body, .case-analysis-body { max-height: 340px; overflow-y: auto; padding: .3rem .85rem .85rem; color: #475467; font-size: .76rem; line-height: 2.15; white-space: pre-wrap; }
.case-timeline { display: grid; gap: .8rem; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid #e6eaf2; border-radius: 24px; background: #fff; box-shadow: 0 14px 38px rgba(34,45,79,.06); }
.case-timeline-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.case-timeline-head h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.case-timeline-count { padding: .22rem .65rem; border-radius: 999px; background: #f2f4ff; color: var(--primary); font-size: .66rem; font-weight: 800; }
.case-timeline-list { position: relative; display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.case-timeline-list::before { content: ""; position: absolute; top: .4rem; bottom: .4rem; inset-inline-start: 15px; width: 2px; background: linear-gradient(180deg, #e4e7ff, #f2f4f7); }
.case-timeline-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: .7rem; }
.case-timeline-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border: 3px solid #fff; border-radius: 50%; background: #eef0ff; color: var(--primary); font-size: .72rem; box-shadow: 0 0 0 1px #e4e7ff; }
.case-timeline-item.is-search .case-timeline-dot { background: #ecfdf3; color: #067647; box-shadow: 0 0 0 1px #bbf7d0; }
.case-timeline-item.is-file .case-timeline-dot { background: #fff7ed; color: #b45309; box-shadow: 0 0 0 1px #fed7aa; }
.case-timeline-card { display: grid; gap: .5rem; padding: .85rem .95rem; border: 1px solid #eceef6; border-radius: 18px; background: #fdfdff; }
.case-timeline-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.case-timeline-card-head strong { display: block; font-size: .82rem; font-weight: 800; line-height: 1.8; overflow-wrap: anywhere; }
.case-timeline-card-head small { color: #98a2b3; font-size: .64rem; }
.case-item-actions { display: flex; gap: .3rem; }
.case-item-text { color: #475467; font-size: .8rem; line-height: 2.15; white-space: pre-wrap; }
.case-image-wrap { overflow: hidden; border-radius: 14px; border: 1px solid #eceef6; background: #f8f9fd; }
.case-image-wrap img { display: block; width: 100%; max-height: 340px; object-fit: contain; }
.case-audio-wrap { display: grid; gap: .3rem; }
.case-audio-wrap audio { width: 100%; }
.case-media-hint { color: #98a2b3; font-size: .66rem; }
.case-media-loading { display: inline-flex; align-items: center; gap: .4rem; padding: .8rem; color: var(--muted); font-size: .72rem; }
.case-file-meta { display: flex; align-items: center; gap: .8rem; color: #98a2b3; font-size: .66rem; }
.case-file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.case-file-link { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border: 1px solid #e6eaf2; border-radius: 12px; color: #475467; font-size: .7rem; font-weight: 700; text-decoration: none; }
.case-file-link:hover { border-color: #c7d2fe; color: var(--primary); }
.case-item-edit-actions { display: flex; align-items: center; gap: .5rem; }
.case-file-input { font-size: .74rem; }
.case-uploading { display: flex; align-items: center; gap: .45rem; color: var(--primary); font-size: .72rem; font-weight: 700; }
.case-add-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .6rem 1.1rem; border: 1px solid #bbf7d0; border-radius: 999px; background: linear-gradient(135deg, #ecfdf3, #d1fae5); color: #067647; font: inherit; font-size: .76rem; font-weight: 800; transition: transform .16s, box-shadow .16s; }
.case-add-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(6,118,71,.20); }
.case-add-btn:disabled { opacity: .6; cursor: default; }
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.prompt-card { display: grid; gap: .7rem; padding: 1.15rem; border: 1px solid #e6eaf2; border-radius: 22px; background: #fff; box-shadow: 0 12px 32px rgba(34,45,79,.05); }
.prompt-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.prompt-card header strong { display: block; font-size: .86rem; font-weight: 800; }
.prompt-card header small { color: #98a2b3; font-size: .64rem; direction: ltr; }
.prompt-updated { color: #98a2b3; font-size: .62rem; font-weight: 700; }
.prompt-card textarea { border-radius: 14px; font-size: .78rem; line-height: 2; }
.prompt-actions { display: flex; justify-content: flex-end; }
.expert-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 900px) {
    .case-detail-grid { grid-template-columns: 1fr; }
    .case-form-grid { grid-template-columns: 1fr; }
    .case-side { order: 2; }
}
