/* UI adaptations of Notification Stack (https://kokonutui.com/r/notification-stack.json)
 * and AI Chat Button (https://21st.dev/@victordiazjauregui/components/aichat-button).
 * MIT License. Copyright (c) 2025 kokonutUI; Copyright (c) 2026 Victor Díaz Jáuregui.
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
[data-assistant-home][hidden] { display:none; }
.dashboard-focus-grid { grid-template-columns:minmax(0,1fr); }
.dashboard-focus-grid:has([data-assistant-home]:not([hidden])) { grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr); min-height:272px; }
[data-assistant-home] { min-width:0; }
.assistant-home { display:flex; flex-direction:column; width:100%; height:100%; padding:0; overflow:hidden; border:1px solid #adbff0; border-radius:16px; color:var(--ink); background:var(--paper); text-align:start; cursor:pointer; box-shadow:0 4px 12px #29499b12; transition:border-color .18s,box-shadow .18s; }
.assistant-home:hover { border-color:#6c89dd; box-shadow:0 5px 16px #29499b24; }
.assistant-home:focus-visible,.assistant-launcher:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.assistant-home-header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; padding:9px 13px; background:radial-gradient(ellipse at 96% 0%,#4b64bc,transparent 64%),#233d88; color:#fff; }
.assistant-home-mark,.assistant-task-icon { display:grid; place-items:center; border-radius:9px; }
.assistant-home-mark { width:35px; height:35px; background:#ffffff22; color:#edf2ff; }
.assistant-home-title { display:grid; gap:2px; min-width:0; }
.assistant-home-title strong { font-size:21px; letter-spacing:-.04em; line-height:1.15; }
.assistant-home-title small { color:#e0e8ff; font-size:12px; line-height:1.2; }
.assistant-home-more { display:inline-flex; align-items:center; gap:4px; padding:4px 7px; border:1px solid #ffffff50; border-radius:7px; font-size:12px; font-weight:750; white-space:nowrap; }
.assistant-home-more .od-icon { width:13px; height:13px; }
.assistant-home-preview { display:grid; grid-auto-rows:minmax(49px,auto); flex:1; gap:5px; padding:7px 10px 4px; }
.assistant-task-row { --task-tone:#52647f; --task-wash:#edf2f8; display:grid; grid-template-columns:31px minmax(0,1fr) auto; align-items:center; gap:8px; padding:4px 8px; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.assistant-task-row.is-danger { --task-tone:#a13135; --task-wash:#fdebed; }
.assistant-task-row.is-warning { --task-tone:#865400; --task-wash:#fff1d3; }
.assistant-task-row.is-info { --task-tone:#2c52a6; --task-wash:#eaf0ff; }
.assistant-task-row.is-positive { --task-tone:#136c56; --task-wash:#e4f6ed; }
.assistant-task-row:is(.is-danger,.is-warning) { border-inline-start:3px solid var(--task-tone); padding-inline-start:6px; }
.assistant-task-icon { width:31px; height:31px; color:var(--task-tone); background:var(--task-wash); }
.assistant-task-icon .od-icon { width:17px; height:17px; }
.assistant-task-copy,.assistant-task-amount { display:grid; min-width:0; gap:2px; line-height:1.3; overflow-wrap:anywhere; }
.assistant-task-copy strong { font-size:15px; }
.assistant-task-rank { color:var(--task-tone); }
.assistant-task-copy small { color:var(--muted); font-size:12px; }
.assistant-task-amount { justify-items:end; color:var(--task-tone); font-variant-numeric:tabular-nums; white-space:nowrap; }
.assistant-task-amount small { font-size:10px; }
.assistant-task-amount b { font-size:19px; letter-spacing:-.03em; }
.assistant-home-foot { padding:1px 11px 5px; color:var(--muted); font-size:11px; }
.assistant-home-empty { display:grid; place-items:center; flex:1; padding:14px; color:var(--muted); }
[data-theme=dark] .assistant-home { border-color:#4d6096; }
[data-theme=dark] .assistant-home-header { background:radial-gradient(ellipse at 96% 0%,#415fa7,transparent 62%),#253b70; }
[data-theme=dark] .assistant-task-row { --task-tone:#c1cee6; --task-wash:#2b394e; }
[data-theme=dark] .assistant-task-row.is-danger { --task-tone:#ffb0b3; --task-wash:#512d38; }
[data-theme=dark] .assistant-task-row.is-warning { --task-tone:#f7cd7c; --task-wash:#493b28; }
[data-theme=dark] .assistant-task-row.is-info { --task-tone:#b5c7ff; --task-wash:#2d4069; }
[data-theme=dark] .assistant-task-row.is-positive { --task-tone:#9ce0c9; --task-wash:#284c46; }

/* Victor Díaz Jáuregui's AI Chat Button sparkles trigger adapted as a floating launcher. */
.assistant-launcher[hidden],.auth-locked .assistant-launcher { display:none; }
.assistant-launcher { position:fixed; inset-inline-end:14px; bottom:18px; z-index:36; width:54px; height:54px; display:grid; place-items:end center; border:0; border-radius:18px; padding:0; background:transparent; color:#fff; cursor:pointer; }
.assistant-launcher-icon { display:grid; place-items:center; width:100%; height:100%; border:1px solid #a9bbff; border-radius:inherit; background:linear-gradient(145deg,#557aff,#263eaa); box-shadow:0 5px 16px #1c39994d; animation:assistant-float 2.8s ease-in-out infinite; }
.assistant-launcher-icon svg { width:29px; height:29px; }
.assistant-launcher-bubble { position:absolute; inset-inline-end:-4px; bottom:calc(100% + 13px); padding:7px 8px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--paper); box-shadow:0 3px 12px #19294826; font-size:12px; font-weight:750; white-space:nowrap; pointer-events:none; animation:assistant-bubble-in .35s ease-out both; }
.assistant-launcher-bubble::after { content:''; position:absolute; top:100%; right:17px; width:8px; height:8px; border:solid var(--line); border-width:0 1px 1px 0; background:var(--paper); transform:translateY(-4px) rotate(45deg); }
.assistant-launcher:is(:hover,:focus-visible) .assistant-launcher-icon { background:#304fc7; }
@keyframes assistant-float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-5px); } }
@keyframes assistant-bubble-in { from { opacity:0; transform:translateY(4px); } }

.assistant-detail { display:grid; gap:10px; min-width:0; }
.assistant-detail :is(p,ul) { margin:0; }
.assistant-briefing { padding:10px 12px; border:1px solid var(--line); border-radius:12px; background:var(--ground); }
.assistant-briefing h3,.assistant-linked h3 { margin:0 0 6px; font-size:14px; color:var(--accent-dark); }
.assistant-briefing ol { margin:0; padding-inline-start:22px; display:grid; gap:7px; }
.assistant-briefing li p { font-size:13px; color:var(--muted); }
.assistant-linked { padding:8px 10px; border-radius:10px; background:var(--accent-soft); }
.assistant-linked[hidden] { display:none; }
.assistant-detail-heading,.assistant-detail-callout { display:flex; align-items:center; justify-content:space-between; gap:8px 12px; flex-wrap:wrap; }
.assistant-detail-heading p,.assistant-detail-callout p { margin-top:3px; color:var(--muted); font-size:13px; }
.assistant-detail-callout { padding:9px 12px; border:1px solid var(--line); border-radius:10px; background:var(--ground); }
.assistant-detail-callout.is-shortfall,.assistant-detail-table .is-shortfall { color:#a93629; }
[data-theme=dark] :is(.assistant-detail-callout,.assistant-detail-table) .is-shortfall,[data-theme=dark] .assistant-detail-callout.is-shortfall { color:#ffad9f; }
.assistant-detail-table { width:100%; border-collapse:collapse; table-layout:fixed; font-variant-numeric:tabular-nums; }
.assistant-detail-table :is(th,td) { padding:5px 7px; border-bottom:1px solid var(--line); text-align:right; overflow-wrap:anywhere; font-size:13px; }
.assistant-detail-table th:first-child { text-align:left; width:18%; }
.assistant-detail-table thead { background:var(--ground); }
.assistant-detail-list { border:1px solid var(--line); border-radius:10px; padding:6px 10px; }
.assistant-detail-list summary { cursor:pointer; font-weight:750; }
.assistant-detail-list ul { list-style:none; padding:0; }
.assistant-detail-list li { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 0; border-top:1px solid var(--line); }
.assistant-detail-list li :is(span,b) { min-width:0; overflow-wrap:anywhere; }
.assistant-detail-list li strong { flex:none; }
.assistant-detail-list li small { display:block; font-size:12px; color:var(--muted); }
.assistant-examples { display:flex; flex-wrap:wrap; gap:6px; }
.btn.assistant-primary { background:#145f59; border-color:#145f59; color:#fff; }
.btn.assistant-primary:hover { background:#104c47; border-color:#104c47; color:#fff; }
.assistant-popover { position:fixed; z-index:45; height:536px; display:grid; min-height:0; color:var(--ink); background:color-mix(in srgb,var(--paper) 91%,#8378de); border:1px solid var(--line); border-radius:18px; box-shadow:0 14px 50px #22234337; overflow:hidden; }
.assistant-chat { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; gap:0; min-width:0; min-height:0; }
.assistant-popover-header { display:flex; align-items:center; gap:8px; padding:12px 14px 8px; }
.assistant-popover-header > div { min-width:0; flex:1; overflow-wrap:anywhere; }
.assistant-popover-header h2 { margin:0; font-size:19px; }
.assistant-popover-header small { color:var(--muted); }
.assistant-chat-info summary { list-style:none; cursor:pointer; padding:8px; font-size:17px; }
.assistant-chat-info p { position:absolute; z-index:1; inset:44px 12px auto; margin:0; padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--paper); color:var(--muted); font-size:13px; }
.assistant-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding-inline:12px; border-bottom:1px solid var(--line); }
.assistant-tabs button { min-height:42px; background:none; color:var(--muted); border-bottom:2px solid transparent; font-weight:700; }
.assistant-tabs button[aria-selected=true] { color:var(--ink); border-color:#7766c6; background:color-mix(in srgb,var(--paper) 79%,#a596ed); border-radius:9px 9px 0 0; }
.assistant-tab-body { min-height:0; overflow:auto; overscroll-behavior:contain; }
.assistant-tab-body:has(.assistant-messages) { display:grid; }
.assistant-examples-page { padding:12px; }
.assistant-examples-page .assistant-examples { display:grid; gap:7px; }
.assistant-examples .btn { white-space:normal; text-align:left; }
.assistant-messages { display:grid; align-content:start; gap:9px; min-height:0; padding:12px; overflow:auto; overscroll-behavior:contain; }
.assistant-chat-empty { margin:12px 0; color:var(--muted); text-align:center; }
.assistant-message { border-radius:12px; padding:9px 12px; background:var(--ground); color:var(--ink); overflow-wrap:anywhere; min-width:0; }
.assistant-message.user { background:var(--accent-soft); justify-self:end; max-width:88%; white-space:pre-wrap; }
.assistant-message:has(.assistant-result) { padding:0; background:none; }
.assistant-result { display:grid; gap:5px; padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:var(--paper); }
.assistant-result header { display:flex; align-items:center; justify-content:space-between; gap:6px; color:var(--muted); }
.assistant-result header span { display:inline-flex; align-items:center; gap:6px; }
.assistant-result header b { flex:none; padding:2px 8px; border-radius:99px; background:var(--accent-soft); color:var(--ink); }
.assistant-result > strong { font-size:clamp(17px,2vw,24px); line-height:1.25; font-variant-numeric:tabular-nums; }
.assistant-result summary { font-weight:700; color:var(--accent); }
.assistant-message p { margin:5px 0; }
.assistant-message ul { padding-left:20px; margin:5px 0; }
.assistant-message small { color:var(--muted); }
.assistant-message summary { cursor:pointer; margin:4px 0; }
.assistant-composer { display:flex; align-items:end; gap:8px; border:1px solid var(--line); background:var(--paper); border-radius:12px; padding:5px; margin:6px 10px 10px; }
.assistant-composer textarea { flex:1; min-width:0; resize:vertical; min-height:42px; max-height:108px; background:transparent; color:var(--ink); border:0; font:inherit; padding:8px; }
.assistant-composer .btn { min-height:42px; }
.assistant-loading { display:flex; gap:8px; align-items:center; }
.assistant-loading i { display:inline-block; width:17px; height:17px; flex:0 0 17px; border:2px solid var(--line); border-top-color:#14857b; border-radius:50%; animation:assistant-spinner .75s linear infinite; }
@keyframes assistant-spinner { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) {
  .assistant-loading i,.assistant-launcher-icon,.assistant-launcher-bubble { animation:none; }
  .assistant-home { transition:none; }
}
.assistant-toggle { display:flex!important; align-items:center; gap:9px; cursor:pointer; }
.assistant-toggle input { position:absolute; width:1px; height:1px; opacity:0; }
.assistant-toggle span { position:relative; width:42px; height:24px; border-radius:99px; flex:0 0 42px; background:#667789; }
.assistant-toggle span::before { content:''; position:absolute; inset:3px auto 3px 3px; width:18px; background:white; border-radius:50%; transition:transform .16s; }
.assistant-toggle input:checked+span { background:#14786d; }
.assistant-toggle input:checked+span::before { transform:translateX(18px); }
.assistant-toggle input:focus-visible+span { outline:2px solid var(--accent); outline-offset:3px; }
.assistant-usage-account { padding:8px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.assistant-usage-account summary { cursor:pointer; }
.assistant-usage-account p,.assistant-usage-account li { margin:4px 0; font-size:13px; }
.assistant-usage-account small { color:var(--muted); }
@media(min-width:1440px) {
  .dashboard-studio:has([data-assistant-home]:not([hidden])) { gap:4px; }
}
@media(max-width:900px), (hover:none) and (pointer:coarse) {
  .assistant-launcher,.assistant-popover { display:none!important; }
}
@media(max-width:900px) {
  .dashboard-studio .dashboard-focus-grid { display:none; }
}
@media(max-width:700px) {
  .assistant-task-row { grid-template-columns:26px minmax(0,1fr) auto; gap:6px; }
  .assistant-task-icon { grid-area:1 / 1 / 3 / 2; align-self:start; width:26px; height:26px; }
  .assistant-task-copy { display:contents; }
  .assistant-task-copy strong { grid-area:1 / 2; min-width:0; font-size:13px; overflow-wrap:anywhere; }
  .assistant-task-copy small { grid-area:2 / 2 / 3 / 4; min-width:0; overflow-wrap:anywhere; }
  .assistant-task-amount { grid-area:1 / 3; }
  .assistant-task-amount b { font-size:15px; }
  .assistant-detail-table :is(th,td) { padding-inline:3px; font-size:12px; }
  .assistant-composer .btn { padding-inline:9px; }
}
