/* AI CMO workspace inside the ANVIKOS app: the plugin's own header and top tabs are replaced by
   the ANVIKOS header and the left-side menu. */
.cmo-page #ama-app > .ama-header,
.cmo-page #ama-app > .ama-tabs { display: none; }
.cmo-page .app-main { padding-top: 20px; padding-bottom: 48px; }
.cmo-page #ama-app { margin: 0; max-width: none; }
.cmo-page #ama-app.ama-loading { padding: 80px 0; text-align: center; }
.cmo-message { max-width: 640px; margin: 40px auto; }
.cmo-message h1 { font-size: 24px; margin: 0 0 8px; }
/* "Ask AI Agent" (bottom-right) lives in the AI Assistant window (History and Presentation tabs) only. */
.cmo-page:not(.is-ai-assistant) .ama-float-ask-toggle, .cmo-page:not(.is-ai-assistant) .ama-float-ask-panel { display: none !important; }

/* Choose Facebook Page / Instagram account */
.cmo-picker { max-width: 720px; margin: 24px auto; }
.cmo-picker h1 { font-size: 22px; margin: 0 0 6px; }
.picker-list { display: grid; gap: 10px; margin: 16px 0; }
.picker-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0; font-weight: 400; }
.picker-item:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.picker-item.is-disabled { opacity: .6; cursor: not-allowed; }
.picker-item input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); }
.picker-item span { display: grid; }
.picker-item small { color: var(--ink-3); font-size: 14px; }

/* ANVIKOS dark blue: the plugin's own dark dashboard design, with its background in ANVIKOS navy.
   Cards, text, accents and status colours stay exactly as the plugin's dark theme defines them. */
#ama-app[data-theme="client"] {
  --ama-bg-0: #061331;
  --ama-bg-1: #0a1b45;
  --ama-bg-2: #0c2152;
}
body.cmo-page { background: #fff; }
.cmo-page .app-main { background: #fff; }
/* Around the dark-blue workspace and its windows: white, not black. */
.cmo-page #ama-app[data-theme="client"] .ama-modal-overlay { background: rgba(255, 255, 255, .92); }
.cmo-page #ama-app.ama-loading, .cmo-page #ama-app:not([data-theme]) .anv-fetching { color: #0b2e6b; }
.cmo-page .sidenav { background: #fff; }
#cmo-flash { margin: 0 0 16px; }
.cmo-page .cmo-message, .cmo-page .cmo-picker { color: var(--ink); }

/* Full-size profile windows: fill the space beside the left menu and under the header, so the menu
   stays visible. --cmo-top / --cmo-left are measured by cmo.js; the fallbacks match the layout. */
.cmo-page #ama-app .ama-modal-overlay {
  inset: var(--cmo-top, 72px) 0 0 var(--cmo-left, calc(max(0px, (100vw - 1480px) / 2) + 236px));
  padding: 16px 20px 20px;
  align-items: stretch;
}
.cmo-page #ama-app .ama-modal-shell {
  max-width: none;
  max-height: none;
  height: 100%;
  margin: 0;
  border-radius: 14px;
}
@media (max-width: 900px) {
  .cmo-page #ama-app .ama-modal-overlay { inset: var(--cmo-top, 64px) 0 0 0; padding: 8px; }
  .cmo-page #ama-app .ama-modal-shell { padding: 16px; border-radius: 12px; }
  .cmo-page #ama-app .ama-modal-header { top: -16px; margin: -16px -16px 12px; padding: 14px 16px; }
}

/* "Fetching Live Data" with a sand timer: shown while the workspace pulls data. */
.anv-hourglass {
  display: inline-block; width: 28px; height: 28px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230047ab' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2h12M6 22h12M7 2v3a5 5 0 0 0 2.5 4.3L12 11l2.5-1.7A5 5 0 0 0 17 5V2M7 22v-3a5 5 0 0 1 2.5-4.3L12 13l2.5 1.7A5 5 0 0 1 17 19v3'/%3E%3Cpath d='M9.6 19.6h4.8L12 17.4z' fill='%230047ab'/%3E%3Cpath d='M10 6.2h4L12 8z' fill='%230047ab'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: anv-flip 1.6s ease-in-out infinite;
}
@keyframes anv-flip { 0%, 40% { transform: rotate(0deg); } 60%, 100% { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .anv-hourglass { animation: none; } }
.anv-fetching {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px 16px; text-align: center; color: #0047ab; font-size: 15px;
}
.anv-fetching strong { font-weight: 700; letter-spacing: .2px; }
.anv-fetching-sub { color: #5b6475; font-size: 13px; font-weight: 400; }
.anv-fetching .anv-hourglass { width: 34px; height: 34px; }

/* Floating badge while any request is running (also when opening a platform window). */
#anv-live {
  position: fixed; z-index: 100001; bottom: 28px;
  left: calc(var(--cmo-left, 0px) + (100vw - var(--cmo-left, 0px)) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 14px;
  background: #fff; color: #0047ab; font-weight: 700; font-size: 15px;
  border: 1px solid #c9d8f0; border-radius: 999px; box-shadow: 0 10px 30px -8px rgba(15, 23, 42, .28);
  pointer-events: none; white-space: nowrap;
}
#anv-live[hidden] { display: none; }
#anv-live .anv-hourglass { width: 22px; height: 22px; }
/* ANVIKOS note on a KPI card (e.g. "Total on 2 Oct 2026 ...") */
.cmo-page #ama-app .anv-kpi-note { width: 0; min-width: 100%; box-sizing: border-box; margin-top: 6px; font-size: 12px; line-height: 1.45; color: #5b6475; background: #f3f6fb; border-radius: 8px; padding: 6px 8px; }

/* On the dark workspace: light sand timer, text and notes. */
#ama-app[data-theme="client"] .anv-hourglass { filter: brightness(0) invert(1) opacity(.85); }
#ama-app[data-theme="client"] .anv-fetching { color: #dbe4fb; }
#ama-app[data-theme="client"] .anv-fetching-sub { color: #9fb0d4; }
.cmo-page #ama-app .anv-kpi-note { color: var(--ama-text-2, #a8b3c7); background: rgba(255, 255, 255, .06); }
.anv-history { display: flex; gap: 12px; align-items: center; }
.alert-info { background: #eaf1fd; color: #0b2e6b; border-color: #bcd2f5; }

/* WordPress admin basics the plugin's screens rely on (in WordPress they come from wp-admin's own
   stylesheet). Zero-specificity, so every rule of the plugin itself still wins. */
:where(#ama-app) { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 13px; line-height: 1.4em; }
:where(#ama-app) :where(p) { font-size: 13px; line-height: 1.5; margin: 1em 0; }
:where(#ama-app) :where(.description) { font-size: 13px; font-style: normal; color: var(--ama-text-3, #646970); }
:where(#ama-app) :where(h1) { font-size: 23px; font-weight: 400; margin: 0; padding: 9px 0 4px; line-height: 1.3; }
:where(#ama-app) :where(h2) { font-size: 1.3em; margin: 1em 0; }
:where(#ama-app) :where(h3) { font-size: 1.3em; margin: 1em 0; }
:where(#ama-app) :where(.button) { display: inline-block; font-size: 13px; line-height: 2.15384615; min-height: 30px; margin: 0; padding: 0 10px; cursor: pointer; border: 1px solid var(--ama-card-border, #2271b1); border-radius: 3px; background: var(--ama-card-strong, #f6f7f7); color: var(--ama-text-1, #2271b1); white-space: nowrap; }
:where(#ama-app) :where(.button-small) { min-height: 26px; line-height: 2.18181818; padding: 0 8px; font-size: 11px; }
:where(#ama-app) :where(select) { font-size: 14px; line-height: 2; min-height: 30px; padding: 0 24px 0 8px; border-radius: 3px; }
:where(#ama-app) :where(input[type=text], input[type=search], input[type=date], input[type=number], input[type=url], textarea) { font-size: 14px; padding: 0 8px; line-height: 2; min-height: 30px; border-radius: 4px; }

.cmo-page #ama-app .anv-history-empty { line-height: 1.6; }
.cmo-page #ama-app .anv-history-empty strong { color: var(--ama-text-1, #f3f5fa); }

/* AI Assistant: History and Presentation tabs */
.ai-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.ai-tabs a { padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; background: #fff; }
.ai-tabs a:hover, .ai-tabs a.active { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
ul.picker-list { list-style: none; padding: 0; }
.picker-item.is-done { border-color: #a7f3d0; background: #ecfdf5; }
.picker-item.is-done small { color: #047857; }
