/* « Alma anywhere »: the conversation as a panel docked to the right of the cockpit (analytics_anywhere.js), and the folders' colours in
   the conversation pane. The panel lives inside the cockpit's frame (a third column of `.ki-layout`), so it wears the cockpit's own
   tokens and the board beside it reflows narrower: nothing is ever drawn over the analysis. */

/* ---------------------------------------------------------------- the header's button */
.anywhere-btn{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;margin-left:8px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;
  color:var(--fr-ink-hi);background:var(--fr-wash);border:1px solid var(--fr-edge);border-radius:var(--theme-r-m);padding:6px 11px;transition:background .15s,color .15s}
.anywhere-btn[hidden]{display:none}
.anywhere-btn:hover{background:var(--fr-sel);color:var(--on-accent)}
.anywhere-btn:focus-visible{outline:2px solid var(--fr-focus);outline-offset:2px}
.anywhere-btn .ki-i{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.anywhere-btn .ki-ai{margin-left:0;background:var(--fr-ai-bg);color:var(--fr-ai-fg)}
.anywhere-btn[aria-pressed=true]{background:var(--fr-sel);color:var(--fr-strong);border-color:var(--fr-edge-strong)}
.anywhere-btn[aria-pressed=true] .ki-ai{background:var(--fr-ai-bg);color:var(--fr-ai-fg)}
/* The header has room for its places and this button down to 1280 px: below 1360 the button keeps its mark and its badge, the places tighten. */
@media(max-width:1360px){
  .anywhere-btn{gap:5px;padding:6px 8px;margin-left:4px}
  .anywhere-btn span:not(.ki-ai){display:none}
}
/* Header places only: on a phone they are the bottom bar, laid out in analytics_indicators.css (#859). */
@media(min-width:701px) and (max-width:1360px){body.cockpit-places .app-places button{padding:8px 9px;gap:5px}}
@media(max-width:700px){.anywhere-btn{margin-left:2px}}

/* ---------------------------------------------------------------- the panel: a third column of the cockpit's frame */
@media(min-width:901px){
  body.cockpit-places .ki-layout.aw-open{grid-template-columns:var(--ki-nav-w,248px) minmax(0,1fr) var(--aw-w,400px)}
  body.cockpit-places .ki-layout.ki-folded.aw-open{grid-template-columns:0 minmax(0,1fr) var(--aw-w,400px)}
  body.cockpit-places .ki-layout.aw-open.aw-collapsed{grid-template-columns:var(--ki-nav-w,248px) minmax(0,1fr) 44px}
  body.cockpit-places .ki-layout.ki-folded.aw-open.aw-collapsed{grid-template-columns:0 minmax(0,1fr) 44px}
  body.cockpit-places #indicators-host .aw{position:sticky;top:0;align-self:start;height:calc(100dvh - var(--header-h,56px));display:flex;flex-direction:column;min-width:0;
    background:var(--ki-card);border-left:1px solid var(--ki-line);box-shadow:-8px 0 22px rgba(14,23,38,.05)}
  .ki-layout.aw-resizing{transition:none;user-select:none;cursor:col-resize}
}
#indicators-host .aw[hidden]{display:none}
#indicators-host .aw{position:relative;display:flex;flex-direction:column;min-width:0;background:var(--ki-card);color:var(--ki-body)}
.aw-resize{display:none}
@media(min-width:901px){
  .aw-resize{display:block;position:absolute;left:-3px;top:0;bottom:0;width:7px;cursor:col-resize;z-index:3;touch-action:none}
  .aw-resize:hover,.aw-resize:focus-visible,.aw-resizing .aw-resize{background:var(--fr-grip);outline:0}
}
.aw-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 10px 10px 16px;border-bottom:1px solid var(--ki-line)}
.aw-title{font-size:14px;font-weight:700;color:var(--ki-text)}
.aw-tools{display:flex;gap:2px}
#indicators-host .aw-tools button{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;background:transparent;color:var(--ki-muted);border-radius:var(--theme-r-m)}
/* « Ouvrir en grand » says in words where it leads (the conversation's full view); the other four stay icons with a spoken name. */
#indicators-host .aw-tools button.aw-full{display:inline-flex;align-items:center;gap:6px;width:auto;padding:0 8px;font-size:12px;white-space:nowrap}
/* Dragged to its narrowest the panel has no room for the words: the button is an icon again there, with the same spoken name. */
.aw-head{container-type:inline-size}
@container (max-width:334px){#indicators-host .aw-tools button.aw-full{display:grid;width:30px;padding:0}#indicators-host .aw-tools button.aw-full span{display:none}}
#indicators-host .aw-tools button:hover{background:var(--ki-soft);color:var(--ki-text);border:0}
#indicators-host .aw-tools button[aria-expanded=true]{background:var(--ki-soft);color:var(--ki-text)}
.aw .ki-i{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.aw-context{display:flex;flex-wrap:wrap;gap:6px;padding:8px 16px;border-bottom:1px solid var(--ki-line)}
.aw-context[hidden]{display:none}
.aw-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;line-height:1.2;padding:3px 9px;border-radius:var(--theme-r-pill);background:var(--ki-soft);color:var(--ki-slate)}
.aw-starters{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:8px 14px 0}
.aw-starters[hidden]{display:none}
.aw-starter{white-space:normal;text-align:left;cursor:pointer;border:1px solid var(--ki-line,transparent);font-size:12.5px;padding:5px 11px}
.aw-starter:hover{background:color-mix(in srgb,var(--ki-teal) 14%,var(--ki-soft))}
.aw-chip-card{background:color-mix(in srgb,var(--ki-teal) 16%,var(--ki-soft));color:var(--ki-text)}
#indicators-host .aw-chip button{border:0;background:transparent;padding:0 2px;font-size:13px;line-height:1;color:var(--ki-muted)}
.aw-history{position:absolute;top:52px;left:10px;right:10px;z-index:6;max-height:55%;overflow:auto;padding:6px;background:var(--ki-card);border:1px solid var(--ki-line);border-radius:var(--theme-r-l);box-shadow:var(--ki-shadow),var(--theme-shadow-pop)}
.aw-history[hidden]{display:none}
#indicators-host .aw-history button{display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:0;background:transparent;padding:7px 9px;border-radius:var(--theme-r-m);font-size:12.8px;color:var(--ki-text)}
#indicators-host .aw-history button:hover{background:var(--ki-soft)}
#indicators-host .aw-history button[aria-current=true]{font-weight:700}
.aw-history span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.aw-dot{flex:0 0 9px;width:9px;height:9px;border-radius:50%;background:var(--fc)}
#alma-anywhere .aw-day{margin:8px 10px 2px;font-size:var(--theme-fs-min);letter-spacing:.06em;text-transform:uppercase}
.aw-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:14px 16px;scrollbar-width:thin}
.aw-composer{flex:0 0 auto;padding:10px 12px 12px;border-top:1px solid var(--ki-line)}
.aw-rail{display:none}

/* collapsed: a narrow rail, one click from the conversation */
.aw-collapsed .aw-head,.aw-collapsed .aw-context,.aw-collapsed .aw-history,.aw-collapsed .aw-body,.aw-collapsed .aw-composer,.aw-collapsed .aw-resize{display:none}
#indicators-host .aw-collapsed .aw-rail{display:flex;flex-direction:column;align-items:center;gap:10px;width:100%;height:100%;padding:16px 0;border:0;border-radius:0;background:transparent;color:var(--ki-text);cursor:pointer}
#indicators-host .aw-collapsed .aw-rail:hover{background:var(--ki-soft)}
.aw-rail span:first-child{writing-mode:vertical-rl;font-size:13px;font-weight:700;letter-spacing:.4px}
.aw-rail .ki-ai{margin:0}

/* ---------------------------------------------------------------- the conversation hosted in the panel */
.aw-body #thread,.aw-body #welcome-studio,.aw-body #board-stage,.aw-body #plan-validation-host{max-width:none;margin:0;padding-left:0;padding-right:0}
.aw-body #welcome-studio{padding-top:0;min-height:0}
.aw-body #welcome-greeting,.aw-body #dataset-summary,.aw-body #focus-topics{display:none}
.aw.aw-screen-asks .aw-body #welcome-suggestions{display:none}
.aw-body .turn-ask{margin-bottom:16px}
.aw-body .turn-answer{max-width:none}
.aw-body .turn-answer>*{max-width:none}
/* The data map reflows to the panel's own width: as many columns as fit, one when narrow; names wrap. */
.aw-body .dm-groups{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr))}
.aw-body .dm-group.ref{grid-column:auto;grid-row:auto}
.aw-body .dm-group,.aw-body .dm-cards,.aw-body .dm-card{min-width:0}
.aw-body .dm-card-label,.aw-body .dm-card-meta,.aw-body .dm-group-title{overflow-wrap:anywhere}
.aw-composer .composer-tools-bar,.aw-composer #composer-filters{display:none!important}
body.anywhere-open #surface-switch{display:none!important}

/* ---------------------------------------------------------------- a proposed card */
.aw-proposal .aw-preview{margin:10px 0 6px}
.aw-proposal .aw-preview .db-cell{display:block}
.aw-proposal .aw-preview .db-card{box-shadow:var(--ki-shadow)}
.aw-actions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.aw-alt{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
#indicators-host .aw-pick{border-radius:var(--theme-r-pill);font-size:12px;padding:4px 11px}
.aw-note{margin:2px 0 4px;font-size:12px;color:var(--ki-muted)}
.aw-error{margin:4px 0;font-size:12.5px;color:var(--ki-red)}
/* the cockpit's controls proposed in the conversation: the same card as ever, in the panel */
#alma-anywhere .aw-controls .pva-primary{border:0;border-radius:var(--theme-r-m);padding:7px 12px;background:var(--cta);color:var(--on-accent);font-weight:600;font-size:12px;cursor:pointer}
#alma-anywhere .aw-controls .pva-link{border:0;background:none;padding:2px 0;color:var(--ki-muted);font-size:12px;text-decoration:underline;cursor:pointer}
#alma-anywhere .aw-controls .pva-link:hover{color:var(--ki-text)}
.aw-controls .aw-muted{margin:0;font-size:12.5px;color:var(--ki-muted)}
/* the card the conversation is about, on its board */
#indicators-host .db-cell.db-focus .db-card{box-shadow:0 0 0 2px var(--ki-teal),var(--ki-shadow)}

/* ---------------------------------------------------------------- a phone: the panel is a sheet over the page, closed by its ✕ */
@media(max-width:900px){
  #indicators-host .aw{position:fixed;left:0;right:0;bottom:0;top:var(--header-h,56px);z-index:130;height:auto;border-left:0;box-shadow:none}
  body.cockpit-places #indicators-host .aw{bottom:62px}
  .aw-collapsed{display:none!important}
}

/* ---------------------------------------------------------------- the folders' colours, in the conversation pane */
.ki-fc-red{--fc:#E0606E}.ki-fc-amber{--fc:#E0A53A}.ki-fc-green{--fc:#38B27A}.ki-fc-teal{--fc:#2AA7B8}
.ki-fc-blue{--fc:#5B93EE}.ki-fc-violet{--fc:#9577DC}.ki-fc-pink{--fc:#DC76A9}.ki-fc-slate{--fc:#8C9AB0}
#indicators-host .ki-folder-dot{display:inline-grid;place-items:center;width:auto;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;border-radius:var(--theme-r-s)}
#indicators-host .ki-folder-dot:hover{border:0;background:var(--fr-hover)}
#indicators-host .ki-folder.ki-fc .ki-folder-dot{color:var(--fc)}
#indicators-host .ki-folder.ki-fc .ki-folder-dot .ki-i{fill:color-mix(in srgb,var(--fc) 28%,transparent)}
#indicators-host .ki-conv-row.ki-fc{box-shadow:inset 2px 0 0 var(--fc)}
.ki-palette{display:flex;flex-wrap:wrap;gap:6px;padding:6px 10px 8px}
#indicators-host .ki-palette .ki-swatch{width:17px;height:17px;min-width:17px;padding:0;border-radius:50%;border:2px solid transparent;background:var(--fc);color:var(--on-accent);font-size:11px;line-height:1}
#indicators-host .ki-palette .ki-swatch:hover{border-color:var(--fr-edge-strong)}
#indicators-host .ki-palette .ki-swatch[aria-pressed=true]{border-color:var(--on-accent);box-shadow:0 0 0 1px rgba(14,23,38,.6)}
#indicators-host .ki-palette .ki-swatch-none{background:transparent;border:1px dashed var(--fr-edge-strong);color:var(--fr-ink)}
