/*
CCS - Assistant + change-request queue styles.

@web @ccs
Everything for #/assistant (chat + My requests) and #/requests (developer
queue): tabs, chat bubbles, markdown-lite text, the pending-action confirm
card, the voice composer, and the shared note-thread / detail-field
primitives used by both the reporter and developer views. Extends
styles.css primitives (.card, .btn, .badge, .frm); every new selector here
is prefixed `as-`.
Keywords: assistant, chat, voice, change requests, queue, badges
*/

/* ---------- tabs ---------- */
.as-tabs {
  display: flex; border: 2px solid var(--ink); background: var(--card);
  box-shadow: var(--shadow); width: fit-content; margin-bottom: 1.2rem;
}
.as-tab {
  font-family: var(--sans); font-weight: 600; font-size: .82rem; letter-spacing: .04em;
  background: transparent; border: none; padding: .55rem 1.1rem; cursor: pointer;
  color: var(--ink-soft); display: flex; align-items: center; gap: .5rem;
}
.as-tab + .as-tab { border-left: 2px solid var(--ink); }
.as-tab.active { background: var(--oxide); color: #f8efe9; }
.as-tab-badge {
  font-family: var(--mono); font-size: .66rem; background: var(--ink); color: #fff;
  padding: .05rem .4rem; min-width: 1.4em; text-align: center;
}
.as-tab.active .as-tab-badge { background: #fff; color: var(--oxide); }

/* ---------- chat: picker + thread + bubbles ---------- */
.as-picker-row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.as-thread { display: flex; flex-direction: column; gap: .7rem; margin-bottom: .4rem; }
.as-bubble-row { display: flex; }
.as-row-user { justify-content: flex-end; }
.as-row-assistant { justify-content: flex-start; }
.as-bubble { max-width: 82%; padding: .65rem .85rem; font-size: .9rem; line-height: 1.55; }
.as-bubble-user { background: var(--slab); color: var(--slab-ink); border: 2px solid var(--ink); }
.as-bubble-assistant { background: var(--card); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.as-msg-plain { white-space: pre-wrap; }
.as-msg-line { margin: 0 0 .35rem; }
.as-msg-line:last-child { margin-bottom: 0; }
.as-msg-list { margin: .2rem 0 .5rem; padding-left: 1.2rem; }
.as-msg-list li { margin-bottom: .25rem; }
.as-inline-code {
  font-family: var(--mono); font-size: .85em; background: var(--paper-2);
  padding: .05em .35em; border: 1px solid var(--line);
}
.as-bubble-meta { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; }
.as-bubble-time { font-family: var(--mono); font-size: .66rem; color: var(--ink-soft); opacity: .75; }
.as-bubble-user .as-bubble-time { color: #c8c2b5; }
.as-fb-btn {
  background: none; border: none; cursor: pointer; font-size: .82rem; padding: 0 .15rem;
  opacity: 0; transition: opacity .15s ease;
}
.as-bubble-assistant:hover .as-fb-btn, .as-fb-btn.as-picked { opacity: 1; }

/* ---------- thinking shimmer ---------- */
.as-thinking { position: relative; overflow: hidden; color: var(--ink-soft); font-style: italic; }
.as-thinking::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(181, 67, 42, .14), transparent);
  animation: as-shimmer 1.3s ease-in-out infinite;
}
@keyframes as-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------- pending action card ---------- */
.as-action-card { border: 2px solid var(--oxide); background: var(--card); box-shadow: var(--shadow); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.as-action-summary { font-weight: 700; margin-bottom: .5rem; }
.as-action-card summary {
  cursor: pointer; font-family: var(--mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--oxide); margin-bottom: .5rem;
}
.as-action-dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; font-size: .85rem; margin: .3rem 0 0; }
.as-action-dl dt { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding-top: .1rem; }
.as-action-dl dd { margin: 0; white-space: pre-wrap; }
.as-bullet-list { margin: 0; padding-left: 1.1rem; }
.as-bullet-list li { margin-bottom: .2rem; }
.as-action-pre { font-family: var(--mono); font-size: .78rem; background: var(--paper-2); padding: .5rem; margin: 0; white-space: pre-wrap; word-break: break-word; }
.as-action-btns { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .9rem; }

/* ---------- composer + voice ---------- */
.as-composer { display: flex; gap: .6rem; align-items: flex-end; }
.as-composer-input { min-height: 2.7em; max-height: 9em; resize: vertical; font-size: .95rem !important; }
.as-composer-controls { display: flex; gap: .4rem; align-items: center; }
.as-mic-btn, .as-tts-btn {
  font-size: 1.05rem; line-height: 1; border: 2px solid var(--ink); background: var(--card);
  box-shadow: var(--shadow); padding: .45rem .55rem; cursor: pointer;
}
.as-mic-btn.as-recording { background: var(--oxide); border-color: var(--oxide-deep); animation: as-pulse 1s ease-in-out infinite; }
.as-tts-btn.as-on { background: var(--oxide); color: #f8efe9; border-color: var(--oxide-deep); }
@keyframes as-pulse { 0%, 100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 4px rgba(181, 67, 42, .25); } }
.as-interim { display: block; font-family: var(--mono); font-size: .78rem; color: var(--ink-soft); font-style: italic; margin-top: .35rem; }
.as-cost-line { font-family: var(--mono); font-size: .7rem; color: var(--ink-soft); margin-top: .5rem; text-align: right; }

/* ---------- My requests: list + shared detail/notes ---------- */
.as-req-list { display: flex; flex-direction: column; }
.as-req-row { display: flex; align-items: center; gap: .6rem; padding: .7rem .2rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.as-req-row:last-child { border-bottom: none; }
.as-req-row:hover { background: rgba(181, 67, 42, .05); }
.as-unseen-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--oxide); flex-shrink: 0; }
.as-req-row-main { flex: 1; min-width: 0; }
.as-req-title { font-weight: 600; margin-bottom: .3rem; }
.as-req-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.as-detail-fields { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1rem; font-size: .88rem; margin: .8rem 0; }
.as-detail-fields dt { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); padding-top: .15rem; }
.as-detail-fields dd { margin: 0; white-space: pre-wrap; }
.as-delivery-row { font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); margin-top: .3rem; }

.as-note-thread { display: flex; flex-direction: column; gap: .7rem; margin: .6rem 0; }
.as-note { border-left: 3px solid var(--line); padding: .3rem .8rem; }
.as-note-private { border-left-color: var(--warn); opacity: .85; }
.as-note-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .25rem; flex-wrap: wrap; }
.as-note-body { white-space: pre-wrap; font-size: .88rem; }
.as-private-chip {
  font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--warn); border: 1px solid var(--warn); padding: .05rem .35rem;
}
.as-reply-box, .as-note-form { margin-top: .8rem; }
.as-reply-input { width: 100%; }
.as-check-row { display: flex; align-items: center; gap: .4rem; font-size: .78rem; margin: .6rem 0; cursor: pointer; color: var(--ink-soft); }

/* ---------- badges: type / priority / status / note role ---------- */
.badge.as-type-bug { color: var(--bad); }
.badge.as-type-change { color: var(--sky); }
.badge.as-type-new_feature { color: var(--good); }
.badge.as-type-removal, .badge.as-type-none { color: var(--ink-soft); }
.badge.as-prio-low, .badge.as-prio-none { color: var(--ink-soft); }
.badge.as-prio-normal { color: var(--sky); }
.badge.as-prio-high { color: var(--warn); }
.badge.as-prio-urgent { color: var(--bad); }
.badge.as-status-sent { color: var(--ochre); }
.badge.as-status-in_progress { color: var(--sky); }
.badge.as-status-done { color: var(--good); }
.badge.as-status-declined, .badge.as-status-none { color: var(--bad); }
.badge.as-role-developer { color: var(--oxide); }
.badge.as-role-reporter { color: var(--sky); }
.badge.as-role-system { color: var(--ink-soft); }

@media (max-width: 640px) {
  .as-bubble { max-width: 92%; }
  .as-tabs { width: 100%; }
  .as-tab { flex: 1; justify-content: center; }
}
