/* ────────────────────────────────────────────────────────────────────────────
   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.30);
  --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;
}

/* ── 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; }
