/* ============================================================
   ZeroExfil portal - design v2 (phase 1: foundation / chrome)
   Loaded AFTER style.css; only overrides what needs lifting.
   Goal: soft hairlines, ink hierarchy, restrained red, refined
   motion, perf hygiene. Color discipline:
     red       -> primary CTA, severity, status indicators
     ink #0f172a -> all body text, active nav, secondary actions
     ink-line  -> hairlines, dividers, input borders
   ============================================================ */

:root {
  --ink:        #0f172a;
  --ink-soft:   #1e293b;
  --ink-line:   #d8dde5;
  --ink-line-2: #e8ebef;
  --canvas:     #fafbfc;
  --surface:    #ffffff;
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Perf hygiene ----------
   style.css promotes every .panel / .card / .btn / .nav-link to its
   own GPU layer via will-change: transform. That is layer abuse on
   a dashboard with hundreds of these elements. Revert. */
.panel, .card, .btn, .nav-link, .badge {
  will-change: auto;
  transform: none;
}

/* ---------- Topbar ---------- */
.topbar {
  border-bottom: 1px solid var(--ink-line);
  padding: .75rem 1.25rem;
  height: 52px;
}
.brand img {
  height: 22px;
  display: block;
}

/* ---------- Tenant select ---------- */
#tenantSelect {
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  color: var(--ink);
  font-size: .875rem;
  padding: .5rem 2rem .5rem .75rem;
  min-width: 220px;
  transition: border-color 160ms var(--ease-out),
              box-shadow 160ms var(--ease-out);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230f172a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}
#tenantSelect:hover {
  border-color: #b6bdc7;
  box-shadow: none;
}
#tenantSelect:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 6px;
  padding: .5rem .875rem;
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 0;
  transition: background-color 180ms var(--ease-out),
              transform 140ms var(--ease-out),
              box-shadow 180ms var(--ease-out),
              border-color 180ms var(--ease-out),
              color 180ms var(--ease-out);
}
.btn:hover {
  background: var(--color-primary-hover);
  transform: none;
  box-shadow: 0 2px 8px rgba(193, 18, 31, 0.18);
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

/* Secondary: ink-on-white, not loud red */
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink-line);
}
.btn.secondary:hover {
  background: var(--canvas);
  border-color: var(--ink);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}
.btn.secondary:active:not(:disabled) {
  transform: scale(0.97);
}

/* Topbar Log in / Log out: secondary by default (it's not the primary
   action on a dashboard page) */
.topbar #loginBtn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink-line);
  font-weight: 500;
}
.topbar #loginBtn:hover {
  background: var(--canvas);
  border-color: var(--ink);
  box-shadow: none;
}

/* Small button: same easing */
.btn-small {
  border-radius: 6px;
  padding: .35rem .7rem;
  font-size: .8125rem;
  font-weight: 500;
  transition: background-color 180ms var(--ease-out),
              transform 140ms var(--ease-out),
              box-shadow 180ms var(--ease-out);
}
.btn-small:hover {
  transform: none;
  box-shadow: 0 2px 6px rgba(193, 18, 31, 0.15);
}
.btn-small:active {
  transform: scale(0.97);
}

/* ---------- Layout chrome ---------- */
.app {
  grid-template-columns: 232px minmax(0, 1fr);
}
body {
  background: var(--canvas);
}

/* ---------- Sidebar ---------- */
.sidebar {
  border-right: 1px solid var(--ink-line);
  background: var(--surface);
  padding: .875rem .625rem 1rem;
  gap: 1px;
}

.nav-link {
  position: relative;
  padding: .5rem .75rem;
  border-radius: 6px;
  font-size: .875rem;
  color: var(--ink-soft);
  font-weight: 500;
  transition: background-color 160ms var(--ease-out),
              color 160ms var(--ease-out);
}
.nav-link:hover {
  background: var(--canvas);
  color: var(--ink);
}
.nav-link.active {
  background: #f1f5f9;
  color: var(--ink);
  font-weight: 600;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -.625rem;
  top: .5rem;
  bottom: .5rem;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--color-primary);
}

.nav-section {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  padding: 1.125rem .75rem .375rem;
}
.nav-section:first-child { padding-top: .375rem; }

/* ---------- Main view ---------- */
.view {
  padding: 1.5rem 1.75rem;
  background: var(--canvas);
}

/* ---------- Panels & cards ---------- */
.panel,
.card {
  border: 1px solid var(--ink-line-2);
  border-radius: 10px;
  background: var(--surface);
  padding: 1.25rem;
}
.panel { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); }

.panel h2,
.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 1rem;
  letter-spacing: -0.005em;
}
.panel h3,
.card h3 {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .5rem;
}

.panel-grid {
  gap: 1.125rem;
}

/* ---------- KPI numbers ---------- */
/* Default KPI is the big number; should be ink, not brand red.
   Red KPIs remain only when paired with a severity / state class. */
.kpi {
  color: var(--ink);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.kpi.kpi--critical,
.kpi.kpi--danger,
.kpi.severity-critical { color: var(--severity-critical); }
.kpi.kpi--high,
.kpi.severity-high     { color: var(--severity-high); }
.kpi.kpi--warn,
.kpi.severity-medium   { color: var(--severity-medium); }
.kpi.kpi--ok,
.kpi.severity-low      { color: var(--severity-low); }

/* ---------- Page header ---------- */
.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink-line-2);
}
.page-header__title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.page-header__subtitle {
  color: var(--color-muted);
  font-size: .9rem;
}

/* ---------- Tabs ---------- */
.tabs {
  border-bottom: 1px solid var(--ink-line);
}
.tabs .tab-btn {
  color: var(--color-muted);
  font-weight: 500;
  font-size: .875rem;
  padding: .75rem .25rem;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease-out),
              border-color 160ms var(--ease-out);
}
/* style.css declares .tab-btn:hover and .tab-btn.active with !important,
   so override with !important too. */
.tabs .tab-btn:hover,
.tab-btn:hover {
  color: var(--ink) !important;
}
.tabs .tab-btn.active,
.tab-btn.active {
  color: var(--ink) !important;
  border-bottom: 2px solid var(--ink) !important;
  font-weight: 600;
}
.tabs .tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
  border-radius: 4px;
}

/* ---------- View transitions: lighter ---------- */
.view-transition-out {
  opacity: .85;
  transform: none;
}
@keyframes viewFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.view-transition-in {
  animation: viewFadeIn 160ms var(--ease-out);
}

/* ============================================================
   PHASE 2 - tables, forms, filters, modals, badges, code
   ============================================================ */

/* ---------- Shared focus ring token ---------- */
/* style.css declares --shadow-focus as red; override to ink so every
   consumer (filter-bar inputs, form-control, etc.) gets ink focus. */
:root {
  --shadow-focus: 0 0 0 3px rgba(15, 23, 42, 0.10);
}

/* ---------- Tables ---------- */
.table-wrapper {
  border: 1px solid var(--ink-line-2);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.table {
  font-size: .875rem;
  color: var(--ink);
}
.table th,
.table td {
  border-bottom: 1px solid var(--ink-line-2);
  padding: .75rem .875rem;
}
.table th {
  background: var(--canvas);
  color: var(--ink);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #475569;
  border-bottom: 1px solid var(--ink-line);
}
.table tbody tr {
  transition: background-color 140ms var(--ease-out);
}
.table tbody tr:hover {
  background: var(--canvas);
}
.table tbody tr:last-child td { border-bottom: none; }

/* Row fade-in: drop the translateX shift (heavy on long tables) */
@keyframes tableRowFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Selected row: ink-tinted, not blue */
.table tbody tr.row-selected,
.table tbody tr.row-selected:hover {
  background: #f1f5f9;
}
.table tbody tr.row-selected td {
  border-bottom-color: var(--ink-line);
}

/* ---------- Filter bar / filters / form-select / form-control ---------- */
.filters input,
.filters select,
.filter-bar input,
.filter-bar select,
.filter-input,
.filter-select,
.form-select,
.form-control {
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: .875rem;
  padding: .5rem .75rem;
  font-family: inherit;
  transition: border-color 160ms var(--ease-out),
              box-shadow 160ms var(--ease-out);
}
.filters input::placeholder,
.filter-bar input::placeholder,
.filter-input::placeholder,
.form-control::placeholder {
  color: #94a3b8;
}
.filters input:hover,
.filters select:hover,
.filter-bar input:hover,
.filter-bar select:hover,
.filter-input:hover,
.filter-select:hover,
.form-select:hover,
.form-control:hover {
  border-color: #b6bdc7;
  box-shadow: none;
}
.filters input:focus,
.filters select:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.filter-input:focus,
.filter-select:focus,
.form-select:focus,
.form-control:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}
.form-select,
.filters select,
.filter-bar select,
.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230f172a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 10px;
  padding-right: 2rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* Form group labels */
.form-group label {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: .375rem;
}

textarea.form-control {
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.5;
}

/* ---------- Modal ---------- */
.modal {
  background: rgba(15, 23, 42, 0.40);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-content {
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24),
              0 0 0 1px rgba(15, 23, 42, 0.06);
  border: none;
}
.modal-header {
  border-bottom: 1px solid var(--ink-line-2);
  padding: 1.125rem 1.5rem;
}
.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.modal-close {
  color: var(--color-muted);
  border-radius: 6px;
  transition: background-color 140ms var(--ease-out),
              color 140ms var(--ease-out);
}
.modal-close:hover {
  background: var(--canvas);
  color: var(--ink);
}

.modal-overlay {
  background: rgba(15, 23, 42, 0.40);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-overlay .modal-content {
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24),
              0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* ---------- Pagination ---------- */
.pagination .btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--ink-line);
  padding: .4rem .75rem;
  font-size: .8125rem;
}
.pagination .btn:hover {
  background: var(--canvas);
  border-color: var(--ink);
  box-shadow: none;
}
.pagination__info { color: var(--color-muted); font-size: .8125rem; }

/* ---------- Bulk-actions bar ---------- */
.bulk-bar {
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  border-radius: 8px;
  padding: .625rem 1rem;
}

/* ---------- Badges ---------- */
/* Keep semantic colors (they carry severity meaning) but soften the
   typography - the all-uppercase 0.75rem reads loud. */
.badge {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .2rem .5rem;
  border-radius: 4px;
  text-transform: uppercase;
}
/* Neutral badge: ink-on-canvas */
.badge-scope-global {
  background: var(--canvas);
  color: var(--ink-soft);
  border: 1px solid var(--ink-line);
}

/* ---------- Code blocks ---------- */
.code {
  background: #0b1020;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  font-size: .8125rem;
  line-height: 1.55;
  border: 1px solid #1e293b;
}

/* ---------- Step indicator (refresh; red ring → ink ring) ---------- */
.step-indicator-circle {
  border: 1.5px solid var(--ink-line);
  background: var(--surface);
  color: #94a3b8;
  transition: background-color 220ms var(--ease-out),
              border-color 220ms var(--ease-out),
              color 220ms var(--ease-out),
              box-shadow 220ms var(--ease-out);
}
.step-indicator-item.active .step-indicator-circle {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08);
}
.step-indicator-item.completed .step-indicator-circle {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- KPI tile sub-types ---------- */
.kpi-tile {
  border: 1px solid var(--ink-line-2);
  border-radius: 10px;
  background: var(--surface);
}
.kpi-tile--brand .kpi-tile__value { color: var(--ink); }

/* ---------- Loading spinner: ink-tinted track, red accent ---------- */
.loading-spinner {
  border-color: var(--ink-line);
  border-top-color: var(--color-primary);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .btn-small, .nav-link, .tabs .tab-btn,
  #tenantSelect, .panel, .card,
  .filters input, .filters select,
  .filter-bar input, .filter-bar select,
  .filter-input, .filter-select,
  .form-select, .form-control,
  .table tbody tr, .modal-close, .step-indicator-circle,
  .pagination .btn {
    transition: none !important;
    animation: none !important;
  }
  .view-transition-in { animation: none !important; }
  .table tbody tr { animation: none !important; }
}

/* ============================================================
   PHASE 3 - home dashboard (blast radius, severity breakdown,
   top affected, risk bars, alert modal header)
   ============================================================ */

/* ---------- Blast radius infographic ---------- */
.blast-radius-container {
  gap: 1.75rem;
  padding: .25rem 0 .5rem;
}
.blast-org-circle {
  width: 132px;
  height: 132px;
  background: var(--canvas);
  border: 1px solid var(--ink-line);
}
.blast-center {
  width: 64px;
  height: 64px;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08),
              0 0 0 1px rgba(15, 23, 42, 0.04);
}
.blast-percentage {
  font-size: 1.125rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.blast-label {
  font-size: .625rem;
  color: var(--color-muted);
  font-weight: 600;
  letter-spacing: .06em;
}
.blast-stat-value {
  font-size: 1.625rem;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.blast-stat-label {
  font-size: .75rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* ---------- Risk bars ---------- */
.risk-bar {
  height: 8px;
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  border-radius: 4px;
}
.risk-bar-fill {
  border-radius: 4px;
  transition: width 600ms var(--ease-out),
              background-color 220ms var(--ease-out);
}
.risk-bar-label {
  color: var(--color-muted);
  font-size: .8125rem;
}
.risk-percentage {
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

/* ---------- Severity breakdown grid ---------- */
.severity-section-label {
  font-size: .6875rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: .06em;
  margin-bottom: .625rem;
}
.severity-breakdown { gap: .625rem; }
.severity-item {
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  border-radius: 8px;
  padding: .75rem .5rem;
  transition: border-color 160ms var(--ease-out),
              transform 160ms var(--ease-out);
}
.severity-item:hover {
  border-color: var(--ink-line);
}
.severity-item .severity-count {
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}
.severity-item .severity-label {
  font-size: .6875rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: .06em;
}

/* ---------- Top affected devices ---------- */
.top-affected {
  border-top: 1px solid var(--ink-line-2);
  padding-top: 1rem;
  margin-top: .5rem;
}
.top-affected-header {
  font-size: .8125rem;
  color: var(--color-muted);
  font-weight: 500;
  margin-bottom: .625rem;
}
.view-all-link {
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--ink-line);
  padding-bottom: 1px;
  transition: border-color 160ms var(--ease-out);
}
.view-all-link:hover {
  text-decoration: none;
  border-bottom-color: var(--ink);
}
.top-affected-list li.affected-device {
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  border-radius: 6px;
  padding: .5rem .75rem;
  transition: border-color 160ms var(--ease-out),
              background-color 160ms var(--ease-out);
}
.top-affected-list li.affected-device:hover {
  background: var(--surface);
  border-color: var(--ink-line);
}
.device-name {
  color: var(--ink);
  font-size: .8125rem;
}

/* ---------- Alert modal header (severity rail) ---------- */
.alert-modal-header {
  border-bottom: 1px solid var(--ink-line-2);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}
.alert-severity-bar {
  width: 3px;
  border-radius: 2px;
  min-height: 56px;
}

/* ============================================================
   PHASE 4 - CORA AI Analyst (live progress + timeline notes)
   ============================================================ */

/* ---------- Alert modal tabs (Details / Visualize) ---------- */
.alert-tabs {
  border-bottom: 1px solid var(--ink-line);
}
.alert-tab {
  color: var(--color-muted);
  font-weight: 500;
  font-size: .875rem;
  padding: .65rem 1.125rem;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease-out),
              border-color 160ms var(--ease-out);
}
.alert-tab:hover {
  color: var(--ink);
  background: transparent;
}
.alert-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}
.alert-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
  border-radius: 4px;
}

/* ---------- CORA tokens ---------- */
:root {
  --cora-accent: var(--color-primary);
  --cora-soft: rgba(230, 57, 70, 0.08);
}

/* CORA wordmark — uppercase tracked red marker */
.cora-label {
  color: var(--cora-accent);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ---------- CORA status badges ---------- */
.cora-badge {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .6875rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
}
.cora-badge--investigating {
  background: var(--cora-soft);
  color: var(--cora-accent);
}
.cora-badge--investigating::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cora-accent);
  animation: cora-pulse 1.6s ease-in-out infinite;
}
.cora-badge--complete {
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--ink-line);
}
@keyframes cora-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  .cora-badge--investigating::before { animation: none; }
}

/* ---------- CORA action button ---------- */
.cora-btn {
  background: var(--cora-accent);
  color: #fff;
  border: 1px solid var(--cora-accent);
  padding: .5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: .875rem;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out),
              border-color 160ms var(--ease-out),
              transform 90ms var(--ease-out);
}
.cora-btn:hover {
  background: #d63340;
  border-color: #d63340;
  opacity: 1;
  transform: none;
}
.cora-btn:active {
  transform: scale(0.97);
}
.cora-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.18);
}
.cora-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* ---------- CORA live investigation progress ---------- */
/* Replace brutalist corner brackets with a refined surface card. */
.cora-progress {
  background: var(--surface);
  border: 1px solid var(--ink-line-2);
  border-left: 3px solid var(--cora-accent);
  border-radius: 10px;
  padding: 1.125rem 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.cora-progress::before,
.cora-progress::after,
.cora-progress-corners::before,
.cora-progress-corners::after {
  content: none !important;
  display: none !important;
  border: none !important;
}
.cora-progress-corners {
  display: none;
}
.cora-progress-complete {
  border-left-color: var(--ink);
}

.cora-progress-header {
  gap: .625rem;
  margin-bottom: .625rem;
}
.cora-progress-title {
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 600;
}
.cora-progress-subtitle {
  color: var(--color-muted);
  font-size: .8125rem;
}
.cora-progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ink-line);
  border-top-color: var(--cora-accent);
}

.cora-progress-steps {
  gap: .375rem;
  margin-top: .625rem;
  padding-left: 0;
}
.cora-progress-step {
  font-size: .8125rem;
  color: var(--color-muted);
  gap: .625rem;
  padding: .125rem 0;
  transition: color 200ms var(--ease-out);
}
.cora-progress-step--active {
  color: var(--ink);
  font-weight: 500;
}
.cora-progress-step--done {
  color: var(--ink-soft);
}
.cora-step-dot {
  width: 6px;
  height: 6px;
  background: var(--ink-line);
  transition: background-color 200ms var(--ease-out),
              box-shadow 200ms var(--ease-out);
}
.cora-progress-step--active .cora-step-dot {
  background: var(--cora-accent);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12);
}
.cora-progress-step--done .cora-step-dot {
  background: var(--ink);
  box-shadow: none;
}

/* ---------- Investigation timeline (CORA notes + analyst notes) ---------- */
.investigation-entry {
  background: var(--surface);
  border: 1px solid var(--ink-line-2);
  border-radius: 8px;
  padding: 1rem 1.125rem;
  margin-bottom: .875rem;
}
.investigation-note {
  border-left: 3px solid var(--ink-line);
}
.investigation-note.cora-note {
  border-left: 3px solid var(--cora-accent);
  background: var(--surface);
  border-top: 1px solid var(--ink-line-2);
  border-right: 1px solid var(--ink-line-2);
  border-bottom: 1px solid var(--ink-line-2);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.entry-header {
  border-bottom: 1px solid var(--ink-line-2);
  padding-bottom: .625rem;
  margin-bottom: .75rem;
}
.entry-header strong {
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 600;
}
.entry-time {
  color: var(--color-muted);
  font-size: .8125rem;
}
.entry-edited {
  color: var(--color-muted);
}
.entry-content {
  color: var(--ink-soft);
  font-size: .9375rem;
  line-height: 1.6;
}
.entry-content code,
.investigation-note code {
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  padding: .0625rem .375rem;
  border-radius: 4px;
  font-size: .85em;
  color: var(--ink);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
.entry-content strong {
  color: var(--ink);
  font-weight: 600;
}
.entry-description {
  color: var(--color-muted);
  font-size: .875rem;
}

.btn-icon {
  color: var(--color-muted);
  opacity: 1;
  border-radius: 4px;
  transition: color 160ms var(--ease-out),
              background-color 160ms var(--ease-out);
}
.btn-icon:hover {
  color: var(--ink);
  background: var(--canvas);
}

/* Resolution entry — red corner brackets are the visual frame, no extra borders */
.investigation-entry--resolution {
  border: none;
  border-left: none;
  background: var(--surface);
  padding: 1.5rem 1.75rem;
  margin: .25rem .5rem 1.25rem;
}
.investigation-entry--resolution .investigation-entry-header {
  border-bottom: 1px solid var(--ink-line-2);
  padding-bottom: .75rem;
  margin-bottom: 1rem;
}
.investigation-entry--resolution .investigation-entry-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.investigation-entry--resolution .investigation-entry-type {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--cora-accent, #ef4444);
}
.investigation-entry--resolution .investigation-entry-author {
  color: var(--ink);
  font-size: .875rem;
  font-weight: 500;
}
.investigation-entry--resolution .investigation-entry-author::before {
  content: "by ";
  color: var(--color-muted);
  font-weight: 400;
}
.investigation-entry--resolution .investigation-entry-time {
  color: var(--color-muted);
  font-size: .8125rem;
  margin-left: auto;
}
.investigation-entry--resolution .investigation-classification-row {
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  border-radius: 6px;
  padding: .625rem .875rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--ink-line-2);
}
.investigation-entry--resolution .investigation-classification-label {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .6875rem;
  font-weight: 600;
  color: var(--color-muted);
}
.investigation-entry--resolution .investigation-resolution-body {
  color: var(--ink-soft);
  font-size: .9375rem;
  line-height: 1.65;
}
.investigation-entry--resolution .investigation-resolution-body h1,
.investigation-entry--resolution .investigation-resolution-body h2,
.investigation-entry--resolution .investigation-resolution-body h3,
.investigation-entry--resolution .investigation-resolution-body h4 {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 .375rem;
}
.investigation-entry--resolution .investigation-resolution-body h2 {
  font-size: 1.0625rem;
  padding-bottom: .375rem;
  border-bottom: 1px solid var(--ink-line-2);
}
.investigation-entry--resolution .investigation-resolution-body h1:first-child,
.investigation-entry--resolution .investigation-resolution-body h2:first-child,
.investigation-entry--resolution .investigation-resolution-body h3:first-child {
  margin-top: 0;
}
.investigation-entry--resolution .investigation-resolution-body p {
  margin: .375rem 0 1rem;
}
.investigation-entry--resolution .investigation-resolution-body strong {
  color: var(--ink);
  font-weight: 600;
}
.investigation-entry--resolution .investigation-resolution-body code {
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  padding: .0625rem .375rem;
  border-radius: 4px;
  font-size: .85em;
  color: var(--ink);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ==========================================================================
   Phase 5: Threat Intelligence feed - refined monogram tiles
   ========================================================================== */

.threat-intel-item {
  border-bottom: 1px solid var(--ink-line-2);
  padding: .875rem 1rem;
  transition: background-color 120ms var(--ease-out);
}
.threat-intel-item:hover {
  background: var(--canvas);
}

.threat-intel-icon,
.threat-intel-icon.cisa,
.threat-intel-icon.news,
.threat-intel-icon.vuln,
.threat-intel-icon.alert,
.threat-intel-icon.research {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--canvas);
  border: 1px solid var(--ink-line);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  background-image: none;
  box-shadow: none;
}

.threat-intel-title {
  font-weight: 500;
  color: var(--ink);
}
.threat-intel-title a {
  color: var(--ink);
  text-decoration: none;
}
.threat-intel-title a:hover {
  color: var(--cora-accent, #ef4444);
  text-decoration: underline;
}

.threat-intel-source {
  color: var(--ink-soft);
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.threat-intel-date {
  color: var(--color-muted);
  font-size: .75rem;
}

.threat-intel-tag {
  background: var(--canvas);
  border: 1px solid var(--ink-line);
  color: var(--ink-soft);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .125rem .5rem;
  border-radius: 4px;
}
.threat-intel-tag.critical,
.threat-intel-tag.high {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.30);
  color: #b91c1c;
}
.threat-intel-tag.advisory,
.threat-intel-tag.research {
  background: var(--canvas);
  border-color: var(--ink-line);
  color: var(--ink-soft);
}


/* =========================================================
   Ask CORA  -  natural-language investigation surface
   Design read: power-user, ink-first, restrained red accent.
   Motion: 200ms cubic-bezier(0.23,1,0.32,1), transform + opacity only.
   All motion gated by prefers-reduced-motion.
   ========================================================= */

.nav-link--accent {
  position: relative;
}

.askcora {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4rem);
  min-height: 0;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

.askcora__hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--ink-line-2);
  margin-bottom: 1.25rem;
}
.askcora__hero-main { min-width: 0; }
.askcora__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.askcora__title {
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0 0 0.4rem;
}
.askcora__lede {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 60ch;
  line-height: 1.5;
}
.askcora__hero-meta {
  font-size: 0.78rem;
  color: var(--color-muted, #64748b);
  white-space: nowrap;
}

.askcora__stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.25rem 0.25rem 1.5rem;
  scroll-behavior: smooth;
}

/* Empty state: asymmetric editorial grid of suggested questions. */
.askcora__empty {
  padding-top: 1rem;
}
.askcora__empty-head { margin-bottom: 1.25rem; }
.askcora__empty-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
}
.askcora__empty-title {
  margin: 0.35rem 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.askcora__suggest {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(96px, auto);
  gap: 12px;
}
.askcora-card {
  --i: 0;
  grid-column: span 3;
  background: var(--surface);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 14px 16px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
  font: inherit;
  opacity: 0;
  transform: translateY(8px);
  animation: askcora-rise 360ms var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 50ms);
  transition: transform 200ms var(--ease-out),
              border-color 200ms var(--ease-out),
              box-shadow 200ms var(--ease-out);
}
/* asymmetric: 1st full row, 2-3 split, 4 full, 5-6-7 thirds */
.askcora-card:nth-child(1) { grid-column: span 6; }
.askcora-card:nth-child(2),
.askcora-card:nth-child(3) { grid-column: span 3; }
.askcora-card:nth-child(4) { grid-column: span 4; }
.askcora-card:nth-child(5) { grid-column: span 2; }
.askcora-card:nth-child(6),
.askcora-card:nth-child(7) { grid-column: span 3; }

@media (hover: hover) and (pointer: fine) {
  .askcora-card:hover {
    border-color: var(--ink);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px -8px rgba(15, 23, 42, 0.18);
  }
}
.askcora-card:active { transform: translateY(0) scale(0.995); }
.askcora-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
/* Rotation swap: a single card fades+slides out, the replacement fades in. */
.askcora-card--leave {
  animation: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  pointer-events: none;
}
.askcora-card--enter {
  animation: none;
  opacity: 0;
  transform: translateY(6px);
}
@media (prefers-reduced-motion: reduce) {
  .askcora-card { animation: none; opacity: 1; transform: none; }
  .askcora-card--leave, .askcora-card--enter { transition: none; opacity: 1; transform: none; }
}
.askcora-card__kicker {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted, #64748b);
  font-weight: 600;
}
.askcora-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.askcora-card__hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Thread */
.askcora__thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}
.askcora-turn {
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateY(6px);
  animation: askcora-rise 280ms var(--ease-out) forwards;
}
.askcora-bubble-user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  font-size: 0.92rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.askcora-answer {
  background: var(--surface);
  border: 1px solid var(--ink-line);
  border-radius: 16px 16px 16px 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 100%;
}
.askcora-answer--clarify {
  border-color: #f4c977;
  background: #fffaf0;
}
.askcora-answer--error {
  border-color: #f3b8b8;
  background: #fff5f5;
}

.askcora-skillchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  font-size: 0.74rem;
  color: var(--ink-soft);
  background: var(--canvas);
  width: fit-content;
}
.askcora-skillchip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}
.askcora-skillchip__conf {
  color: var(--color-muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.askcora-answer__body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
}

.askcora-params {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.askcora-param {
  font-size: 0.74rem;
  background: var(--canvas);
  border: 1px solid var(--ink-line-2);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}
.askcora-param b {
  color: var(--ink);
  font-weight: 600;
  margin-right: 4px;
}

/* Results table */
.askcora-results {
  border: 1px solid var(--ink-line-2);
  border-radius: 10px;
  overflow: hidden;
}
.askcora-results__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--canvas);
  border-bottom: 1px solid var(--ink-line-2);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.askcora-results__count b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.askcora-results__scroll {
  max-height: 360px;
  overflow: auto;
}
.askcora-results table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.askcora-results th {
  position: sticky;
  top: 0;
  background: var(--surface);
  text-align: left;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ink-line);
  color: var(--ink);
  white-space: nowrap;
}
.askcora-results td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--ink-line-2);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.askcora-results tr:last-child td { border-bottom: 0; }
.askcora-results tr:hover td { background: var(--canvas); }

.askcora-empty-rows {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.askcora-empty-rows .btn { margin-top: 10px; }

/* KQL provenance accordion */
.askcora-kql {
  border: 1px solid var(--ink-line-2);
  border-radius: 10px;
  background: var(--canvas);
}
.askcora-kql > summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.askcora-kql > summary::-webkit-details-marker { display: none; }
.askcora-kql > summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  text-align: center;
  font-weight: 600;
  color: var(--ink);
  transition: transform 180ms var(--ease-out);
}
.askcora-kql[open] > summary::before { content: ""; }
.askcora-kql pre {
  margin: 0;
  padding: 12px;
  border-top: 1px solid var(--ink-line-2);
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-x: auto;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Action chips below results */
.askcora-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.askcora-action {
  font-size: 0.78rem;
  padding: 6px 12px;
  border: 1px solid var(--ink-line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms var(--ease-out),
              border-color 160ms var(--ease-out),
              background-color 160ms var(--ease-out);
}
.askcora-action:hover {
  border-color: var(--ink);
  background: var(--canvas);
}
.askcora-action:active { transform: scale(0.97); }
.askcora-action--primary {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.askcora-action--primary:hover {
  background: rgba(230, 57, 70, 0.06);
}

/* Clarify chips */
.askcora-clarify {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.askcora-clarify__q {
  font-size: 0.88rem;
  color: var(--ink);
  margin: 0;
}
.askcora-clarify__field {
  display: flex;
  gap: 8px;
  align-items: center;
}
.askcora-clarify__label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  min-width: 100px;
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}
.askcora-clarify__input {
  flex: 1;
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 10px;
  border: 1px solid var(--ink-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.askcora-clarify__input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* Skeleton loading */
.askcora-skeleton {
  background: var(--surface);
  border: 1px solid var(--ink-line);
  border-radius: 16px 16px 16px 4px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.askcora-skeleton__line {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #eef0f3 0%, #f7f8fa 50%, #eef0f3 100%);
  background-size: 200% 100%;
  animation: askcora-shimmer 1.4s ease-in-out infinite;
}
.askcora-skeleton__line.w60 { width: 60%; }
.askcora-skeleton__line.w40 { width: 40%; }
.askcora-skeleton__line.w80 { width: 80%; }
.askcora-skeleton__line.tall { height: 80px; border-radius: 8px; }

/* Composer */
.askcora__composer {
  position: sticky;
  bottom: 0;
  padding: 12px 0 16px;
  background: linear-gradient(to top, var(--canvas) 70%, rgba(250, 251, 252, 0));
}
.askcora__composer-inner {
  background: var(--surface);
  border: 1px solid var(--ink-line);
  border-radius: 16px;
  padding: 10px 12px 8px;
  transition: border-color 160ms var(--ease-out),
              box-shadow 160ms var(--ease-out);
}
.askcora__composer-inner:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
}
.askcora__input {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
  background: transparent;
  max-height: 200px;
}
.askcora__input::placeholder { color: #94a3b8; }
.askcora__composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.askcora__hint {
  font-size: 0.72rem;
  color: var(--color-muted, #64748b);
}
.askcora__send {
  background: var(--color-primary);
  color: #fff;
  border: 0;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background-color 160ms var(--ease-out),
              opacity 160ms var(--ease-out);
}
.askcora__send:hover { background: var(--color-primary-hover, #c92f3c); }
.askcora__send[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Animations */
@keyframes askcora-rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes askcora-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive: collapse asymmetric grid on narrow screens */
@media (max-width: 720px) {
  .askcora__suggest { grid-template-columns: 1fr; }
  .askcora-card,
  .askcora-card:nth-child(n) { grid-column: span 1; }
  .askcora__hero { flex-direction: column; align-items: flex-start; }
}

/* Honor reduced-motion: collapse all motion. */
@media (prefers-reduced-motion: reduce) {
  .askcora-card,
  .askcora-turn,
  .askcora-skeleton__line,
  .askcora-kql > summary::before,
  .askcora-action,
  .askcora__send,
  .askcora__composer-inner {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
/* Ask CORA - iterative layer: summary + follow-up pivots */
.askcora-insight {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px dashed var(--ink-line-2);
  margin-top: 2px;
  padding-top: 12px;
}
.askcora-insight--loading { opacity: 0.7; }
.askcora-summary { display: flex; flex-direction: column; gap: 4px; }
.askcora-summary__kicker {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-primary); font-weight: 700;
}
.askcora-summary__body {
  font-size: 0.92rem; line-height: 1.5; color: var(--ink);
  font-weight: 500; letter-spacing: -0.005em;
}
.askcora-followups { display: flex; flex-direction: column; gap: 8px; }
.askcora-followups__kicker {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-muted, #64748b); font-weight: 600;
}
.askcora-followups__row { display: flex; flex-direction: column; gap: 6px; }
.askcora-followup {
  background: var(--canvas); border: 1px solid var(--ink-line-2);
  border-radius: 10px; padding: 10px 12px; text-align: left;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  color: var(--ink); font: inherit;
  transition: transform 160ms var(--ease-out),
              border-color 160ms var(--ease-out),
              background-color 160ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .askcora-followup:hover {
    border-color: var(--ink); background: var(--surface);
    transform: translateX(2px);
  }
}
.askcora-followup:active { transform: translateX(0) scale(0.99); }
.askcora-followup__label {
  font-size: 0.88rem; font-weight: 600; color: var(--ink);
}
.askcora-followup__reason {
  font-size: 0.78rem; color: var(--ink-soft); line-height: 1.4;
}
.askcora-bubble-user--followup {
  display: flex; flex-direction: column; gap: 2px;
  background: #1e293b; border: 1px solid #334155;
}
.askcora-bubble-user__kicker {
  font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #94a3b8; font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .askcora-followup, .askcora-insight {
    transition: none !important; transform: none !important;
  }
}
/* Ask CORA - investigation card (planner -> steps -> synthesis) */

.askcora-thinking {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}
.askcora-thinking__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.4;
  animation: askcora-pulse 1.2s ease-in-out infinite;
}
.askcora-thinking__dot:nth-child(2) { animation-delay: 0.15s; }
.askcora-thinking__dot:nth-child(3) { animation-delay: 0.3s; }
.askcora-thinking__label { margin-left: 6px; letter-spacing: 0.01em; }
@keyframes askcora-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.1); }
}

.askcora-investigation {
  background: var(--surface);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.askcora-intent {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--ink-line);
}
.askcora-intent__kicker {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-primary); font-weight: 700;
}
.askcora-intent__body {
  font-size: 0.95rem; line-height: 1.45; color: var(--ink);
  font-weight: 600; letter-spacing: -0.005em;
}

.askcora-plan { display: flex; flex-direction: column; gap: 10px; }
.askcora-plan__header {
  display: flex; align-items: baseline; justify-content: space-between;
}
.askcora-plan__kicker {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 700;
}
.askcora-plan__count {
  font-size: 0.72rem; color: var(--ink-soft); font-weight: 500;
}
.askcora-plan__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.askcora-plan__item {
  border: 1px solid var(--ink-line);
  border-radius: 12px;
  background: var(--canvas);
  overflow: hidden;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.askcora-plan__row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.askcora-plan__num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--ink-line);
  color: var(--ink-soft); font-size: 0.78rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.askcora-plan__textcol {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.askcora-plan__title {
  font-size: 0.9rem; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.askcora-plan__goal {
  font-size: 0.78rem; color: var(--ink-soft); line-height: 1.4;
}
.askcora-plan__status {
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; padding: 4px 8px; border-radius: 999px;
  background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--ink-line);
}
.askcora-plan__status[data-status="running"] {
  background: rgba(230, 57, 70, 0.08);
  color: var(--color-primary);
  border-color: rgba(230, 57, 70, 0.3);
}
.askcora-plan__status[data-status="done"] {
  background: #0f172a; color: #ffffff; border-color: #0f172a;
}
.askcora-plan__status[data-status="error"] {
  background: rgba(220, 38, 38, 0.1); color: #b91c1c; border-color: rgba(220, 38, 38, 0.3);
}
.askcora-plan__slot:not(:empty) {
  padding: 0 14px 14px 14px;
  border-top: 1px dashed var(--ink-line);
}
.askcora-plan__slot:not(:empty) > * { margin-top: 12px; }

.askcora-step__result { display: flex; flex-direction: column; gap: 10px; }
.askcora-step__error {
  color: #b91c1c; background: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.2);
  padding: 10px 12px; border-radius: 8px;
  font-size: 0.85rem;
}

.askcora-vitals { display: flex; flex-wrap: wrap; gap: 6px; }
.askcora-vital {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--surface); border: 1px solid var(--ink-line);
  border-radius: 999px; padding: 5px 12px;
  line-height: 1.2;
}
.askcora-vital__k {
  font-size: 0.75rem; letter-spacing: 0.02em;
  color: var(--ink-soft); font-weight: 500;
  text-transform: none;
}
.askcora-vital__v {
  font-size: 0.85rem; color: var(--ink); font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.askcora-tops { display: flex; flex-direction: column; gap: 8px; }
.askcora-topgroup { display: flex; flex-direction: column; gap: 4px; }
.askcora-topgroup__k {
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600;
}
.askcora-topgroup__row { display: flex; flex-wrap: wrap; gap: 6px; }
.askcora-toppill {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 0.8rem; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--ink-line);
  border-radius: 999px; padding: 4px 10px;
  max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.askcora-toppill b { font-weight: 600; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.askcora-toppill__count {
  color: var(--ink-soft); font-size: 0.72rem; font-variant-numeric: tabular-nums;
}

.askcora-results-wrap > summary,
.askcora-kql > summary {
  cursor: pointer; padding: 8px 10px;
  font-size: 0.8rem; color: var(--ink-soft);
  background: var(--canvas); border: 1px solid var(--ink-line);
  border-radius: 8px;
  list-style: none;
  transition: border-color 160ms var(--ease-out);
}
.askcora-results-wrap > summary::-webkit-details-marker,
.askcora-kql > summary::-webkit-details-marker { display: none; }
.askcora-results-wrap[open] > summary,
.askcora-kql[open] > summary { border-color: var(--ink); color: var(--ink); }

.askcora-synth {
  display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--ink-line);
  padding-top: 14px;
}
.askcora-synth--loading { opacity: 0.6; padding: 4px 0; }
.askcora-synth__headline {
  font-size: 1.05rem; line-height: 1.35; font-weight: 700;
  color: var(--ink); letter-spacing: -0.01em;
}
.askcora-synth__summary { display: flex; flex-direction: column; gap: 4px; }
.askcora-synth__kicker {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-primary); font-weight: 700;
}
.askcora-synth__body {
  font-size: 0.92rem; line-height: 1.5; color: var(--ink); font-weight: 500;
}
.askcora-synth__actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  .askcora-thinking__dot { animation: none; opacity: 0.6; }
  .askcora-investigation, .askcora-plan__item, .askcora-vital,
  .askcora-toppill, .askcora-results-wrap, .askcora-kql {
    transition: none !important;
  }
}
/* Ask CORA - parameter-needed prompt with suggestion chips. */
.askcora-need{
  background:var(--surface);
  border:1px solid var(--ink-line);
  border-radius:14px;
  padding:18px 20px;
  margin-top:8px;
  display:flex; flex-direction:column; gap:12px;
}
.askcora-need--used{opacity:.65}
.askcora-need__kicker{
  font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--color-primary); font-weight:700;
}
.askcora-need__intent{
  font-size:14px; color:var(--ink); font-weight:600;
}
.askcora-need__skill{font-size:13px; color:var(--ink-soft)}
.askcora-need__goal{color:var(--ink-soft)}
.askcora-need__field{display:flex; flex-direction:column; gap:2px; margin-top:4px}
.askcora-need__label{font-size:13px; color:var(--ink); font-weight:600}
.askcora-need__label code{
  background:var(--canvas); border:1px solid var(--ink-line);
  padding:1px 6px; border-radius:4px; font-size:12px;
}
.askcora-need__desc{font-size:12px; color:var(--ink-soft)}
.askcora-need__chips{
  display:flex; flex-wrap:wrap; gap:6px; margin-top:2px;
}
.askcora-need__chip{
  display:inline-flex; align-items:center; gap:8px;
  background:var(--canvas); border:1px solid var(--ink-line);
  border-radius:999px; padding:6px 12px;
  font-size:12px; color:var(--ink); cursor:pointer;
  transition:transform .15s var(--ease-out), border-color .15s var(--ease-out);
}
.askcora-need__chip:hover:not(:disabled){
  border-color:var(--ink); transform:translateY(-1px);
}
.askcora-need__chip:disabled{cursor:default; opacity:.5}
.askcora-need__chipv{font-weight:600}
.askcora-need__chipn{color:var(--ink-soft); font-size:11px}
.askcora-need__nochips{
  font-size:12px; color:var(--ink-soft); font-style:italic;
}
.askcora-need__manual{
  display:flex; gap:8px; margin-top:6px;
}
.askcora-need__input{
  flex:1; padding:8px 12px; border:1px solid var(--ink-line);
  border-radius:8px; font-size:13px; color:var(--ink);
  background:var(--canvas);
}
.askcora-need__input:focus{outline:none; border-color:var(--ink)}
@media (prefers-reduced-motion: reduce){
  .askcora-need__chip{transition:none}
  .askcora-need__chip:hover:not(:disabled){transform:none}
}