/* Cooper AI surfaces (Gemini-inspired) layered on the Workspace design system. */
:root { --ai-1: #4285F4; --ai-2: #9B72CB; --ai-3: #D96570; --ai-grad: linear-gradient(115deg, var(--ai-1), var(--ai-2) 55%, var(--ai-3)); --ai-glow: rgba(155, 114, 203, .18); }
.icon.sparkle { stroke: none; }
.ai-text { background: var(--ai-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 20px; border: 1.5px solid transparent; color: var(--text); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--ai-grad) border-box; transition: box-shadow .2s; }
.ai-btn:hover { box-shadow: 0 0 0 4px var(--ai-glow); }
.ai-btn .icon { width: 20px; height: 20px; }
.ai-btn.sm { height: 32px; padding: 0 12px 0 10px; font-size: 13px; }
.ai-btn.sm .icon { width: 16px; height: 16px; }
.ai-card { position: relative; border-radius: 20px; padding: 18px 20px; border: 1.5px solid transparent; margin-bottom: 20px;
  background: radial-gradient(900px 160px at 0% 0%, color-mix(in srgb, var(--ai-1) 9%, transparent), transparent 70%) padding-box,
              radial-gradient(700px 160px at 100% 100%, color-mix(in srgb, var(--ai-3) 7%, transparent), transparent 70%) padding-box,
              linear-gradient(var(--surface), var(--surface)) padding-box, var(--ai-grad) border-box; }
.ai-card .ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.ai-card .ai-head h2 { font-size: 15px; margin-right: auto; }
.ai-card .ai-body { font: 400 16px/26px var(--display); color: var(--text); }
.ai-card .ai-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.ai-orb { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--surface-1); position: relative; isolation: isolate; }
.ai-orb::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; background: var(--ai-grad); opacity: .35; filter: blur(6px); z-index: -1; }
.ai-orb .icon { width: 20px; height: 20px; }
.ai-orb.working .icon { animation: orb 2.4s ease-in-out infinite; }
@keyframes orb { 50% { transform: rotate(180deg) scale(1.1); } }
.skeleton { height: 12px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--ai-2) 22%, var(--surface-2)) 35%, var(--surface-2) 70%); background-size: 300% 100%; animation: shimmer 1.8s linear infinite; }
.skeleton.w80 { width: 80%; } .skeleton.w60 { width: 60%; } .skeleton.w90 { width: 92%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.thinking-text { font-weight: 500; background: linear-gradient(90deg, var(--text-2) 0%, var(--ai-2) 40%, var(--ai-1) 55%, var(--text-2) 80%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2s linear infinite; }
.ai-src { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-1); font-size: 12px; font-weight: 500; color: var(--text-2); }

/* smart insights */
.insight { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); }
.insight:first-child { border-top: 0; padding-top: 2px; }
.insight .sev { width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.insight .sev .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.insight .sev.critical { background: var(--down-tone); color: var(--down); }
.insight .sev.warning { background: var(--degraded-tone); color: var(--degraded); }
.insight .sev.info { background: var(--pending-container); color: var(--primary); }
.insight .t { font-weight: 500; overflow-wrap: anywhere; }
.insight .d { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.insight .a { font-size: 12.5px; margin-top: 2px; color: var(--text); }

/* incident analysis */
.analysis h3 { font-size: 13px; color: var(--text-2); font-weight: 500; margin: 14px 0 6px; font-family: var(--font); letter-spacing: .2px; }
.analysis ul { margin: 0; padding-left: 18px; }
.analysis li { margin: 4px 0; }
.analysis .cause { display: flex; gap: 8px; align-items: baseline; }
.conf { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 1px 6px; border-radius: 4px; background: var(--surface-1); color: var(--text-2); flex: none; }
.conf.high { background: var(--down-tone); color: var(--down); } .conf.medium { background: var(--degraded-tone); color: var(--degraded); }
.quote { padding: 12px 14px; border-radius: 12px; background: var(--surface-1); font-size: 14px; }

/* assistant side panel */
.ai-panel { position: fixed; top: 64px; right: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); z-index: 90; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-2); transform: translateX(calc(100% + 32px)); transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility .28s; visibility: hidden; }
body.ai-open .ai-panel { transform: none; visibility: visible; }
.ai-panel header { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 18px; }
.ai-panel header h2 { font-size: 17px; margin-right: auto; }
.ai-panel .ai-scroll { flex: 1; overflow-y: auto; padding: 4px 18px 12px; }
.ai-hello { padding: 14px 2px 8px; }
.ai-hello h3 { font: 500 26px/34px var(--display); margin-bottom: 6px; }
.ai-suggest { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.ai-suggest button { text-align: left; padding: 12px 14px; border-radius: 12px; border: 0; background: var(--surface-1); color: var(--text); font: 14px var(--font); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.ai-suggest button:hover { background: var(--surface-2); }
.ai-suggest .icon { color: var(--text-2); }
.ai-msg { margin: 14px 0; display: flex; gap: 10px; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg.user .bubble { background: var(--primary-container); color: var(--on-primary-container); border-radius: 18px 18px 4px 18px; padding: 10px 14px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.bot .md { flex: 1; min-width: 0; line-height: 22px; overflow-wrap: anywhere; padding-top: 5px; }
.ai-msg.bot .md p { margin: 0 0 10px; }
.ai-msg.bot .md ul, .ai-msg.bot .md ol { margin: 0 0 10px; padding-left: 20px; }
.ai-msg.bot .md li { margin: 3px 0; }
.ai-msg.bot .md code { background: var(--surface-1); padding: 1px 5px; border-radius: 4px; }
.ai-msg.bot .md pre { background: var(--surface-1); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
.ai-msg.bot .md h4 { font: 600 14px var(--display); margin: 10px 0 6px; }
.ai-msg.bot .status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.ai-msg.bot .err { color: var(--down); }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -3px; border-radius: 2px; background: var(--ai-grad); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ai-composer { margin: 0 12px 10px; padding: 6px 6px 6px 16px; border-radius: 24px; background: var(--surface-1); display: flex; align-items: flex-end; gap: 6px; transition: box-shadow .15s; }
.ai-composer:focus-within { box-shadow: 0 0 0 3px var(--ai-glow), inset 0 0 0 1px color-mix(in srgb, var(--ai-2) 45%, transparent); }
.ai-composer textarea { flex: 1; min-height: 40px; max-height: 160px; height: 40px; padding: 10px 0; border: 0 !important; background: transparent !important; box-shadow: none !important; font: 15px/20px var(--font); resize: none; color: var(--text); }
.ai-send { width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--ai-grad); color: #FFFFFF; display: grid; place-items: center; cursor: pointer; flex: none; }
.ai-send:disabled { background: var(--surface-3); color: var(--text-2); cursor: default; }
.ai-foot { padding: 0 18px 12px; font-size: 11.5px; color: var(--text-2); text-align: center; }
.ai-off { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-1); font-size: 13.5px; }

/* command palette */
dialog.palette { width: min(640px, calc(100vw - 24px)); margin: 12vh auto auto; padding: 0; border: 0; border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); overflow: hidden; }
dialog.palette::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(3px); }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--divider); }
.palette .p-input input { height: 60px; border: 0 !important; box-shadow: none !important; font-size: 17px; padding: 0 !important; background: transparent; }
.palette .p-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px 0 8px; }
.palette .p-group { padding: 10px 18px 4px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.palette .p-item { display: flex; align-items: center; gap: 12px; padding: 9px 18px; cursor: pointer; color: var(--text); text-decoration: none !important; }
.palette .p-item .sub { margin-left: auto; font-size: 12.5px; color: var(--text-2); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette .p-item.on, .palette .p-item:hover { background: var(--surface-1); }
.palette .p-item .icon { color: var(--text-2); }
.palette .p-foot { display: flex; gap: 16px; padding: 8px 18px; border-top: 1px solid var(--divider); font-size: 12px; color: var(--text-2); }
kbd { font: 500 11.5px var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--outline-variant); background: var(--surface); color: var(--text-2); }
.searchbar .kbd-hint { margin-right: 6px; white-space: nowrap; }

/* micro-interactions */
.kpi, .card, .mrow, .chip, .btn, .navlink { transition: background-color .15s, box-shadow .15s, border-color .15s, transform .15s; }
a.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); filter: none; }
.live-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--up-bar); display: inline-block; vertical-align: 1px; animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(52, 168, 83, .5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(52, 168, 83, 0); } }
@media (max-width: 900px) { .ai-panel { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); } .ai-btn .ai-label { display: none; } .ai-btn { padding: 0 9px; } .searchbar .kbd-hint { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
