/* ────────────────────────────────────────────────────────────────────────────
   Verity, Colors and Type
   Reskinned from counsel v5 colors_and_type.css (peoplease/counsel,
   prototypes/fe/v5/app/colors_and_type.css), copied as a pattern under
   ADR-0001 (zero runtime dependency on counsel, nothing written back to it).

   TODO(brand): every --verity-brand-* token below is a PLACEHOLDER neutral
   professional palette. Replace with the real askverity brand system once the
   operator sets a visual direction (FE-DESIGN section 15: "Design system and
   visual direction ... operator owns brand direction for askverity").
   ──────────────────────────────────────────────────────────────────────────── */

/* Webfonts, neutral professional pairing (sans + serif accent for the wordmark).
   Same CDN channel counsel uses. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400..800&display=swap");

:root {
  /* ── Verity brand palette (PLACEHOLDER, TODO brand) ─────────── */
  --verity-brand-ink: #13212e; /* primary text, dark surfaces, wordmark */
  --verity-brand-white: #ffffff;
  --verity-brand-accent: #0e7c86; /* calm teal, primary action + live dot */
  --verity-brand-accent-soft: #e6f4f4;

  /* ── Surfaces ──────────────────────────────────────────────── */
  --bg: #f7f9fa; /* page */
  --bg-muted: #eef2f4; /* inputs, hover, subtle surface */
  --bg-card: #ffffff; /* message + panel surface */
  --bg-dark: #13212e; /* header rail */

  /* ── Foreground / text ─────────────────────────────────────── */
  --fg: #13212e; /* primary text */
  --fg-muted: #5f7283; /* secondary text, placeholders, metadata */
  --fg-subtle: #93a2af; /* timestamps, micro labels */
  --fg-on-dark: #ffffff;
  --fg-on-dark-muted: rgba(255, 255, 255, 0.62);

  /* ── Borders ───────────────────────────────────────────────── */
  --border: #dce3e8;
  --border-strong: rgba(19, 33, 46, 0.12);

  /* ── Status (disclaimer prominence + loud-fail) ────────────── */
  --status-warn-fg: #92560a;
  --status-warn-bg: #fff7e8;
  --status-warn-border: #f3d9a3;
  --status-fail-fg: #9b1c1c;
  --status-fail-bg: #fef2f2;
  --status-fail-border: #f5c2c2;

  /* ── Typography ────────────────────────────────────────────── */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --size-content: 14px;
  --size-ui: 13px;
  --size-meta: 12px;
  --size-micro: 10px;

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --tracking-micro: 0.15em;
  --shadow-card: 0 14px 40px -22px rgba(19, 33, 46, 0.3);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--size-content);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.2px;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App shell ───────────────────────────────────────────────── */
.v-app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.v-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  flex-shrink: 0;
}
.v-logo {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: var(--verity-brand-accent);
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 17px;
}
.v-wordmark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}
.v-tagline {
  font-size: var(--size-meta);
  font-weight: 500;
  color: var(--fg-on-dark-muted);
  margin-left: 2px;
}
.v-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--size-micro);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--fg-on-dark-muted);
}
.v-live-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--verity-brand-accent);
}

/* ── Transcript ──────────────────────────────────────────────── */
.v-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 26px 0;
}
.v-thread {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.v-turn {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.v-turn.user {
  justify-content: flex-end;
}

.v-avatar {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--verity-brand-ink);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 13px;
}

.v-bubble {
  min-width: 0;
  max-width: 88%;
}
.v-label {
  font-size: var(--size-micro);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--fg-subtle);
  margin-bottom: 6px;
}
.v-prose {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.62;
  color: #26333f;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.v-turn.user .v-bubble {
  background: var(--verity-brand-ink);
  color: #fff;
  padding: 11px 15px;
  border-radius: var(--radius-lg);
  border-bottom-right-radius: 4px;
}
.v-turn.user .v-prose {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
}

/* ── Disclaimer (unmissable, disclaimer-and-footer.feature) ──── */
.v-disclaimer {
  border: 1px solid var(--status-warn-border);
  background: var(--status-warn-bg);
  color: var(--status-warn-fg);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: var(--size-content);
  font-weight: 600;
  line-height: 1.55;
}
.v-disclaimer .v-disclaimer-eyebrow {
  display: block;
  font-size: var(--size-micro);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  margin-bottom: 6px;
  opacity: 0.85;
}

/* ── Rendered markdown prose (sanitized in app.js) ───────────── */
/* When the assistant answer is finalized it is rendered as markdown, so the
   block elements own their spacing; drop the streaming pre-wrap here. */
.v-prose.v-prose-md {
  white-space: normal;
}
.v-prose-md p {
  margin: 0 0 10px;
}
.v-prose-md p:last-child {
  margin-bottom: 0;
}
.v-prose-md h3,
.v-prose-md h4,
.v-prose-md h5,
.v-prose-md h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--fg);
  margin: 16px 0 8px;
  line-height: 1.35;
}
.v-prose-md h3 {
  font-size: 15px;
}
.v-prose-md h4 {
  font-size: 14px;
}
.v-prose-md h5,
.v-prose-md h6 {
  font-size: 13px;
}
.v-prose-md ul,
.v-prose-md ol {
  margin: 0 0 10px;
  padding-left: 22px;
}
.v-prose-md li {
  margin: 3px 0;
}
/* Checklists (rendered by the shared markdown.js from `- [ ]` / `[x]` task
   syntax). No bullet dot; a native checkbox the reader can tick off while
   prepping for a meeting. The tick is client-side only and never persisted;
   a re-render resets it. A ticked item grays and strikes its label. */
.v-prose-md ul.v-md-tasklist {
  list-style: none;
  padding-left: 4px;
}
.v-prose-md li.v-md-task {
  margin: 5px 0;
}
.v-md-task-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.v-md-task-box {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--verity-brand-accent);
  cursor: pointer;
}
.v-md-task-box:checked + .v-md-task-text {
  color: var(--fg-muted);
  text-decoration: line-through;
}
.v-prose-md strong {
  font-weight: 700;
  color: var(--fg);
}
.v-prose-md em {
  font-style: italic;
}
.v-prose-md code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-muted);
  border-radius: 4px;
  padding: 1px 5px;
}
.v-prose-md hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
/* GFM pipe tables (rendered by the shared markdown.js). Bordered cells, an
   emphasised header row, full width, and a horizontal scroll fallback so a wide
   table never blows out the bubble on a narrow screen. Uses the shared tokens
   so it reads consistently with the rest of the prose. */
.v-prose-md .v-md-table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 12px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
}
.v-prose-md .v-md-table th,
.v-prose-md .v-md-table td {
  border: 1px solid var(--border);
  padding: 7px 11px;
  text-align: left;
  vertical-align: top;
}
.v-prose-md .v-md-table thead th {
  background: var(--bg-muted);
  font-weight: 700;
  color: var(--fg);
}
.v-prose-md .v-md-table tbody tr:nth-child(even) td {
  background: rgba(19, 33, 46, 0.02);
}
.v-prose-md .v-md-table code {
  font-size: 12px;
}

/* ── Verified sources (citation-verification.feature) ────────── */
/* The verified provision behind the advice, rendered by the shared
   assets/citations.js module on BOTH the chat and review pages. The chip
   palette is counsel v5's citation treatment (validated green / flagged
   amber), carried over as a pattern (ADR-0001). A chip links to the DATED
   register page the corpus verified against. This is the product thesis made
   visible: the cite is real and was checked. */
.v-citations {
  margin-top: 12px;
  border: 1px solid var(--verity-brand-accent);
  background: var(--verity-brand-accent-soft);
  border-radius: var(--radius-lg);
  padding: 9px 14px 11px;
}
.v-citations-toggle {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 2px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.v-citations-label {
  font-size: var(--size-micro);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--tracking-micro);
  color: var(--verity-brand-accent);
}
.v-citations-count {
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: var(--size-micro);
  font-weight: 700;
  color: var(--fg-muted);
}
.v-citations-chevron {
  font-size: var(--size-micro);
  color: var(--fg-muted);
  transition: transform 150ms ease;
}
.v-citations[data-cite-open="false"] .v-citations-chevron {
  transform: rotate(180deg);
}
.v-citations[data-cite-open="false"] .v-citations-body {
  display: none;
}
.v-citations-body {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}
/* The chip: counsel v5 validated pill (mint bg, green border, circular mark). */
.v-cite-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: var(--size-micro);
  font-weight: 700;
  text-decoration: none;
  cursor: default;
}
a.v-cite-chip {
  cursor: pointer;
}
a.v-cite-chip:hover {
  filter: brightness(0.97);
  text-decoration: none;
}
.v-cite-validated {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}
.v-cite-dot {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 9999px;
  background: #10b981;
  color: #fff;
  font-size: 8.5px;
  font-weight: 900;
  flex-shrink: 0;
}
.v-cite-text {
  font-weight: 700;
  color: inherit;
}
.v-cite-anchor {
  font-family: var(--font-mono);
  font-size: var(--size-micro);
  color: var(--fg-muted);
}
/* The amber uncited-assertion badge (counsel v5 flagged treatment): the turn
   asserted a legal figure/deadline and no citation grounded it. */
.v-uncited {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.v-uncited-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
  font-family: var(--font-mono);
  font-size: var(--size-micro);
  font-weight: 700;
}
.v-uncited-dot {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 9999px;
  background: #d97706;
  color: #fff;
  font-size: 8.5px;
  font-weight: 900;
  flex-shrink: 0;
}
.v-uncited-snippets {
  font-family: var(--font-sans);
  font-size: var(--size-micro);
  color: #b45309;
}

/* ── Per-turn footer (disclaimer-and-footer.feature) ─────────── */
.v-footer {
  margin-top: 12px;
  font-style: italic;
  font-size: var(--size-meta);
  font-weight: 500;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ── Loud-fail brain-unavailable state (loud-fail-brain-load) ── */
.v-failstate {
  border: 1px solid var(--status-fail-border);
  background: var(--status-fail-bg);
  color: var(--status-fail-fg);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-weight: 600;
  line-height: 1.55;
}

/* ── Typing indicator ────────────────────────────────────────── */
.v-typing {
  display: inline-flex;
  gap: 5px;
  padding: 6px 0;
}
.v-typing span {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--fg-subtle);
  animation: v-blink 1.1s ease-in-out infinite;
}
.v-typing span:nth-child(2) {
  animation-delay: 0.18s;
}
.v-typing span:nth-child(3) {
  animation-delay: 0.36s;
}
@keyframes v-blink {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

@keyframes v-in {
  from {
    transform: translateY(8px);
  }
  to {
    transform: none;
  }
}
.v-anim-in {
  animation: v-in 360ms var(--ease) both;
}
@media (prefers-reduced-motion: reduce) {
  .v-anim-in {
    animation: none !important;
  }
  .v-typing span {
    animation: none !important;
  }
}

/* ── Composer ────────────────────────────────────────────────── */
.v-composer-wrap {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 14px 22px 18px;
}
.v-composer {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.v-input {
  flex: 1;
  resize: none;
  max-height: 160px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: var(--size-content);
  font-weight: 500;
  color: var(--fg);
  padding: 12px 14px;
  line-height: 1.5;
}
.v-input::placeholder {
  color: var(--fg-muted);
}
.v-input:focus {
  outline: none;
  border-color: var(--verity-brand-accent);
}
.v-send {
  flex-shrink: 0;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--verity-brand-ink);
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--size-ui);
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--ease) 150ms;
}
.v-send:hover {
  opacity: 0.9;
}
.v-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.v-hint {
  max-width: 760px;
  margin: 8px auto 0;
  font-size: var(--size-micro);
  color: var(--fg-subtle);
  text-align: center;
}

/* Slim scrollbar inside the transcript */
.v-transcript::-webkit-scrollbar {
  width: 9px;
}
.v-transcript::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
}
.v-transcript::-webkit-scrollbar-track {
  background: transparent;
}

/* ══════════════════════════════════════════════════════════════════════
   Copy-on-select clip toast (ported from counsel v5 clip-toast.jsx as a
   pattern, ADR-0001, zero runtime dependency). When the user finishes
   selecting text inside the chat thread the selection is copied to the
   clipboard and this transient toast confirms it, then auto-dismisses.
   The toast shows only a character COUNT, never selected content.
   ══════════════════════════════════════════════════════════════════════ */
.v-clip-toast {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 9999;
  pointer-events: none;
  max-width: 260px;
  padding: 9px 13px;
  border-radius: var(--radius-lg);
  background: var(--bg-dark);
  color: var(--fg-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(19, 33, 46, 0.28);
  font-family: var(--font-sans);
  font-size: var(--size-meta);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}
.v-clip-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.v-clip-toast-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--verity-brand-accent);
}

/* ══════════════════════════════════════════════════════════════════════
   User avatar + popover (upper-right, fixed, above transcript).

   .v-user-btn   - circular avatar button showing the user's initials.
                   Fixed to the upper-right of the viewport so it never
                   overlaps the chat header (which sits in normal flow).
   .v-user-popover - small dropdown anchored just below the avatar.
                   Opens downward (avatar is at the top, so downward is
                   the only safe direction). Toggled by JS; hidden by default.
   ══════════════════════════════════════════════════════════════════════ */
.v-user-btn {
  position: fixed;
  top: 10px;
  right: 16px;
  z-index: 200;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: var(--verity-brand-accent);
  color: var(--fg-on-dark);
  font-family: var(--font-sans);
  font-size: var(--size-meta);
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: opacity 140ms ease;
  /* Sit above the header (bg-dark rail) but below the popover itself. */
}
.v-user-btn:hover {
  opacity: 0.88;
}
.v-user-btn:focus-visible {
  outline: 2px solid var(--verity-brand-accent);
  outline-offset: 3px;
}

/* Popover: hidden until .is-open is added by JS. */
.v-user-popover {
  position: fixed;
  top: 50px;
  right: 12px;
  z-index: 300;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 6px 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity 140ms var(--ease),
    transform 140ms var(--ease);
}
.v-user-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.v-user-popover-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--size-ui);
  font-weight: 600;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: background 100ms ease;
}
.v-user-popover-item:hover,
.v-user-popover-item:focus-visible {
  background: var(--bg-muted);
  outline: none;
}

/* ── Login landing (enforced + unauthed) ─────────────────────────
   A centered Verity-branded splash shown in place of an immediate bounce to
   WorkOS. Fixed overlay on top of the app shell so it covers whatever the page
   painted; the only exit is the Sign in button. */
.v-login-landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.v-login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 44px 40px 40px;
  max-width: 420px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}
.v-login-logo {
  width: 56px;
  height: 56px;
  font-size: 30px;
  border-radius: var(--radius-lg);
}
.v-login-wordmark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.5px;
  color: var(--fg);
}
.v-login-tagline {
  margin: 0;
  font-size: var(--size-content);
  font-weight: 500;
  color: var(--fg-muted);
}
.v-login-signin {
  margin-top: 10px;
  width: 100%;
  height: 46px;
  background: var(--verity-brand-accent);
  font-size: var(--size-content);
}

/* ════════════════════════════════════════════════════════════════════════
   Draft-documents artifact panel (artifact-panel slice; counsel v5 pattern:
   pointer card in the transcript, side pane with a slim reopen rail, kind in
   small caps / title in serif / id in mono on the document header).
   ════════════════════════════════════════════════════════════════════════ */

/* The in-transcript pointer card */
.v-artifact-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--verity-brand-accent);
  border-radius: var(--radius-md);
}
.v-artifact-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.v-artifact-eyebrow {
  font-size: var(--size-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.v-artifact-kind {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--verity-brand-accent-soft);
  border: 1px solid var(--verity-brand-accent);
  color: var(--verity-brand-accent);
  font-size: var(--size-micro);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.v-artifact-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.v-artifact-preview {
  margin-top: 4px;
  font-size: var(--size-meta);
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v-artifact-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.v-artifact-open,
.v-artifact-download,
.v-artifacts-back {
  appearance: none;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--size-ui);
  font-weight: 600;
  cursor: pointer;
}
.v-artifact-open {
  background: var(--verity-brand-accent);
  border-color: var(--verity-brand-accent);
  color: var(--verity-brand-white);
}
.v-artifact-open:hover {
  filter: brightness(1.05);
}
.v-artifact-download:hover,
.v-artifacts-back:hover {
  background: var(--bg-muted);
}

/* The slim reopen rail (counsel SideRail affordance): fixed right edge,
   visible only when the consultation holds documents and the panel is closed */
.v-artifacts-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--bg-card);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--size-ui);
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(19, 33, 46, 0.08);
  z-index: 40;
}

/* The side panel: fixed right slide-over, holds the N-card list or one
   document open full */
.v-artifacts-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 24px rgba(19, 33, 46, 0.1);
  transform: translateX(100%);
  transition: transform 0.18s ease;
  z-index: 50;
}
.v-artifacts-panel.is-open {
  transform: translateX(0);
}
.v-artifacts-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.v-artifacts-label {
  font-size: var(--size-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}
.v-artifacts-count {
  font-size: var(--size-meta);
  color: var(--fg-muted);
}
.v-artifacts-close {
  margin-left: auto;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg-muted);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.v-artifacts-close:hover {
  background: var(--bg-muted);
}
.v-artifacts-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}
.v-artifacts-empty {
  font-size: var(--size-content);
  color: var(--fg-muted);
}
.v-artifacts-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  appearance: none;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
}
.v-artifacts-row:hover {
  background: var(--bg-muted);
}
.v-artifacts-row-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v-artifacts-doc-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.v-artifacts-doc-title {
  flex-basis: 100%;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.v-artifacts-doc-id {
  font-family: var(--font-mono);
  font-size: var(--size-micro);
  color: var(--fg-subtle);
}
.v-artifacts-doc-guard {
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--status-warn-bg);
  border: 1px solid var(--status-warn-border);
  color: var(--status-warn-fg);
  font-size: var(--size-meta);
}
.v-artifacts-doc-body {
  padding: 4px 0 10px;
}
