/* Ask your workspace (js/askworkspace.js) — the standalone panel, and the
   answer + sources it renders inside the AI panel's "Ask workspace" tab.
   Tokens only (tests/elevate_test.mjs §10); the dim is var(--scrim), unblurred. */

.askws-layer {
  position: fixed; inset: 0; z-index: 1500;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 16px;
  background: var(--scrim);
  backdrop-filter: none;
}
.askws-panel {
  width: min(720px, 100%); max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--bg-modal); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-popover);
  overflow: hidden;
}
.askws-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.askws-title { margin: 0; font-size: 16px; font-weight: 600; }
.askws-close {
  border: 0; background: transparent; color: var(--text-light);
  font-size: 20px; line-height: 1; width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
}
.askws-close:hover { background: var(--bg-hover); color: var(--text); }
.askws-form { display: flex; gap: 8px; padding: 0 16px 12px; }
.askws-input {
  flex: 1; resize: none; min-height: 44px; padding: 10px 12px; font: inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.askws-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.askws-go {
  align-self: stretch; padding: 0 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--bg-modal); font-weight: 600;
}
.askws-go:disabled { opacity: .6; cursor: default; }
.askws-out { flex: 1; overflow: auto; padding: 0 16px 8px; }
.askws-turn { padding: 12px 0; border-top: 1px solid var(--border); }
.askws-q { font-weight: 600; margin-bottom: 8px; white-space: pre-wrap; }
.askws-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12px;
}
.askws-reindex {
  border: 1px solid var(--border); background: transparent; color: var(--text-light);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.askws-reindex:hover { background: var(--bg-hover); color: var(--text); }
.askws-reindex:disabled { opacity: .6; cursor: default; }

/* the answer + sources (panel and the AI tab) */
.askws-status { color: var(--text-faint); font-size: 12px; margin-bottom: 6px; }
.askws-answer { line-height: 1.55; }
.askws-error { color: var(--text); border-left: 3px solid var(--accent); padding-left: 8px; }
.askws-cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px;
  font-size: 11px; font-weight: 600; line-height: 1; vertical-align: super;
  color: var(--accent); background: var(--bg-hover);
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer;
}
.askws-cite:hover, .askws-cite:focus-visible { color: var(--bg-modal); background: var(--accent); }
.askws-sources { margin-top: 10px; }
.askws-sources-title { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 4px; }
.askws-source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.askws-source-btn {
  display: flex; gap: 8px; width: 100%; text-align: start; align-items: flex-start;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text); cursor: pointer; font: inherit;
}
.askws-source-btn:hover:not(:disabled) { background: var(--bg-hover); }
.askws-source-btn:disabled { cursor: default; opacity: .75; }
.askws-source.is-cited .askws-source-btn { border-color: var(--accent); }
.askws-source-num {
  flex: none; min-width: 18px; height: 18px; border-radius: 9px; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-hover); color: var(--accent);
}
.askws-source-body { display: flex; flex-direction: column; min-width: 0; }
.askws-source-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.askws-source-snippet {
  font-size: 12px; color: var(--text-light);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* the block a citation opened */
.block.askws-flash { animation: askws-flash 1.8s ease-out; border-radius: 4px; }
@keyframes askws-flash {
  0%, 30% { background: var(--bg-hover); box-shadow: 0 0 0 2px var(--accent); }
  100% { background: transparent; box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 760px) {
  .askws-layer { padding: 8px; align-items: stretch; }
  .askws-panel { max-height: none; height: 100%; }
}
