/* MD Integrations case page (console-case.php). Layout mirrors MDI's own
   case details page (patient sidebar · case · messages) — these rules only
   refine its components. Colors come from ui-kit.css (.theme-md). */

.console-card {
    background: #fff;
    border: 1px solid var(--bl-border, #e3e8ee);
    border-radius: 0.6rem;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.console-card-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    margin: -0.15rem 0 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--bl-border, #e3e8ee);
}

.console-card-title .bi { color: var(--bl-accent, #1f6feb); }

.console-kv-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 0.88rem;
}

.console-kv-row > span:first-child { flex-shrink: 0; }
.console-kv-row > span:last-child { text-align: right; word-break: break-word; }
.console-kv-row:last-child { border-bottom: none; }

.console-banner {
    background: #fff7e6;
    border: 1px solid #fde2b0;
    color: #7a4a00;
    border-radius: 0.5rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
}

/* numbered lists (Requested Treatments, Medical Intake) */
.console-list { list-style: none; counter-reset: console-item; padding: 0; }
.console-list > li {
    counter-increment: console-item;
    position: relative;
    padding: 0.6rem 0 0.6rem 2rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.console-list > li:last-child { border-bottom: none; }
.console-list > li::before {
    content: counter(console-item);
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--bl-accent-soft, #e8f0fe);
    color: var(--bl-accent-dark, #1a56c4);
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.console-intake-q { font-size: 0.88rem; color: #334155; }
.console-intake-a { font-weight: 600; margin-top: 0.1rem; }

/* status timeline */
.console-timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--bl-border, #e3e8ee); }
.console-timeline li { position: relative; padding: 0 0 0.7rem 0.6rem; font-size: 0.86rem; }
.console-timeline li:last-child { padding-bottom: 0; }
.console-timeline li::before {
    content: "";
    position: absolute;
    left: calc(-1rem - 6px);
    top: 0.35rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--bl-accent, #1f6feb);
}
.console-timeline li:last-child::before { background: var(--bl-accent, #1f6feb); }
.console-timeline-event { display: block; font-weight: 600; text-transform: capitalize; }
.console-timeline-at { color: var(--bl-muted, #64748b); }

.console-picture {
    display: block;
    width: 96px;
    height: 96px;
    border: 1px solid var(--bl-border, #e3e8ee);
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.console-picture:hover, .console-picture:focus-visible { border-color: var(--bl-accent, #1f6feb); box-shadow: 0 0 0 3px var(--bl-accent-soft, #e8f0fe); }

.console-picture img { width: 100%; height: 100%; object-fit: cover; }

.console-picture-file {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.75rem;
    text-align: center;
    padding: 0.35rem;
    color: #475569;
    word-break: break-word;
}

/* messages */
.console-messages {
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.15rem;
}

.console-message {
    border-radius: 0.8rem;
    padding: 0.5rem 0.75rem;
    max-width: 92%;
    border: 1px solid transparent;
    font-size: 0.88rem;
}

.console-message-clinician {
    align-self: flex-end;
    background: var(--bl-accent-soft, #e8f0fe);
    border-color: var(--bl-accent-line, #c5d8fb);
    border-bottom-right-radius: 0.25rem;
}

.console-message-patient {
    align-self: flex-start;
    background: #f1f5f9;
    border-color: #e2e8f0;
    border-bottom-left-radius: 0.25rem;
}

.console-message-at { color: var(--bl-muted, #64748b); font-size: 0.7rem; margin-top: 0.2rem; }

.console-message-attachment {
    display: block;
    width: 140px;
    border: 1px solid var(--bl-border, #e3e8ee);
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
}

.console-message-attachment img,
.console-message-attachment video {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .console-picture { transition: none; }
}
