/* Mars AI Operator — comments widget styles (reused from AutoLMS).
   Self-contained vars so it works on any module palette.
   --ink / --line / --paper are reused from the host module if defined. */
:root{
  --ac-paper-2:#ffffff;
  --ac-ink-soft:#4a4a55;
  --ac-ink-faint:#8a8a96;
  --ac-line-strong:#d8d2c2;
  --ac-accent:#2f3a6e;
  --ac-accent-soft:#50609c;
  --ac-accent-wash:#eef0f7;
  --ac-gold:#9a7b3f;
  --ac-ok:#3f7a52;
  --ac-shadow-sm:0 1px 2px rgba(26,26,34,.06), 0 2px 10px rgba(26,26,34,.07);
}
.ac-block { transition: background .12s ease; }
mark.ac-mark { color: inherit; cursor: pointer; padding: 0 .5px; border-radius: 1px;
  background: linear-gradient(180deg, transparent 56%, color-mix(in srgb, var(--ac-gold) 34%, transparent) 56%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .15s ease; }
mark.ac-mark:hover { background: linear-gradient(180deg, transparent 48%, color-mix(in srgb, var(--ac-gold) 52%, transparent) 48%); }
mark.ac-mark.ac-flash, .ac-block.ac-flash { animation: ac-flash 1.6s ease; border-radius: 3px; }
@keyframes ac-flash { 0%, 30% { background: color-mix(in srgb, var(--ac-gold) 48%, transparent); } 100% { background: linear-gradient(180deg, transparent 56%, color-mix(in srgb, var(--ac-gold) 34%, transparent) 56%); } }

/* selection button */
.ac-selbtn { position: absolute; z-index: 10001; display: inline-flex; align-items: center; gap: 6px;
  background: var(--ac-accent); color: #fff; border: 0; border-radius: 9px; padding: 7px 12px;
  font: 600 13px/1 "Inter", system-ui, sans-serif; cursor: pointer; box-shadow: 0 6px 20px rgba(47,58,110,.32);
  animation: ac-fade .12s ease; }
.ac-selbtn svg { width: 15px; height: 15px; }
.ac-selbtn:active { transform: scale(.97); }
@keyframes ac-fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* popover (composer + thread) */
.ac-pop { position: absolute; z-index: 10002; width: 320px; max-width: 92vw;
  background: var(--ac-paper-2); border: 1px solid var(--ac-line-strong); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(26,26,34,.20); padding: 14px; font-family: "Inter", system-ui, sans-serif;
  animation: ac-fade .12s ease; }
.ac-pop-quote { font-size: 12.5px; line-height: 1.5; color: var(--ac-ink-soft); background: var(--paper, #fff);
  border-left: 3px solid var(--ac-gold); border-radius: 0 6px 6px 0; padding: 7px 10px; margin-bottom: 10px;
  max-height: 84px; overflow: auto; font-style: italic; }
.ac-pop-name, .ac-pop-text { width: 100%; font-family: "Inter", system-ui, sans-serif; font-size: 14px; color: var(--ink, #0a0a0a);
  background: #fff; border: 1px solid var(--ac-line-strong); border-radius: 9px; padding: 9px 11px; box-sizing: border-box; }
.ac-pop-name { margin-bottom: 8px; }
.ac-pop-text { resize: vertical; }
.ac-pop-name:focus, .ac-pop-text:focus { outline: 2px solid var(--ac-accent-soft); outline-offset: 1px; }
.ac-pop-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ac-pop-status { font-size: 12px; color: var(--ac-ink-faint); margin-right: auto; }
.ac-pop-cancel { background: none; border: 0; color: var(--ac-ink-faint); font: 600 13px "Inter", system-ui, sans-serif; cursor: pointer; padding: 7px 8px; border-radius: 8px; }
.ac-pop-cancel:hover { color: var(--ink, #0a0a0a); }
.ac-pop-send { display: inline-flex; align-items: center; gap: 6px; background: var(--ac-accent); color: #fff;
  border: 0; border-radius: 9px; padding: 8px 14px; font: 600 13px "Inter", system-ui, sans-serif; cursor: pointer; }
.ac-pop-send svg { width: 14px; height: 14px; }
.ac-pop-send:hover { filter: brightness(1.08); }
.ac-pop-send:active { transform: scale(.97); }
.ac-pop-send:disabled { opacity: .55; cursor: default; }

/* thread popover */
.ac-thread-list { display: grid; gap: 10px; margin-bottom: 10px; max-height: 260px; overflow: auto; }
.ac-tc { border-bottom: 1px solid var(--line, #e7e5e4); padding-bottom: 8px; }
.ac-tc:last-child { border-bottom: 0; padding-bottom: 0; }
.ac-tc.resolved { opacity: .55; }
.ac-tc.resolved .ac-ptext { text-decoration: line-through; }

/* meta + resolve shared */
.ac-pmeta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.ac-pauthor { font-weight: 600; font-size: 13.5px; }
.ac-ptime { font-size: 12px; color: var(--ac-ink-faint); }
.ac-ptext { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ac-ink-soft); white-space: pre-wrap; }
.ac-presolve, .ac-done { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12.5px; }
.ac-presolve svg, .ac-done svg { width: 14px; height: 14px; }
.ac-presolve { background: none; border: 0; cursor: pointer; color: var(--ac-ok); padding: 2px 0; }
.ac-presolve:hover { text-decoration: underline; }
.ac-done { color: var(--ac-ok); font-weight: 600; }

/* FAB + side panel (overview) */
.ac-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 52px; height: 52px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; background: var(--ac-accent);
  color: #fff; border: 0; box-shadow: 0 8px 24px rgba(47,58,110,.28); transition: transform .15s cubic-bezier(.16,1,.3,1); }
.ac-fab svg { width: 22px; height: 22px; }
.ac-fab:hover { transform: translateY(-2px); }
.ac-fab:active { transform: scale(.96); }
.ac-fab-n { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; background: var(--ac-gold);
  color: #fff; border-radius: 100px; font-size: 12px; font-weight: 700; display: none; align-items: center; justify-content: center; border: 2px solid var(--paper, #fff); }
.ac-fab.has .ac-fab-n { display: inline-flex; }

.ac-overlay { position: fixed; inset: 0; z-index: 65; background: rgba(26,26,34,.28); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
.ac-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: 380px; max-width: 92vw; background: var(--ac-paper-2);
  border-left: 1px solid var(--line, #e7e5e4); display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform .32s cubic-bezier(.16,1,.3,1); box-shadow: -16px 0 40px rgba(26,26,34,.10); }
.ac-panel-open .ac-overlay { opacity: 1; visibility: visible; }
.ac-panel-open .ac-panel { transform: translateX(0); }
.ac-phead { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line, #e7e5e4); }
.ac-phead h3 { font-family: "Instrument Serif", Georgia, serif; font-weight: 600; font-size: 20px; margin: 0; }
.ac-x { background: none; border: 0; cursor: pointer; color: var(--ac-ink-faint); padding: 6px; border-radius: 8px; line-height: 0; }
.ac-x svg { width: 20px; height: 20px; }
.ac-x:hover { color: var(--ink, #0a0a0a); background: var(--paper, #fff); }
.ac-plist { overflow-y: auto; padding: 14px 20px 28px; flex: 1; display: grid; gap: 14px; align-content: start; }
.ac-pitem { cursor: pointer; border: 1px solid var(--line, #e7e5e4); border-radius: 12px; padding: 13px; transition: border-color .15s ease, box-shadow .15s ease; }
.ac-pitem:hover { border-color: var(--ac-line-strong); box-shadow: var(--ac-shadow-sm); }
.ac-pquote { font-size: 12.5px; font-style: italic; color: var(--ac-ink-soft); border-left: 3px solid var(--ac-gold); padding: 3px 9px; margin-bottom: 8px; }
.ac-ploc { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ac-accent-soft); font-weight: 600; margin-bottom: 6px; }
.ac-pempty { text-align: center; color: var(--ac-ink-soft); padding: 40px 16px; line-height: 1.7; }
.ac-pempty span { font-size: 13px; color: var(--ac-ink-faint); }
.ac-retry { margin-top: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ac-accent); background: var(--ac-accent-wash); border: 1px solid var(--line, #e7e5e4); border-radius: 9px; padding: 8px 18px; }
.ac-skel { height: 70px; border-radius: 12px; background: linear-gradient(100deg, var(--paper, #fff) 30%, #f1ece1 50%, var(--paper, #fff) 70%); background-size: 200% 100%; animation: ac-shimmer 1.3s ease-in-out infinite; }
@keyframes ac-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ac-hint { position: fixed; right: 84px; bottom: 30px; z-index: 61; max-width: 280px;
  background: var(--ink, #0a0a0a); color: #fff; font-size: 13.5px; line-height: 1.45; border-radius: 12px;
  padding: 11px 12px 11px 14px; box-shadow: 0 8px 24px rgba(26,26,34,.28); display: flex; align-items: center; gap: 8px;
  animation: ac-fade .2s ease; }
.ac-hint button { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 2px; line-height: 0; flex: none; }
.ac-hint button svg { width: 15px; height: 15px; }
.ac-hint button:hover { color: #fff; }
.ac-hint::after { content: ""; position: absolute; right: -6px; bottom: 18px; width: 12px; height: 12px;
  background: var(--ink, #0a0a0a); transform: rotate(45deg); }
@media (max-width: 600px){ .ac-hint { right: 16px; bottom: 84px; } .ac-hint::after { display: none; } }
