/* Athena side pane: the Documents chat pane, shared by the process editor
   and the image editor. Rules copied verbatim from workspace.css (generated),
   scoped under .ap-scope, with the Documents design variables. */
.ap-scope {
  --s0: #0a0a0c; --s1: #121214; --s2: #1a1a1e; --s3: #242428; --s4: #2e2e34;
  --text: #f2f0ee; --text-dim: #b8b5b0; --text-mute: #8a8783;
  --gold: #C5A572; --gold-soft: #E3C88F; --gold-deep: #A88550; --gold-glow: rgba(197,165,114,0.2);
  --line: rgba(255,255,255,0.08); --line-strong: rgba(255,255,255,0.14);
}
[data-theme="light"] .ap-scope {
  --s0: #F8F7FB; --s1: #FFFFFF; --s2: #FFFFFF; --s3: #F0EEF4; --s4: #E9E6EF;
  --text: #191423; --text-dim: #4a4550; --text-mute: #6A6880;
  --line: rgba(20,16,46,0.09); --line-strong: rgba(20,16,46,0.16); --gold-glow: rgba(197,165,114,0.25);
}
.ap-scope .dv-chat { position: sticky; top: 16px; height: calc(100vh - 170px); min-height: 480px; display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 24px 56px -32px rgba(0,0,0,.4); }
.ap-scope .dc-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.ap-scope .dc-head img { width: 30px; height: 30px; border-radius: 50%; }
.ap-scope .dc-head .t { font-weight: 800; font-size: 14.5px; color: var(--text); letter-spacing: -.01em; }
.ap-scope .dc-head .s { font-size: 12px; color: var(--text-mute); }
.ap-scope .dc-close { display: none; margin-left: auto; width: 32px; height: 32px; border: none; border-radius: 50%; background: var(--s3); color: var(--text); cursor: pointer; }
.ap-scope .dc-scroll { flex: 1; overflow-y: auto; padding: 18px 16px 8px; }
.ap-scope .dc-empty { text-align: center; padding: 18px 6px 6px; }
.ap-scope .dc-orb { width: 54px; height: 54px; border-radius: 50%; margin-bottom: 14px; box-shadow: 0 8px 28px var(--gold-glow); }
.ap-scope .dc-empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.ap-scope .dc-empty p { margin: 0 auto; max-width: 290px; font-size: 13px; line-height: 1.6; color: var(--text-mute); }
.ap-scope .dc-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.ap-scope .dc-chip { display: flex; align-items: center; gap: 11px; text-align: left; border: 1px solid var(--line-strong); background: var(--s2); border-radius: 12px; padding: 11px 14px; font: inherit; font-size: 13px; line-height: 1.4; color: var(--text-dim); cursor: pointer; transition: all .15s; }
.ap-scope .dc-chip i { color: var(--gold); font-size: 12px; flex: none; }
.ap-scope .dc-chip:hover { border-color: var(--gold); color: var(--text); transform: translateY(-1px); box-shadow: 0 8px 20px -12px rgba(0,0,0,.4); }
.ap-scope .dm { display: flex; gap: 10px; margin-bottom: 14px; animation: dm-in .24s ease-out; }
@keyframes dm-in { from { opacity: 0; transform: translateY(6px); } }
.ap-scope .dm.user { justify-content: flex-end; }
.ap-scope .dm-bubble { max-width: 100%; padding: 10px 14px; font-size: 13.5px; line-height: 1.55; background: var(--s3); color: var(--text); border-radius: 16px 16px 16px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ap-scope .dm.user .dm-bubble { background: var(--gold); color: #14102E; border-radius: 16px 16px 4px 16px; font-weight: 500; max-width: 88%; }
.ap-scope .dm-av { width: 26px; height: 26px; border-radius: 50%; flex: none; margin-top: 2px; }
.ap-scope .dm-body { min-width: 0; flex: 1; }
.ap-scope .dm.err .dm-bubble { background: rgba(200,80,80,.1); border: 1px solid rgba(200,80,80,.35); }
.ap-scope .dm-changes { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.ap-scope .dm-change { display: flex; align-items: center; gap: 9px; text-align: left; border: 1px solid var(--line); background: var(--s2); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 12px; color: var(--text-dim); cursor: pointer; transition: all .15s; }
.ap-scope .dm-change:not([disabled]):hover { border-color: var(--gold); color: var(--text); }
.ap-scope .dm-change[disabled] { cursor: default; }
.ap-scope .dm-change i { font-size: 11px; width: 13px; text-align: center; flex: none; }
.ap-scope .dm-change.replace i { color: var(--gold); } .dm-change.insert i { color: var(--green); } .dm-change.delete i { color: #d86a6a; }
.ap-scope .dm-change .k { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; flex: none; }
.ap-scope .dm-change .sn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-mute); }
.ap-scope .dm-more { align-self: flex-start; border: none; background: transparent; color: var(--text-mute); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 3px 4px; }
.ap-scope .dm-more:hover { color: var(--text); }
.ap-scope .dm-actions { margin-top: 8px; }
.ap-scope .dm-undo { border: none; background: transparent; color: var(--text-mute); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 5px 8px; margin-left: -8px; border-radius: 8px; transition: all .15s; }
.ap-scope .dm-undo:hover { color: var(--text); background: var(--s3); }
.ap-scope .dm-tag { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--text-mute); }
.ap-scope .dm.undone .dm-changes { opacity: .45; }
.ap-scope .dm.undone .dm-change .sn { text-decoration: line-through; }
.ap-scope .dm.typing .dm-bubble { display: inline-flex; align-items: center; color: var(--text-dim); }
@keyframes dotp { 0%, 80%, 100% { transform: scale(.55); opacity: .45; } 40% { transform: scale(1); opacity: 1; } }
.ap-scope .dc-composer { margin: 8px 14px 6px; display: flex; align-items: flex-end; gap: 8px; background: var(--s2); border: 1px solid var(--line-strong); border-radius: 16px; padding: 8px 8px 8px 15px; transition: border-color .2s, box-shadow .2s; }
.ap-scope .dc-composer:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.ap-scope .dc-composer textarea { flex: 1; border: none !important; background: transparent !important; resize: none; min-height: 0 !important; padding: 6px 0 !important; font-size: 14px; line-height: 1.5; max-height: 160px; box-shadow: none !important; border-radius: 0 !important; color: var(--text); }
.ap-scope .dc-send { width: 34px; height: 34px; border: none; border-radius: 50%; background: var(--gold); color: #14102E; cursor: pointer; flex: none; font-size: 13px; transition: transform .15s, opacity .15s, filter .15s; }
.ap-scope .dc-send:disabled { opacity: .3; cursor: default; }
.ap-scope .dc-send:not(:disabled):hover { filter: brightness(1.08); transform: scale(1.07); }
.ap-scope .dc-foot { font-size: 11px; color: var(--text-mute); text-align: center; padding: 0 14px 13px; }
.ap-scope .dc-sel { display: flex; align-items: center; gap: 8px; margin: 0 14px 6px; padding: 7px 11px; font-size: 12px; color: var(--text-dim); background: rgba(197,165,114,.1); border: 1px solid rgba(197,165,114,.35); border-radius: 10px; animation: dm-in .18s ease-out; }
.ap-scope .dc-sel i { color: var(--gold); font-size: 11px; flex: none; }
.ap-scope .dc-sel span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-style: italic; }
.ap-scope .dc-composer textarea:focus, .ap-scope .dc-composer textarea:focus-visible { outline: none !important; border: none !important; box-shadow: none !important; }
.ap-scope .dc-composer:focus-within { border-color: var(--line-strong); box-shadow: none; }
.ap-scope .dc-head athena-owl.dc-owl { --athena-size: 38px; flex: 0 0 auto; margin: -4px 0; }
.ap-scope .dc-collapse { margin-left: auto; width: 30px; height: 30px; border: none; border-radius: 8px; background: transparent; color: var(--text-mute); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .2s, color .2s; }
.ap-scope .dc-collapse:hover { background: var(--s3); color: var(--text); }
.ap-scope .dc-collapse:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@keyframes owlFabWake { 0% { transform: scale(1); } 40% { transform: scale(1.08) translateY(-6px); opacity: 1; } 100% { transform: scale(.7) translateY(10px); opacity: 0; } }

/* Placement over an editor: a floating right-hand pane, asleep by default. */
.ap-scope .dv-chat.ap-pane { position: absolute; top: 72px; right: 18px; bottom: 18px; width: 400px; height: auto; min-height: 0; z-index: 7; display: none; box-shadow: 0 20px 60px rgba(0,0,0,.35); font-family: var(--ff-body, 'Inter Variable', system-ui, sans-serif); }
.ap-scope.ap-awake .dv-chat.ap-pane { display: flex; }
.ap-scope .dc-head athena-owl.dc-owl { --athena-size: 38px; flex: 0 0 auto; margin: -4px 0; }
.ap-scope .dc-orb-owl { --athena-size: 72px; display: block; margin: 0 auto 10px; }
.ap-scope .dc-collapse { margin-left: auto; width: 30px; height: 30px; border: none; border-radius: 8px; background: transparent; color: var(--text-mute); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ap-scope .dc-collapse:hover { background: var(--s3); color: var(--text); }
.ap-scope .dc-composer textarea:focus { outline: none !important; border: none !important; box-shadow: none !important; }
.ap-scope .dc-composer:focus-within { border-color: var(--line-strong); box-shadow: none; }
.ap-scope .ap-fab { position: absolute; right: 22px; bottom: 22px; z-index: 6; width: 168px; height: 168px; padding: 0; border: none; border-radius: 50%; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .25s ease, opacity .25s ease; }
.ap-scope .ap-fab athena-owl { --athena-size: 168px; pointer-events: none; filter: drop-shadow(0 10px 22px rgba(20,16,46,.35)); }
.ap-scope .ap-fab:hover { transform: translateY(-3px); }
.ap-scope .ap-fab:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.ap-scope .ap-fab.waking { animation: owlFabWake .42s ease forwards; }
.ap-scope.ap-awake .ap-fab { display: none; }
@media (max-width: 768px) {
  .ap-scope .dv-chat.ap-pane { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; height: min(78vh, 660px); }
  .ap-scope .ap-fab { width: 84px; height: 84px; right: 14px; bottom: 14px; }
  .ap-scope .ap-fab athena-owl { --athena-size: 84px; }
}
@media (prefers-reduced-motion: reduce) { .ap-scope .ap-fab, .ap-scope .ap-fab.waking, .ap-scope .dm { animation: none; transition: none; } }
/* The editor's own prompt and status chip give way to the pane. */
body.maps-open .input-area { display: none !important; }
body.maps-open #mapIterateStatus { display: none !important; }
@media (max-width: 768px) { body.maps-open .maps-overlay { bottom: 0; } }

.ap-scope .dm-owl { flex: 0 0 28px; width: 28px; height: 28px; }
.ap-scope .dc-send svg, .ap-scope .dc-collapse svg { display: block; }
.ap-scope .dc-send { display: inline-flex; align-items: center; justify-content: center; }
#canvasOverlayEditor.ap-scope { position: relative; }
#canvasOverlayEditor.ap-scope .dv-chat.ap-pane { top: 64px; }
