/* ==================== AI Assistant — Apple Dynamic-Island-style notch ==================== */
/* Sits above #topBar, fixed at the top center of the viewport. White/gray palette. */

#aiNotch {
    position: fixed;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: none;                    /* shown by JS once role is authorized */
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    height: 28px;
    border-radius: 999px;
    background: rgba(28, 28, 30, 0.92);
    color: #f5f5f7;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
    user-select: none;
    /* No backdrop-filter: its compositing layer gets discarded when the Electron
       window is backgrounded and flashes when rebuilt on refocus+open. The pill is
       92% opaque so the blur was imperceptible anyway. */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.10);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

#aiNotch:hover {
    transform: translateX(-50%) translateY(1px) scale(1.02);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), 0 2px 4px rgba(0, 0, 0, 0.10);
}

#aiNotch.show {
    display: inline-flex;
}

#aiNotch .ai-notch-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
    animation: aiNotchPulse 2.4s ease-in-out infinite;
}

@keyframes aiNotchPulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%      { opacity: 1.0;  transform: scale(1.18); }
}

/* Alert state: a cron/system fault (e.g. lab-import down) turns the dot red and
   blinks it fast. Click the notch to see the problem; the JS clears .alert. */
#aiNotch.alert .ai-notch-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
    animation: aiNotchAlert 0.6s steps(1, end) infinite;
}

@keyframes aiNotchAlert {
    0%, 49%   { opacity: 1;    transform: scale(1.25); }
    50%, 100% { opacity: 0.25; transform: scale(0.9); }
}

/* Update-due state: a newer client build is live but this one is stale
   (system/latestVersion > APP_VERSION). Amber, medium blink — less urgent than a
   system fault (red), more than a what's-new note (blue). JS sets exactly one
   state class, so these three never collide in the cascade. */
#aiNotch.update-due .ai-notch-dot {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.9);
    animation: aiNotchUpdate 1s ease-in-out infinite;
}
@keyframes aiNotchUpdate {
    0%, 100% { opacity: 1;   transform: scale(1.2); }
    50%      { opacity: 0.4; transform: scale(0.95); }
}

/* What's-new state: unread release notes for the current build. Blue, gentle slow
   pulse — purely informational. Cleared once the user opens the panel and reads it. */
#aiNotch.whatsnew .ai-notch-dot {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.85);
    animation: aiNotchWhatsNew 1.8s ease-in-out infinite;
}
@keyframes aiNotchWhatsNew {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.2); }
}

/* Unseen daily briefing — indigo, lowest priority (below fault/update/whatsnew). */
#aiNotch.briefing .ai-notch-dot {
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.85);
    animation: aiNotchWhatsNew 2s ease-in-out infinite;
}

/* Incoming-message ping — fast triple flash (e.g. nurse: a prescription was signed/changed).
   One-shot: JS adds .ping, removes it on animationend. */
#aiNotch.ping { animation: aiNotchPing 1.4s ease-out; }
#aiNotch.ping .ai-notch-dot { background: #6366f1; }
@keyframes aiNotchPing {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(99,102,241,0); }
    10%  { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(99,102,241,.38); }
    25%  { transform: scale(1);    box-shadow: 0 0 0 0 rgba(99,102,241,0); }
    40%  { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(99,102,241,.38); }
    55%  { transform: scale(1);    box-shadow: 0 0 0 0 rgba(99,102,241,0); }
    70%  { transform: scale(1.12); box-shadow: 0 0 0 5px rgba(99,102,241,.38); }
    85%  { transform: scale(1);    box-shadow: 0 0 0 0 rgba(99,102,241,0); }
    100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

#aiNotch .ai-notch-label {
    white-space: nowrap;
}

/* ==================== Slide-down panel ==================== */

#aiPanelOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    /* Slightly stronger plain dim instead of a backdrop blur — the blur's
       compositing layer flashes when the Electron window is refocused and the
       panel is opened (layer was discarded while backgrounded). A solid rgba dim
       needs no GPU backdrop layer, so no flash. */
    background: rgba(15, 17, 21, 0.40);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

#aiPanelOverlay.open {
    opacity: 1;
    pointer-events: auto;
}

#aiPanel {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 10001;
    width: min(720px, 96vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

#aiPanel.open {
    transform: translateX(-50%) translateY(0);
}

#aiPanelHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #f0f0f3;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

#aiPanelHeader .ai-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1e;
}

#aiPanelHeader .ai-panel-title .ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
}

#aiPanelHeader .ai-panel-meta {
    font-size: 11px;
    color: #8e8e93;
    font-weight: 400;
}

#aiPanelClose {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: #6e6e73;
    transition: background 0.15s ease, color 0.15s ease;
}

#aiPanelClose:hover {
    background: #f2f2f5;
    color: #1c1c1e;
}

#aiThread {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fbfbfd;
}

.ai-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: aiMsgIn 0.22s ease;
}

@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ai-msg-user {
    align-self: flex-end;
    background: #1c1c1e;
    color: #f5f5f7;
    border-bottom-right-radius: 6px;
}

.ai-msg-assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #1c1c1e;
    border: 1px solid #ececef;
    border-bottom-left-radius: 6px;
}

.ai-msg-system {
    align-self: center;
    font-size: 11.5px;
    color: #8e8e93;
    background: transparent;
    padding: 4px 8px;
    max-width: 100%;
}

.ai-msg-error {
    align-self: flex-start;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    border-bottom-left-radius: 6px;
}

.ai-msg-meta {
    font-size: 10.5px;
    color: #a1a1a6;
    margin-top: 4px;
    font-weight: 400;
}

.ai-msg-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.ai-msg-tools .ai-tool-chip {
    font-size: 10.5px;
    color: #6e6e73;
    background: #f2f2f5;
    border-radius: 6px;
    padding: 2px 6px;
}

.ai-typing {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #ececef;
    padding: 10px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
}

.ai-typing-label {
    font-size: 13px;
    color: #6e6e73;
    font-style: italic;
}

.ai-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ai-typing-dots span {
    width: 6px;
    height: 6px;
    background: #c7c7cc;
    border-radius: 50%;
    animation: aiTyping 1.2s ease-in-out infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes aiTyping {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40%           { opacity: 1.0;  transform: translateY(-2px); }
}

#aiInputBar {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #f0f0f3;
    background: #ffffff;
}

#aiInput {
    flex: 1 1 auto;
    resize: none;
    min-height: 36px;
    max-height: 140px;
    padding: 8px 12px;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    font-size: 13.5px;
    font-family: inherit;
    line-height: 1.45;
    color: #1c1c1e;
    background: #fbfbfd;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

#aiInput:focus {
    border-color: #1c1c1e;
    background: #ffffff;
}

#aiSend {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: #1c1c1e;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.08s ease;
}

#aiSend:hover  { background: #000000; }
#aiSend:active { transform: translateY(1px); }
#aiSend:disabled {
    background: #c7c7cc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ==================== Mobile (< 640px) ==================== */
@media (max-width: 640px) {
    #aiNotch {
        height: 26px;
        padding: 5px 12px;
        font-size: 11.5px;
    }
    #aiPanel {
        width: 100vw;
        max-height: 92vh;
        border-radius: 0 0 18px 18px;
    }
}

/* ==================== Phase A: Block renderers (ConfirmCard / TableBlock / NoticeCard) ==================== */
.ai-block {
    align-self: stretch;
    background: #ffffff;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    font-size: 13px;
    color: #1c1c1e;
}

.ai-block-tag {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6e6e73;
    margin-bottom: 6px;
}

.ai-block-title {
    font-size: 14px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 6px;
    line-height: 1.35;
}

.ai-block-body {
    font-size: 12.5px;
    color: #3a3a3c;
    line-height: 1.5;
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.ai-block-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.ai-btn {
    padding: 6px 14px;
    border: 1px solid #d1d1d6;
    background: #f8f8f8;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1c1c1e;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.08s ease;
}
.ai-btn:hover { background: #efefef; }
.ai-btn:active { transform: translateY(1px); }
.ai-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ai-btn-confirm {
    background: #1c1c1e;
    color: #ffffff;
    border-color: #1c1c1e;
}
.ai-btn-confirm:hover { background: #000; }

.ai-btn-danger {
    background: #d70015;
    border-color: #d70015;
}
.ai-btn-danger:hover { background: #b00012; }

.ai-confirm-card.ai-danger {
    border-color: #ffd5dc;
    background: #fff5f7;
}

.ai-block-status {
    margin-top: 8px;
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #f2f2f7;
    color: #3a3a3c;
}
.ai-block-status.ai-status-ok       { background: #e6f5ec; color: #137f3a; }
.ai-block-status.ai-status-error    { background: #fce4e6; color: #b00012; }
.ai-block-status.ai-status-cancelled{ background: #f2f2f7; color: #6e6e73; }

.ai-block-diff {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    margin-bottom: 4px;
    font-size: 12px;
}
.ai-block-diff th,
.ai-block-diff td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid #f2f2f7;
}
.ai-block-diff th {
    color: #6e6e73;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ai-block-diff td.ai-diff-before { color: #8e8e93; text-decoration: line-through; }
.ai-block-diff td.ai-diff-after  { color: #137f3a; font-weight: 600; }

.ai-table-block .ai-table-wrap {
    overflow-x: auto;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
}
.ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.ai-table th, .ai-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #f2f2f7;
    white-space: nowrap;
}
.ai-table th {
    background: #f8f8f8;
    color: #6e6e73;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ai-table tbody tr:last-child td { border-bottom: none; }
.ai-block-footer {
    margin-top: 6px;
    font-size: 11px;
    color: #6e6e73;
}

.ai-notice-card {
    border-color: #d1d1d6;
}
.ai-notice-card.ai-notice-warning {
    background: #fff8e1;
    border-color: #ffe69c;
}
.ai-notice-card.ai-notice-error {
    background: #fce4e6;
    border-color: #f5b8be;
}
/* What's-new briefing card — blue accent matching the #aiNotch.whatsnew dot. */
.ai-notice-card.ai-notice-info {
    background: #eaf2ff;
    border-color: #b9d4ff;
}

/* ── DB-routed alerts (reception→doctor/US new appointment, nurse Rx) now land
   inside Smart Nino instead of a standalone toast. Two pieces:
   1) the panel "peek" — a brief glimpse with NO dimming overlay (so the user
      keeps working; no scroll-lock since #aiPanel isn't an overlay), and
   2) the alerts feed card shown at the top of the panel. */

/* Peek = panel slides down a glimpse, capped height, no input bar. The overlay
   is intentionally NOT shown for a peek (no dim / no background scroll-lock). */
#aiPanel.peek {
    max-height: min(46vh, 360px);
}
#aiPanel.peek #aiInputBar { display: none; }
#aiPanel.peek #aiThread { overflow: hidden; }

/* Alerts feed card (recent role-targeted alerts; visible whenever Smart Nino opens).
   The card inherits white-space:pre-wrap from .ai-msg — reset it here so the row
   markup's formatting whitespace can never render as blank vertical gaps. */
.ai-alerts-feed { white-space: normal; }
.ai-alerts-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}
/* Each alert is ONE compact line: [dot] Title · body  ·····  HH:MM. */
.ai-alert-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f6f6f8;
}
.ai-alert-row.unread { background: rgba(59, 130, 246, 0.08); }
.ai-alert-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: 0 0 auto;
}
/* Title + body share one line and ellipsis-truncate rather than wrap. */
.ai-alert-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    line-height: 1.4;
}
.ai-alert-title { font-weight: 600; color: #1c1c1e; }
.ai-alert-row.unread .ai-alert-title { font-weight: 700; }
.ai-alert-body { color: #6e6e73; }
.ai-alert-time { font-size: 11px; color: #8e8e93; flex: 0 0 auto; white-space: nowrap; }

/* === Rendered Markdown in assistant replies (ai-assistant.js renderMarkdownInto) === */
/* The bubble base sets white-space:pre-wrap for plain text; rendered markdown is
   structured DOM, so reset it and let block margins do the spacing. */
.ai-msg-assistant.ai-md { white-space: normal; }
.ai-md > *:first-child { margin-top: 0; }
.ai-md > *:last-child  { margin-bottom: 0; }

.ai-md-p { margin: 0 0 8px; line-height: 1.55; }

/* Headings: restrained. h3+ become the small uppercase label seen across the
   clinic UI; h1/h2 stay a touch larger but never shout. */
.ai-md-h {
    margin: 12px 0 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8e8e93;
}
.ai-md-h.ai-md-h-lg {
    font-size: 13.5px;
    letter-spacing: 0;
    text-transform: none;
    color: #1c1c1e;
}

.ai-md-list { margin: 0 0 8px; padding-left: 18px; }
.ai-md-list li { margin: 2px 0; line-height: 1.5; }

.ai-md-quote {
    margin: 0 0 8px;
    padding: 2px 0 2px 11px;
    border-left: 2px solid #d8d8de;
    color: #6e6e73;
    line-height: 1.5;
}

.ai-md-code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11.5px;
    background: #f2f2f5;
    border-radius: 4px;
    padding: 1px 5px;
}
.ai-md-pre {
    margin: 0 0 8px;
    padding: 10px 12px;
    background: #f7f7f9;
    border: 0.5px solid #ececef;
    border-radius: 8px;
    overflow-x: auto;
}
.ai-md-pre code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11.5px;
    white-space: pre;
    background: none;
    padding: 0;
}
.ai-md hr {
    border: none;
    border-top: 0.5px solid #ececef;
    margin: 12px 0;
}
.ai-md a { color: #3056d3; text-decoration: none; }
.ai-md a:hover { text-decoration: underline; }

/* Inline table card (small tables): clean, restrained, tabular figures. */
.ai-md-table-card { margin: 4px 0 10px; }
.ai-md-table-scroll {
    overflow-x: auto;
    border: 0.5px solid #e5e5ea;
    border-radius: 9px;
    background: #fff;
}
.ai-md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.ai-md-table th,
.ai-md-table td {
    padding: 7px 11px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 0.5px solid #f0f0f3;
}
.ai-md-table th {
    background: #fafafb;
    color: #6e6e73;
    font-weight: 600;
    font-size: 11px;
    position: sticky;
    top: 0;
}
.ai-md-table tbody tr:last-child td { border-bottom: none; }
.ai-md-table tbody tr:hover td { background: #fafafc; }

.ai-md-table-tools {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

/* Shared button look for download / expand. */
.ai-md-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 11px;
    border: 0.5px solid #d8d8de;
    border-radius: 8px;
    background: #fff;
    color: #1c1c1e;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.ai-md-btn:hover { background: #f5f5f7; border-color: #c4c4cc; }
.ai-md-btn.ai-md-btn-sm { font-size: 11.5px; padding: 3px 9px; color: #6e6e73; }
.ai-md-btn svg { width: 1em; height: 1em; }
.ai-md-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 0.5px solid #d8d8de;
    border-radius: 8px;
    background: #fff;
    color: #6e6e73;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.ai-md-iconbtn:hover { background: #f5f5f7; color: #1c1c1e; }

/* Collapsed card for wide/tall tables — the panel is narrow, so a giant grid
   stays out of the bubble until the user expands or downloads it. */
.ai-md-table-collapsed {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 4px 0 10px;
    padding: 10px 12px;
    border: 0.5px solid #e5e5ea;
    border-radius: 10px;
    background: #fafafb;
}
.ai-md-tc-ic { flex: 0 0 auto; color: #8e8e93; display: flex; }
.ai-md-tc-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ai-md-tc-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1c1c1e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-md-tc-sub { font-size: 11px; color: #8e8e93; }

/* Expand modal — floats above the panel; z rides getTopModalZ(). */
.ai-md-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: aiMdFade 0.16s ease;
}
@keyframes aiMdFade { from { opacity: 0; } to { opacity: 1; } }
.ai-md-modal {
    width: 760px;
    max-width: 96vw;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
}
.ai-md-modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 0.5px solid #ececef;
    flex: 0 0 auto;
}
.ai-md-modal-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: #1c1c1e;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-md-modal-close { border: none; background: transparent; width: 30px; height: 30px; }
.ai-md-modal-close:hover { background: #f2f2f5; }
.ai-md-modal-body { overflow: auto; padding: 4px 0; }
.ai-md-modal-body .ai-md-table { font-size: 13px; }
.ai-md-modal-body .ai-md-table th,
.ai-md-modal-body .ai-md-table td { padding: 9px 16px; }

/* Caption above a table (from a heading that sits directly above it). */
.ai-md-table-cap {
    margin: 8px 0 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8e8e93;
}

/* Smart Nino 关闭闸 (2026-06-21):叫了号还没【完成/过号/撤回】时,关面板被拦下 →
   抖一下叫号控件把注意力拉回去(配合 toast 提示)。见 ai-assistant.js close()/flashQueueCallLock。 */
@keyframes aiQueueLockShake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-7px); }
    30%      { transform: translateX(6px); }
    45%      { transform: translateX(-5px); }
    60%      { transform: translateX(4px); }
    75%      { transform: translateX(-2px); }
}
#aiQueueCall.queue-lock-shake {
    animation: aiQueueLockShake 0.55s cubic-bezier(.36,.07,.19,.97) both;
}
