/* ---- V1.44 the AI's suggestions in the apps (the AI study's first wave, items 8 to 10): "Map my PI points" (Client\Apps\
   Predictive\PointMappingPanel.razor), "Find my loops" (Client\Apps\ControlLoops\LoopFinderPanel.razor), "Suggest a reason"
   (Client\Apps\Downtime\ReasonSuggestionPanel.razor), "What TTech did for you" and the weekly status (Client\Apps\Account\
   MonthSummaryCard.razor, Client\Apps\Tasks\WeeklyStatusPanel.razor and WorkReportView.razor). The theme's tokens only, so
   light and dark both work; nothing wider than the screen on a phone. ---- */

/* A suggestion box: the accent's line on its left, as the other AI answers (dt-ai, sup-triage) */
.ai-assist { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; padding: 10px 12px; border-left: 3px solid var(--accent);
    border-radius: 6px; background: var(--panel-2); min-width: 0; }
.ai-assist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-assist-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-assist-bar .spacer { flex: 1; }
.ai-assist .pdm-line { flex-wrap: wrap; }
.ai-assist .pdm-line .pdm-name { min-width: 0; flex: 1 1 220px; }

/* The proposed rows (points, loops): the role, the point and why, the buttons */
.ai-rows { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--panel); min-width: 0; }
.ai-row.accepted { border-color: var(--good); }
.ai-row.dismissed { opacity: 0.6; }
.ai-row .pdm-role { flex: 0 1 190px; min-width: 0; }
.ai-row-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.ai-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-points { list-style: none; margin: 2px 0; padding: 0; font-size: 0.86rem; }
.ai-points li { overflow-wrap: anywhere; }
.ai-units { display: inline-block; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 0.78rem; }
.ai-why { font-size: 0.86rem; color: var(--text); line-height: 1.45; }
.ai-warn { font-size: 0.82rem; color: var(--warn); }

/* How sure the AI is */
.ai-confidence { display: inline-block; margin-right: 4px; padding: 0 7px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.ai-confidence.high { background: var(--good-soft); color: var(--good-text); }
.ai-confidence.medium { background: var(--accent-soft); color: var(--accent-strong); }
.ai-confidence.low { background: var(--warn-soft); color: var(--warn); }

/* Downtime: the suggested reason above the tree */
.dt-reason-ai { margin-top: 0; margin-bottom: 10px; }
.ai-suggestion { display: flex; flex-direction: column; gap: 6px; }

/* What TTech did for you, the weekly status: the month or week picker, the text, the figures */
.ai-month-head { flex-wrap: wrap; gap: 8px; }
.ai-month-head h3 { display: flex; align-items: center; gap: 6px; margin: 0; }
.ai-month-input { width: auto; max-width: 100%; }
.ai-month-title { margin: 12px 0 4px; font-size: 0.95rem; }
.ai-report-text { margin: 6px 0; padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 6px; background: var(--panel-2); line-height: 1.5; }
.ai-report-text p { margin: 0 0 8px; }
.ai-report-text p:last-child { margin-bottom: 0; }
.ai-report-text ul { margin: 0 0 8px; padding-left: 20px; }
.ai-report-note { margin-bottom: 8px; }
.ai-report-figures { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ai-report-totals { display: flex; flex-wrap: wrap; gap: 12px; }
.ai-report-table-wrap { overflow-x: auto; max-width: 100%; }
.ai-report-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.ai-report-table th, .ai-report-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ai-report-table thead th { color: var(--muted); font-weight: 600; }
.ai-report-cards summary { cursor: pointer; font-size: 0.88rem; }
.ai-report-cards ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.86rem; }
.ai-report-cards li { margin: 3px 0; overflow-wrap: anywhere; }

@media (max-width: 600px) {
    .ai-row .pdm-role { flex-basis: 100%; }
    .ai-row-actions { width: 100%; }
    .ai-month-head .spacer { display: none; }
}

/* V1.52: a short AI summary of a page, written on a click (Client\Shared\AiBriefPanel.razor: Weather's shift brief, Ore
   Traceability's circuit summary), the look of the Energy cockpit's summary */
.ai-brief { background: linear-gradient(180deg, var(--accent-soft), var(--panel) 60%); }
.ai-brief-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-brief-head .spacer { flex: 1; }
.ai-brief-icon { color: var(--accent-strong); }
.ai-brief-lines { margin: 4px 0 6px; padding-left: 18px; display: grid; gap: 4px; line-height: 1.4; }
.ai-brief-lines li.ai-brief-plain { list-style: none; margin-left: -18px; font-weight: 700; }
