:root {
  --bg: #050816;
  --card: #0b1121;
  --accent: #00ffcc;
  --accent-soft: #00e6b8;
  --danger: #ff4b5c;
  --warn: #ffb547;
  --text-main: #ffffff;
  --text-muted: #a5b4cf;
  --border-soft: #1f2937;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* PAGE LAYOUT */

body {
  margin: 0;
  padding: 32px 24px 48px;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 50%, #000 100%);
  color: var(--text-main);
  display: flex;
  justify-content: center;
}

.shell {
  width: 100%;
  max-width: 1120px;
}

/* HEADER */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.78rem;
  color: #e5e7eb;
  text-decoration: none;
  cursor: pointer;
}

.badge-link span.icon {
  font-size: 1rem;
}

.badge-link:hover {
  background: rgba(15, 23, 42, 1);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.95);
  cursor: pointer;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #4ade80, #22c55e, #0f766e);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #020617;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-tenant {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* MAIN CARD */

.card[aria-label="Ask Civitas workspace"] {
  background: radial-gradient(circle at top left, #020617 0, #020617 55%, #000 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.27);
  padding: 18px 20px 22px;
  box-shadow:
    0 24px 60px rgba(2, 6, 23, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.8);
  position: relative;
}

/* COUNSEL’S NOTE – WELCOME OVERLAY */

.welcome-overlay {
  position: absolute;
  inset: 0 auto auto 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.welcome-overlay.hidden {
  display: none;
}

.welcome-tile {
  pointer-events: auto;
  min-width: 320px;
  max-width: 520px;
  margin-top: -32px;
  padding: 14px 16px 12px;
  border-radius: 12px;

  /* 🟢 match site accent */
  border: 1px solid rgba(0, 255, 204, 0.7);
  background:
    radial-gradient(circle at top left, rgba(0, 255, 204, 0.12), transparent 55%),
    rgba(15, 23, 42, 0.98);

  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.welcome-tile::before {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 6px;
  width: 70px;
  height: 70px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 204, 0.22); /* subtle accent halo */
  opacity: 0.3;
  pointer-events: none;
}

.welcome-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}

.welcome-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;

  /* 🟢 same accent as buttons/pills */
  color: var(--accent);
}

.welcome-body {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.welcome-bullets {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.8rem;
  color: #e5e7eb; /* a touch brighter so it feels “primary” */
}

.welcome-dismiss {
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 255, 204, 0.65);
  background: transparent;
  color: var(--accent-soft);
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  z-index: 1;
}

.welcome-dismiss:hover {
  background: rgba(15, 23, 42, 0.9);
}

.welcome-info-pill {
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px dashed rgba(0, 255, 204, 0.6);
  background: transparent;
  color: var(--accent-soft);
  font-size: 0.75rem;
  cursor: pointer;
  display: none;
}

.welcome-info-pill.visible {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* FORM AREA */

.helper-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 32px;
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

textarea {
  width: 100%;
  min-height: 200px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(15, 23, 42, 0.95);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 255, 204, 0.3);
}

/* === Primary action strip under textarea === */

.card .actions-row {
  margin-top: 20px;
  margin-bottom: 0;
  padding: 16px 20px;
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(0, 255, 200, 0.14), transparent 55%),
    rgba(6, 12, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.card .actions-row .hint {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  max-width: 70%;
}

.card .actions-row .hint span {
  font-size: 12px;
}

.btn-primary {
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  color: #020617;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 18px rgba(0, 255, 204, 0.35);
}

.card .actions-row .btn-primary {
  flex-shrink: 0;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* === RESULTS PANEL === */

.results {
  margin-top: 18px;
  padding: 18px 20px 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(0, 255, 200, 0.08), transparent 55%),
    rgba(3, 7, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: none; /* JS sets to block once there is a result */
}

/* Header strip: status dot + text */
.result-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.result-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  margin-top: 4px;
  background: rgba(148, 163, 184, 0.8);
  flex-shrink: 0;
}

.result-dot--green  { background: #22c55e; }
.result-dot--amber  { background: #facc15; }
.result-dot--red    { background: #f97373; }
.result-dot--neutral{ background: rgba(148, 163, 184, 0.8); }

.result-title {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
}

.result-subtitle {
  font-size: 13px;
  color: rgba(209, 213, 219, 0.85);
  margin-top: 2px;
}

/* Issues panel */

.issues-panel {
  margin-top: 8px;
  padding: 6px 8px 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.issues-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(229, 231, 235, 0.9);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 2px;
  cursor: pointer;
}

.issues-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: rgba(209, 213, 219, 0.9);
}

/* Compliant preview panel */

.compliant-panel {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.6);
}

.compliant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.compliant-title {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.compliant-subtitle {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.95);
}

.compliant-body {
  position: relative;
}

.compliant-text-wrapper {
  position: relative;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(55, 65, 81, 0.9);
  font-size: 13px;
  white-space: pre-wrap;
}

.compliant-text {
  margin: 0;
  font-family: inherit;
}

.compliant-panel.locked .compliant-text{
  position:relative;
  user-select:none;
  opacity:0.92;
}
.compliant-panel.locked .compliant-text::after{
  content:"Preview only – make it Send-Ready to unlock";
  position:absolute;
  right:12px;
  bottom:8px;
  font-size:11px;
  color:#cbd5f5;
  opacity:0.7;
}
/* Optional very subtle diagonal wash (not a full block) */
.compliant-panel.locked .compliant-text::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:repeating-linear-gradient(
    -45deg,
    rgba(148,163,184,0.12) 0,
    rgba(148,163,184,0.12) 1px,
    transparent 1px,
    transparent 6px
  );
  pointer-events:none;
}
.compliant-panel.unlocked .compliant-text{
  user-select:text;
  opacity:1;
}

/* Lock overlay over compliant preview until approved – disabled */
.compliant-lock-overlay {
  display: none !important;
}

.compliant-lock-inner {
  text-align: center;
  font-size: 12px;
  color: rgba(209, 213, 219, 0.9);
}

#logIntegrityChip.chip {
  cursor: pointer;
}

/* Approve / decline row under preview */

.decision-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Footer: quota, confidence, details link */

.results-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(30, 64, 175, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.results-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  opacity: 0.7;
}
#runStatus {
  letter-spacing: 0.02em;
}

.quota-chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
  font-size: 11px;
  color: rgba(209, 213, 219, 0.9);
}

#runnerVerdict {
  text-transform: lowercase;
}

.btn-ghost {
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.results-footer .btn-ghost {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.9);
}

/* CHIPS */

.chip {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
}

.chip--green {
  background: rgba(22, 163, 74, 0.16);
  color: #bbf7d0;
  border: 1px solid #16a34a;
}

.chip--amber {
  background: rgba(250, 204, 21, 0.16);
  color: #fef3c7;
  border: 1px solid #eab308;
}

.chip--red {
  background: rgba(248, 113, 113, 0.16);
  color: #fee2e2;
  border: 1px solid #ef4444;
}

.chip.chip--outline{
  border:1px solid #475569;
  background:transparent;
  color:#e5e7eb;
}
.chip.chip--outline:hover{
  background:rgba(15,23,42,0.8);
  cursor:pointer;
}

.result-dot--loading {
  border-radius: 999px;
  border-width: 2px;
  border-style: solid;
  /* keep your existing colour system, this is just an example */
  border-color: rgba(255,255,255,0.85);
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  animation: civitas-pulse 1.1s ease-in-out infinite;
}

@keyframes civitas-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

.civitas-checking .results {
  position: relative;
  overflow: hidden;
}

.civitas-checking .results::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255,255,255,0.08),
    transparent
  );
  transform: translateX(-100%);
  animation: civitas-shimmer 1.4s ease-out infinite;
  pointer-events: none;
}

@keyframes civitas-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.btn-primary.is-loading span:last-child::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: civitas-dots 1s steps(4, end) infinite;
}

@keyframes civitas-dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

/* Locked compliant preview: can't highlight / copy */
  .compliant-panel.locked .compliant-text {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
  }
  
/* MODALS – SHARED */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal {
  width: min(640px, 100%);
  max-height: 80vh;
  background: #020617;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 18px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
}

.modal.modal--narrow {
  max-width: 460px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  overflow: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-main);
  margin-bottom: 4px;
}

.modal-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.btn-small {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--accent);
  background: rgba(15, 23, 42, 1);
  color: var(--accent);
  cursor: pointer;
}

.btn-small:hover {
  background: rgba(15, 23, 42, 0.9);
}

.btn-small-solid {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  color: #020617;
  border-color: var(--accent);
}

.btn-small-solid:hover {
  background: var(--accent-soft);
}

/* Scribed page */

.corpus-shell h1 {
      font-size: 1.3rem;
      margin: 0 0 4px;
    }
    .corpus-shell p {
      margin: 0;
      font-size: 0.9rem;
      opacity: 0.8;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }
    th, td {
      padding: 8px 6px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.35);
      vertical-align: top;
    }
    th {
      text-align: left;
      font-weight: 600;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      opacity: 0.8;
    }
    .muted {
      opacity: 0.7;
    }

    .pill {
      display:inline-flex;
      align-items:center;
      padding:2px 8px;
      border-radius:999px;
      border:1px solid rgba(148,163,184,0.6);
      font-size:0.75rem;
    }
    .pill--domain {
      border-color:#60a5fa80;
    }
    .tag {
      display:inline-flex;
      align-items:center;
      padding:2px 8px;
      margin:2px 6px 0 0;
      border-radius:999px;
      border:1px solid rgba(148,163,184,0.4);
      font-size:0.72rem;
      white-space:nowrap;
    }
    .id-text {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      font-size: 0.78rem;
    }
    .doc-link {
      text-decoration: none;
      color: var(--accent);            /* 🟢 use site accent */
      font-weight: 500;
    }
    .doc-link:hover {
      text-decoration: underline;
      color: var(--accent-soft);       /* slightly softer green on hover */
    }
    .doc-link:visited {
      color: var(--accent);            /* avoid purple visited links */
    }

    .corpus-toolbar select {
        font-size: 0.85rem;
        background: #020617;
        border-radius: 999px;
        border: 1px solid #334155;
        color: #e5e7eb;
        padding: 5px 10px;
      }
      .corpus-toolbar select:focus {
        outline: none;
        border-color: var(--accent);
      }

      th.sortable {
        cursor: pointer;
        user-select: none;
        position: relative;
      }

      th.sortable::after {
        content: "";
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.65rem;
        opacity: 0; /* only visible on active column */
      }

      th.sortable.is-sorted::after {
        opacity: 0.7;
      }

      th.sortable.is-sorted[data-sort-dir="asc"]::after {
        content: "▲";
      }

      th.sortable.is-sorted[data-sort-dir="desc"]::after {
        content: "▼";
      }

    .corpus-toolbar {
      display:flex;
      align-items:center;
      gap:8px;
      margin:12px 0 8px;
      flex-wrap:wrap;
    }
    .corpus-toolbar input[type="search"] {
      flex:1;
      min-width:180px;
      font-size:0.85rem;
    }
    .corpus-count {
      font-size:0.8rem;
      opacity:0.75;
      white-space:nowrap;
    }

/* INLINE INTEGRITY PANEL */

.modal-integrity {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
}

.modal-integrity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.integrity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.85rem;
}

.integrity-empty {
  color: var(--text-muted);
  padding: 4px 0;
}

.integrity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: 6px 10px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
}

.integrity-row:last-child {
  border-bottom: none;
}

.integrity-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 4px;
  background: rgba(148, 163, 184, 0.6);
}

.integrity-ok .integrity-dot {
  background: #22c55e;
}

.integrity-warn .integrity-dot {
  background: #eab308;
}

.integrity-err .integrity-dot {
  background: #ef4444;
}

.integrity-main {
  min-width: 0;
}

.integrity-file {
  font-weight: 500;
  font-size: 0.85rem;
}

.integrity-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrity-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.integrity-link:hover {
  text-decoration: underline;
}
/* ─────────────────────────────────────────────
   L2 MINI TIMELINE (Integrity Popup)
   ───────────────────────────────────────────── */

.integrity-timeline {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 18px 6px 6px;
  position: relative;
}
/* LOCAL Level-3 overlay inside the modal */
.integrity-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* ─────────────────────────────────────────
   INTEGRITY LOCAL L3 OVERLAY
   ───────────────────────────────────────── */

.integrity-timeline {
  position: relative;
}

.integrity-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.integrity-tooltip-portal {
  position: fixed; z-index: 9999; max-width: 280px;
  background: #0b0f14; color: #fff; border-radius: 10px;
  padding: 12px 14px; font-size: 12px; line-height: 1.4;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.integrity-tooltip-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.integrity-tooltip-body  { opacity: .92; margin-bottom: 4px; }
.integrity-tooltip-threat{ color: #f9c74f; font-weight: 500; margin-bottom: 4px; }
.integrity-tooltip-signal{ color: #6ee7b7; font-weight: 600; margin-bottom: 4px; }
.integrity-tooltip-action{ color: #93c5fd; font-weight: 500; }

.integrity-tooltip-portal { animation: civitasFade .12s ease-out; }

@keyframes civitasFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.integrity-tooltip-portal.clickable { cursor: pointer; }
.integrity-tooltip-portal.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
}

.integrity-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow:
    0 0 0 4px rgba(16,185,129,.12),
    0 0 18px rgba(16,185,129,.45);
  transition: transform .12s ease, box-shadow .12s ease;
}

.integrity-node:hover .integrity-node-dot {
  transform: scale(1.15);
  box-shadow:
    0 0 0 6px rgba(16,185,129,.16),
    0 0 24px rgba(16,185,129,.55);
}

.integrity-node-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .2px;
  opacity: .85;
}

@keyframes integrityFade {
  from { opacity: 0; transform: translate(-50%,-90%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%,-100%) scale(1); }
}

.integrity-lines {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.integrity-tooltip-layer {
  position: absolute;
  inset: 0;
  pointer-events: none; /* we click nodes, not the bubble */
}

.integrity-lines {
  position: absolute;
  inset: 0;
}

.civitas-animate-input {
  animation: civPulse 0.6s ease;
}
.civitas-animate-decision {
  animation: civFlash 0.8s ease;
}
.civitas-animate-output {
  animation: civSlide 0.6s ease;
}

@keyframes civPulse {
  0% { box-shadow: 0 0 0 rgba(0,0,0,0); }
  50% { box-shadow: 0 0 20px rgba(0,255,160,0.6); }
  100% { box-shadow: 0 0 0 rgba(0,0,0,0); }
}
@keyframes civFlash {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}
@keyframes civSlide {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.integrity-play-active {
  box-shadow: 0 0 14px rgba(0,255,160,0.9);
  transform: scale(1.05);
}
.integrity-node {
  flex: 1;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.integrity-node-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin: 0 auto 6px;
  background: #bbb;
}

.integrity-node.ok   .integrity-node-dot { background: #2ecc71; }
.integrity-node.warn .integrity-node-dot { background: #f1c40f; }
.integrity-node.err  .integrity-node-dot { background: #e74c3c; }

.integrity-node-label {
  font-size: 0.75rem;
  opacity: 0.85;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   L3 TOOLTIP
   ───────────────────────────────────────────── */

.integrity-tooltip {
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  width: 200px;
  line-height: 1.4;
  z-index: 9999;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  display: none;
}

/* Body-level portal container for integrity tooltips */
#integrityTooltipPortal {
  position: fixed;          /* we position children with JS */
  inset: 0;                 /* makes sure it can cover the viewport */
  pointer-events: none;     /* clicks pass through */
  z-index: 9999;            /* above modals */
}


/* The tooltip bubble that lives in the overlay */
.integrity-tooltip-portal {
  position: absolute;        /* ⬅️ was fixed */
  max-width: 260px;
  background: #111;
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  line-height: 1.4;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  pointer-events: none;
  white-space: normal;
}
/* Let the integrity timeline tooltips escape the scroll box */
.modal--integrity .modal-body {
  overflow: visible;
}

.integrity-hash {
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 0.7rem;
  opacity: 0.85;
}

.integrity-pin-hint {
  margin-top: 2px;
  font-size: 0.7rem;
  opacity: 0.6;
}
/* And don't clip inside the list either */
.modal--integrity .integrity-list {
  max-height: none;
  overflow: visible;
}

.integrity-node:hover .integrity-tooltip {
  display: block;
}
/* --- Layout & header reusing Civitas tokens --- */

    body.simple-page {
      background: radial-gradient(circle at top, #020617 0, #000 60%);
      color: var(--text-main);
      display: flex;
      justify-content: center;
      padding: 32px 24px 48px;
    }

    .ilk-shell {
      width: 100%;
      max-width: 960px;
    }

    .ilk-header-title {
      font-size: 1.3rem;
      font-weight: 600;
      margin: 0 0 4px;
    }

    .ilk-header-sub {
      margin: 0;
      font-size: 0.8rem;
      opacity: 0.8;
    }

    /* --- Tabs --- */

    .ilk-tabs-row {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      margin: 8px 0 12px;
    }

    .ilk-tabs-row .spacer {
      flex: 1;
    }

    .ilk-tab {
      border-radius: var(--radius-pill);
      border: 1px solid #334155;
      background: #020617;
      color: var(--text-main);
      font-size: 0.78rem;
      padding: 6px 12px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .ilk-tab[data-active="true"] {
      border-color: var(--accent);
      background: radial-gradient(circle at top left,
                  rgba(0,255,204,0.15),
                  transparent 60%),
                  #020617;
      box-shadow: 0 0 0 1px rgba(0,255,204,0.25);
    }

    .ilk-tab:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    /* --- Meta chips --- */

    #meta.chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin: 4px 0 10px;
    }

    #meta .chip {
      padding: 4px 8px;
      border-radius: var(--radius-pill);
      border: 1px solid #334155;
      background: rgba(15,23,42,0.9);
      font-size: 0.75rem;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    #meta .chip strong {
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      opacity: 0.7;
    }

    .copy {
      display:inline-flex;
      align-items:center;
      gap:4px;
      font-size:0.7rem;
      padding:3px 6px;
      border-radius:999px;
      border:1px solid #3b82f6;
      background:rgba(15,23,42,1);
      color:#e5e7eb;
      cursor:pointer;
    }

    /* --- Summary card --- */

    .ilk-summary-list {
      list-style:none;
      padding:0;
      margin:0;
      border-radius:12px;
      border:1px solid rgba(15,23,42,0.9);
      max-height:38vh;
      overflow:auto;
    }

    .ilk-summary-list li {
      display:flex;
      gap:10px;
      align-items:flex-start;
      padding:7px 9px;
      font-size:0.8rem;
      border-bottom:1px dashed rgba(15,23,42,0.6);
      cursor:pointer;
    }

    .ilk-summary-list li:last-child {
      border-bottom:none;
    }

    .tick {
      width:18px;
      height:18px;
      border-radius:999px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      font-size:11px;
    }
    .tick.ok   { background:#022c22; color:#6ee7b7; }
    .tick.warn { background:#451a03; color:#fed7aa; }
    .tick.err  { background:#2f1b1b; color:#fecaca; }

    .file {
      font-weight:500;
    }
    .small {
      font-size:0.75rem;
      color:var(--text-muted);
    }

    #summaryFallback {
      display:none;
      margin-top:8px;
      max-height:38vh;
      overflow:auto;
      font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
      font-size:0.8rem;
      white-space:pre-wrap;
      word-break:break-word;
    }

    .pill {
      display:inline-flex;
      align-items:center;
      padding:2px 8px;
      border-radius:999px;
      font-size:0.75rem;
      border:1px solid rgba(148,163,184,0.7);
      background:#020617;
    }
    .pill.ok   { border-color:#16a34a; color:#bbf7d0; background:#022c22; }
    .pill.warn { border-color:#eab308; color:#fef3c7; background:#451a03; }
    .pill.err  { border-color:#ef4444; color:#fee2e2; background:#2f1b1b; }

    /* --- Table --- */

    .table-wrap {
      margin-top:8px;
      border-radius:12px;
      border:1px solid #1f2937;
      overflow:auto;
    }
    #tbl {
      width:100%;
      border-collapse:collapse;
      font-size:0.8rem;
      min-width:720px;
    }
    #tbl th, #tbl td {
      padding:7px 9px;
      border-bottom:1px solid #1f2937;
      white-space:nowrap;
    }
    #tbl thead {
      background:#020617;
      color:#9ca3af;
      font-size:0.72rem;
      text-transform:uppercase;
      letter-spacing:0.06em;
    }
    #tbl tbody tr:nth-child(even) {
      background:rgba(15,23,42,0.6);
    }
    #tbl tbody tr:hover td {
      background:rgba(15,23,42,0.9);
    }

    .mono {
      font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
      font-size:0.75rem;
    }

    .hl {
      background:#2a3b12;
      border-radius:2px;
      padding:0 2px;
    }

    .toolbar {
      display:flex;
      gap:8px;
      align-items:center;
      flex-wrap:wrap;
    }

    .toolbar input[type="search"] {
      padding:6px 10px;
      border-radius:999px;
      border:1px solid #334155;
      background:#020617;
      color:#e5e7eb;
      font-size:0.8rem;
      min-width:200px;
    }
    .toolbar input[type="search"]:focus {
      outline:none;
      border-color:var(--accent);
      box-shadow:0 0 0 1px rgba(0,255,204,0.4);
    }

    .btn {
      border-radius:var(--radius-pill);
      border:1px solid #334155;
      background:#020617;
      color:#e5e7eb;
      font-size:0.8rem;
      padding:6px 12px;
      cursor:pointer;
    }
    .btn:hover {
      background:rgba(15,23,42,1);
    }

    /* ILK viewer shell */
.ilk-shell {
  max-width: 960px;
  margin: 40px auto;
}

.ilk-header-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.ilk-header-sub {
  margin-top: 4px;
  font-size: 0.8rem;
  opacity: 0.75;
}

/* Tabs row */
.ilk-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}

.ilk-tabs-row .spacer {
  flex: 1;
}

.ilk-tab {
  border-radius: var(--radius-pill);
  border: 1px solid #334155;
  background: #020617;
  color: var(--text-main);
  font-size: 0.78rem;
  padding: 6px 12px;
  cursor: pointer;
}

.ilk-tab[data-active="true"] {
  border-color: var(--accent);
  background: radial-gradient(circle at top,
              rgba(0,255,204,0.18),
              #020617 60%);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,255,204,0.22);
}

.ilk-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Small neutral button used in this viewer */
.btn {
  border-radius: var(--radius-pill);
  border: 1px solid #334155;
  background: #020617;
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn:hover {
  background: rgba(15,23,42,0.95);
  border-color: var(--accent-soft);
}

/* Meta chips row */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 10px;
}

.chips .chip.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
}

.chips .chip button.copy {
  border-radius: 6px;
  border: 1px solid rgba(148,163,184,0.6);
  background: transparent;
  color: var(--text-main);
  font-size: 0.68rem;
  padding: 2px 4px;
  cursor: pointer;
}

/* Summary status pill colours */
.pill.ok {
  background: #022c22;
  color: #6ee7b7;
  border-color: #16a34a;
}

.pill.warn {
  background: #451a03;
  color: #fed7aa;
  border-color: #f59e0b;
}

.pill.err {
  background: #2f1b1b;
  color: #fecaca;
  border-color: #ef4444;
}

/* Integrity summary list */
.ilk-summary-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  border-radius: 10px;
  border: 1px solid rgba(31,41,55,0.9);
  background: #020617;
  max-height: 260px;
  overflow: auto;
}

.ilk-summary-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 9px;
  border-bottom: 1px dashed rgba(15,23,42,0.9);
  cursor: pointer;
}

.ilk-summary-list li:last-child {
  border-bottom: none;
}

.ilk-summary-list li:hover {
  background: rgba(15,23,42,0.9);
}

.tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.tick.ok {
  background:#022c22;
  color:#6ee7b7;
  border:1px solid #16a34a;
}

.tick.warn {
  background:#451a03;
  color:#fed7aa;
  border:1px solid #f59e0b;
}

.tick.err {
  background:#2f1b1b;
  color:#fecaca;
  border:1px solid #ef4444;
}

.ilk-summary-list .file {
  font-size: 0.8rem;
  font-weight: 500;
}

.ilk-summary-list .small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Summary fallback pre */
#summaryFallback {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,55,0.9);
  background: #020617;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  max-height: 260px;
  overflow: auto;
}

/* Table */
.table-wrap {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.9);
  overflow: auto;
}

#tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

#tbl th,
#tbl td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(31,41,55,0.9);
}

#tbl thead {
  background: #020617;
  position: sticky;
  top: 0;
}

#tbl tbody tr:hover td {
  background: rgba(15,23,42,0.9);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Highlight in table search */
.hl {
  background: rgba(56,189,248,0.18);
  border-radius: 3px;
}
/* HISTORY DRAWER */

.history-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: none;
  z-index: 30;
}

.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 360px;
  max-width: 100%;
  background: #020617;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateX(100%);
  transition: transform 0.18s ease-out;
  z-index: 31;
}

.history-backdrop.open {
  display: block;
}

.history-drawer.open {
  transform: translateX(0);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.history-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.history-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.history-item {
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.8);
  padding: 8px 8px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.95);
}

.history-item:hover {
  border-color: var(--accent);
}

.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.hist-verdict-pill {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.hist-verdict-pill.green {
  border-color: #16a34a;
  color: #bbf7d0;
}

.hist-verdict-pill.amber {
  border-color: #eab308;
  color: #fef3c7;
}

.hist-verdict-pill.red {
  border-color: #ef4444;
  color: #fee2e2;
}

.hist-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hist-snippet {
  margin: 0;
  color: #e5e7eb;
  font-size: 0.8rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* NOMINATION / REFERRAL FORM */

.nomination-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.nomination-row {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nomination-row input,
.nomination-row textarea {
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: #020617;
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 6px 8px;
}

.nomination-row input:focus,
.nomination-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.fine-print {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* INNER CIRCLE TOAST */

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(0, 255, 204, 0.7);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-body {
  font-size: 0.8rem;
  color: var(--text-muted);
}
/* Nomination: suggested intro email panel */

.email-template-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
}

.email-template-panel .fine-print {
  margin-top: 2px;
  margin-bottom: 6px;
}

.email-template {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #020617;
  color: var(--text-main);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 8px 9px;
  resize: vertical;
}

.email-template:focus {
  outline: none;
  border-color: var(--accent);
}

.email-template-copy-btn {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}

/* Simple stats page layout */

body.simple-page {
  background: radial-gradient(circle at top, #020617 0, #000 60%);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  padding: 32px 24px 48px;
}

.simple-card {
  width: 100%;
  max-width: 840px;
  background: #020617;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 18px 20px 20px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.9);
}

/* Governance stats grid */

.gov-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stat-card {
  background: radial-gradient(circle at top left,
              rgba(148, 163, 184, 0.06),
              transparent 55%),
              #020617;
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  padding: 12px 14px;
}

.stat-card--wide {
  grid-column: span 1;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
}

.stat-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-subcopy {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Little percentage chips */

.stat-chip {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.stat-chip--green {
  border-color: #16a34a;
  color: #bbf7d0;
}

.stat-chip--amber {
  border-color: #eab308;
  color: #fef3c7;
}

.stat-chip--red {
  border-color: #ef4444;
  color: #fee2e2;
}

/*Admin Dashbaord Style */

.admin-shell {
      max-width: 960px;
      margin: 40px auto;
    }
    .admin-header {
      display:flex;
      justify-content:space-between;
      align-items:center;
      margin-bottom:20px;
    }
    .admin-title {
      font-size:1.4rem;
      font-weight:600;
    }
    .admin-subtitle {
      margin-top:4px;
      font-size:0.8rem;
      opacity:0.7;
    }
    .admin-nav {
      display:flex;
      gap:8px;
      align-items:center;
    }
    .admin-card {
      background:#020617;
      border-radius:16px;
      border:1px solid #1f2937;
      padding:16px 18px;
      margin-bottom:16px;
    }
    .admin-card h2 {
      margin:0 0 8px;
      font-size:0.95rem;
      font-weight:500;
    }
    .admin-form-row {
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      align-items:center;
      margin-top:8px;
    }
    .admin-form-row input[type="text"],
    .admin-form-row input[type="password"],
    .admin-form-row input[type="number"] {
      background:#020617;
      border:1px solid #334155;
      border-radius:999px;
      padding:6px 10px;
      font-size:0.85rem;
      color:#e5e7eb;
      min-width:130px;
    }
    .admin-form-row input:focus {
      outline:none;
      border-color:#22c55e;
    }
    .admin-table {
      width:100%;
      border-collapse:collapse;
      margin-top:10px;
      font-size:0.85rem;
    }
    .admin-table th,
    .admin-table td {
      padding:6px 8px;
    }
    .admin-table thead {
      color:#9ca3af;
      font-weight:500;
      border-bottom:1px solid #1f2937;
    }
    .admin-table tbody tr:nth-child(even) {
      background:rgba(15,23,42,0.6);
    }
    .admin-table input[type="number"] {
      background:#020617;
      border:1px solid #334155;
      border-radius:999px;
      padding:4px 8px;
      font-size:0.8rem;
      color:#e5e7eb;
      width:80px;
      text-align:right;
    }
    .admin-chip-ok {
      display:inline-flex;
      align-items:center;
      justify-content:center;
      border-radius:999px;
      padding:0 8px;
      font-size:0.7rem;
      background:#022c22;
      color:#6ee7b7;
    }
    .admin-chip-miss {
      display:inline-flex;
      align-items:center;
      justify-content:center;
      border-radius:999px;
      padding:0 8px;
      font-size:0.7rem;
      background:#2f1b1b;
      color:#fecaca;
    }
    .admin-actions {
      display:flex;
      gap:6px;
      justify-content:flex-start;
    }

.global-log-footer {
  position: fixed;
  bottom: 12px;
  right: 24px;
  z-index: 1000;
  pointer-events: auto;
}

.global-log-footer .chip {
  cursor: pointer;
}
/* Admin Metrics Dashboard */

.risk-user-cell {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.admin-shell {
      max-width: 960px;
      margin: 40px auto;
    }
    .admin-header {
      display:flex;
      justify-content:space-between;
      align-items:center;
      margin-bottom:18px;
    }
    .admin-title {
      font-size:1.3rem;
      font-weight:600;
    }
    .admin-subtitle {
      margin-top:4px;
      font-size:0.8rem;
      opacity:0.75;
    }
    .admin-nav {
      display:flex;
      gap:8px;
      align-items:center;
    }
    .admin-metrics-grid {
      margin-top:4px;
      margin-bottom:18px;
    }
    .admin-metrics-table-card {
      background:#020617;
      border-radius:16px;
      border:1px solid #1f2937;
      padding:16px 18px;
    }
    .admin-metrics-table-card h2 {
      margin:0 0 8px;
      font-size:0.95rem;
      font-weight:500;
    }
    .admin-table {
      width:100%;
      border-collapse:collapse;
      margin-top:10px;
      font-size:0.85rem;
    }
    .admin-table th,
    .admin-table td {
      padding:6px 8px;
    }
    .admin-table thead {
      color:#9ca3af;
      font-weight:500;
      border-bottom:1px solid #1f2937;
    }
    .admin-table tbody tr:nth-child(even) {
      background:rgba(15,23,42,0.6);
    }
    .admin-table td.num {
      text-align:right;
    }
    .risk-pill {
      display:inline-flex;
      align-items:center;
      justify-content:center;
      border-radius:999px;
      padding:2px 8px;
      font-size:0.7rem;
      gap:4px;
    }
    .risk-pill span.dot {
      width:7px;
      height:7px;
      border-radius:999px;
      display:inline-block;
    }
    .risk-pill.green {
      background:#022c22;
      color:#6ee7b7;
    }
    .risk-pill.green span.dot {
      background:#22c55e;
    }
    .risk-pill.amber {
      background:#451a03;
      color:#fed7aa;
    }
    .risk-pill.amber span.dot {
      background:#f59e0b;
    }
    .risk-pill.red {
      background:#2f1b1b;
      color:#fecaca;
    }
    .risk-pill.red span.dot {
      background:#ef4444;
    }
    .risk-pill.mixed {
      background:#020617;
      color:#e5e7eb;
      border:1px solid #374151;
    }
    .risk-pill.mixed span.dot {
      background:linear-gradient(90deg,#22c55e,#f59e0b,#ef4444);
    }
    .metrics-caption {
      font-size:0.75rem;
      opacity:0.7;
      margin-top:4px;
    }
/* Stack on small screens */
.char-counter{
    margin-top:4px;
    font-size:12px;
    color:#64748b;
    display:flex;
    justify-content:flex-end;
    gap:4px;
  }
  .char-counter .limit{
    opacity:0.7;
  }

  /* Make the rewrite block wrap properly */
  .compliant-text{
    white-space:pre-wrap;
    word-wrap:break-word;
  }

  /* Header strip: status dot + text + chip */
.result-status{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.result-status-left{
  display:flex;
  gap:8px;
  align-items:flex-start;
}
.result-status-right .chip{
  font-size:11px;
  padding:4px 8px;
}

/* Tighter, calmer buttons inside admin user table only */
.admin-table .btn-small {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.1;
  background: transparent;
  border-color: rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  box-shadow: none;
  min-width: 68px;
  text-align: center;
}

.admin-table .btn-small-solid {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  color: #020617;
  border-color: var(--accent);
}

/* Space between Toggle Q / Save */
.admin-table .btn-small + .btn-small {
  margin-left: 4px;
}


/* Admin feedback table layout */

.nav-pill {
  min-width: 18px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--accent);
  color: #020617;  
box-shadow:
  0 0 0 1px rgba(0, 255, 204, 0.6),
  0 0 10px rgba(0, 255, 204, 0.5);
}

.link-like-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #0052cc;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.link-like-button:hover {
  text-decoration: none;
}
.modal-pre {
  white-space: pre-wrap;
  font-family: inherit;
}
.modal-section {
  margin-bottom: 12px;
}
.modal-label {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}

.feedback-thumb-btn {
      border: none;
      padding: 0;
      background: transparent;
      cursor: pointer;
    }
    .feedback-thumb-img {
      max-width: 90px;
      max-height: 70px;
      border-radius: 6px;
      border: 1px solid rgba(148,163,184,0.5);
      display: block;
    }
    .feedback-thumb-helper {
      margin-top: 2px;
      font-size: 0.7rem;
      opacity: 0.7;
      text-align: left;
    }
    .modal.modal--image {
      width: min(960px, 100%);
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .modal.modal--image .modal-body {
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .modal-image {
      max-width: 100%;
      max-height: 80vh;
      border-radius: 12px;
      border: 1px solid rgba(55,65,81,0.9);
    }

.feedback-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin:8px 0 4px;
}

.feedback-filter-buttons {
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.feedback-filter {
  cursor:pointer;
}

.feedback-filter--active {
  background:rgba(15,23,42,0.9);
}

.feedback-count {
  font-size:0.8rem;
  opacity:0.75;
  white-space:nowrap;
}

.feedback-table .feedback-message-cell {
  max-width:360px;
  font-size:0.8rem;
  color:#e5e7eb;
  white-space:normal;
}

.feedback-table .feedback-context-cell {
  font-size:0.78rem;
  color:var(--text-muted);
  max-width:220px;
}

.feedback-user-meta {
  font-size:0.75rem;
  color:var(--text-muted);
}

/* Status pills */

.feedback-status-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:2px 8px;
  font-size:0.72rem;
  border:1px solid rgba(148,163,184,0.7);
}

.feedback-status-open {
  background:#451a03;
  color:#fed7aa;
  border-color:#f59e0b;
}

.feedback-status-handled,
.feedback-status-closed {
  background:#022c22;
  color:#6ee7b7;
  border-color:#22c55e;
}

.feedback-handle-cell .btn-small {
  font-size:0.75rem;
  padding:4px 10px;
  border-radius:999px;
}


/* Admin users table: keep the actions compact and aligned */
/* Admin users table: compact actions without blowing out the layout */
.admin-actions-cell {
  padding: 4px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  min-width: 0;            /* ← allow the column to shrink with the card */
}

.admin-actions-cell .btn-small {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.1;
  background: transparent;
  border-color: rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  box-shadow: none;
  min-width: 68px;
  text-align: center;
}

.admin-actions-cell .btn-small-solid {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  color: #020617;
  border-color: var(--accent);
}

/* keep big tables inside the cards */
.admin-card {
  overflow-x: auto;
}

.admin-actions-cell .btn-small + .btn-small {
  margin-left: 4px;
}
@media (max-width: 900px) {
  .admin-actions-cell {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .simple-card {
    padding: 16px 14px 18px;
  }

  .gov-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* RESPONSIVE – PHONE WIDTH */

@media (max-width: 640px) {
  body {
    padding: 20px 14px 32px;
  }

  .card[aria-label="Ask Civitas workspace"] {
    padding: 16px 14px 18px;
  }

  .brand-title {
    font-size: 1.4rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-right {
    justify-content: flex-start;
  }

  .welcome-tile {
    margin-top: -16px;
    max-width: 100%;
  }

  .helper-text {
    margin-top: 24px;
  }

  .card .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .card .actions-row .hint {
    max-width: 100%;
  }

  .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .results-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .toast {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

/* RESPONSIVE – TABLET ACTION STRIP STACK */

@media (max-width: 768px) {
  .card .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .card .actions-row .hint {
    max-width: 100%;
  }

  .card .actions-row .btn-primary {
    width: 100%;
    justify-content: center;
  }


  /* Keep big tables inside the admin cards instead of overflowing */
.admin-card {
  overflow-x: auto;
}

/* Let the admin table shrink instead of blowing out with wide columns */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed; /* important: prevents one wide column from expanding the card */
}

/* Admin users table: compact actions without blowing out layout */
.admin-actions-cell {
  padding: 4px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  min-width: 0; /* override any earlier min-width */
}

.admin-actions-cell .btn-small {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.1;
  background: transparent;
  border-color: rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  box-shadow: none;
  min-width: 68px;
  text-align: center;
}

.admin-actions-cell .btn-small-solid {
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  color: #020617;
  border-color: var(--accent);
}
}

/* PRAXIS – page shell */
    body.praxis-page {
      background: radial-gradient(circle at top, #020617 0, #000 60%);
      color: var(--text-main);
      display: flex;
      justify-content: center;
      padding: 32px 24px 48px;
    }
    .praxis-shell {
      width: 100%;
      max-width: 880px;
    }

    /* Header */
    .praxis-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 18px;
    }
    .praxis-brand {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .praxis-logo {
      width: 32px;
      height: 32px;
      border-radius: 12px;
      background: conic-gradient(from 210deg at 60% 40%, var(--accent), var(--accent-soft));
      box-shadow: 0 10px 26px rgba(0,255,204,0.45);
    }
    .praxis-title-block h1 {
      margin: 0;
      font-size: 1.4rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .praxis-title-block .subtitle {
      margin-top: 2px;
      font-size: 0.85rem;
      color: var(--text-muted);
    }

    /* Buttons */
    .praxis-btn,
    .praxis-btn-primary {
      border-radius: var(--radius-pill);
      font-size: 0.82rem;
      padding: 7px 14px;
      border: 1px solid #334155;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .praxis-btn {
      background: rgba(15,23,42,0.95);
      color: #e5e7eb;
    }
    .praxis-btn:hover {
      border-color: var(--accent);
      background: rgba(15,23,42,1);
    }
    .praxis-btn-primary {
      border-color: transparent;
      background: linear-gradient(90deg, var(--accent), var(--accent-soft));
      color: #020617;
      box-shadow: 0 0 18px rgba(0,255,204,0.35);
      font-weight: 600;
    }
    .praxis-btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 0 24px rgba(0,255,204,0.5);
    }
    .praxis-btn-primary:disabled {
      opacity: 0.65;
      cursor: wait;
      box-shadow: none;
    }

    /* Card */
    .praxis-card {
      background:
        radial-gradient(circle at top left, rgba(0,255,204,0.16), transparent 65%),
        rgba(2,6,23,0.98);
      border-radius: var(--radius-lg);
      border: 1px solid rgba(148,163,184,0.35);
      padding: 18px 18px 16px;
      box-shadow:
        0 24px 60px rgba(2,6,23,0.9),
        0 0 0 1px rgba(15,23,42,0.9);
    }
    .praxis-card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }
    .praxis-industry-block label {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      display: block;
      margin-bottom: 4px;
    }
    .praxis-industry-block select {
      width: 190px;
      border-radius: 999px;
      padding: 6px 10px;
      border: 1px solid #334155;
      background: #020617;
      color: #e5e7eb;
      font-size: 0.85rem;
    }

    /* Entry row */
    .praxis-entry {
      position: relative;
      border-radius: 14px;
      border: 1px dashed rgba(148,163,184,0.6);
      background:
        radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(15,23,42,1));
      padding: 12px 12px 10px;
      margin-top: 10px;
      transition: border-color 140ms ease-out, box-shadow 140ms ease-out, transform 140ms ease-out;
    }
    .praxis-entry:hover {
      border-color: rgba(0,255,204,0.6);
      box-shadow: 0 0 0 1px rgba(0,255,204,0.2);
      transform: translateY(-1px);
    }
    .praxis-entry-remove {
      position: absolute;
      top: 8px;
      right: 8px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.8rem;
      padding: 2px 6px;
      border-radius: 999px;
      cursor: pointer;
    }
    .praxis-entry-remove:hover {
      background: rgba(15,23,42,0.9);
    }

    /* Grid */
    .praxis-grid {
      display: grid;
      gap: 8px;
    }
    .praxis-grid.two {
      grid-template-columns: minmax(0,1.5fr) minmax(0,1.5fr);
    }
    @media (max-width: 720px) {
      .praxis-grid.two {
        grid-template-columns: minmax(0,1fr);
      }
    }

    /* Form controls */
    .praxis-entry label {
      display: block;
      font-size: 0.82rem;
      margin-bottom: 4px;
      color: #e5e7eb;
    }
    .praxis-entry input[type="text"],
    .praxis-entry input[type="url"],
    .praxis-entry select {
      width: 100%;
      font-size: 0.85rem;
      padding: 6px 9px;
      border-radius: 8px;
      border: 1px solid #1f2937;
      background: #020617;
      color: #e5e7eb;
      outline: none;
    }
    .praxis-entry input:focus,
    .praxis-entry select:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px rgba(0,255,204,0.35);
    }

    /* Dropzone */
    .praxis-drop {
      margin-top: 2px;
      border-radius: 10px;
      border: 1px dashed rgba(148,163,184,0.7);
      padding: 10px 10px;
      font-size: 0.8rem;
      text-align: center;
      color: var(--text-muted);
      background:
        repeating-linear-gradient(-45deg,
          rgba(15,23,42,0.9) 0,
          rgba(15,23,42,0.9) 8px,
          rgba(15,23,42,0.75) 8px,
          rgba(15,23,42,0.75) 16px);
      cursor: pointer;
      transition: border-color 140ms ease-out, background 140ms ease-out, transform 120ms ease-out;
    }
    .praxis-drop.drag {
      border-color: var(--accent);
      background: rgba(15,23,42,0.9);
      transform: scale(1.01);
    }
    .filelist {
      margin-top: 6px;
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      justify-content: center;
    }
    .chip {
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid rgba(148,163,184,0.7);
      font-size: 0.75rem;
      background: #020617;
      color: #e5e7eb;
    }

    /* Actions + progress */
    .praxis-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 14px;
    }
    .praxis-actions .spacer {
      flex: 1;
    }

    .praxis-progress {
      height: 8px;
      background: #020617;
      border-radius: 999px;
      overflow: hidden;
      margin-top: 10px;
    }
    .praxis-bar {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--accent), var(--accent-soft));
      transition: width 360ms ease-out;
    }
    .praxis-status {
      margin-top: 6px;
      font-size: 0.8rem;
      color: var(--text-muted);
      min-height: 1em;
    }

    @media (max-width: 640px) {
      .praxis-header {
        flex-direction: column;
        align-items: flex-start;
      }
      .praxis-actions {
        flex-direction: column;
        align-items: stretch;
      }
      .praxis-btn-primary {
        justify-content: center;
        width: 100%;
      }
    }

    .overlaps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlap-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.overlap-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 2px 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f7f7fb;
  cursor: pointer;
}

.overlap-tag:hover {
  background: #f0f0ff;
}

.overlap-snippet {
  font-size: 0.8rem;
  line-height: 1.3;
  opacity: 0.9;
}

.overlap-row-empty {
  font-size: 0.8rem;
  opacity: 0.7;
}

.doc-check {
  margin-top: 1.5rem;
}
.doc-check-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.doc-file-input {
  max-width: 260px;
}
.doc-result {
  background: #0f172a;
  color: #e5e7eb;
  padding: 0.75rem;
  border-radius: 6px;
  max-height: 260px;
  overflow: auto;
  font-size: 0.8rem;
}
.doc-status {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Lease & Dispute bespoke layout */

.lease-page .lease-card {
  background:
    radial-gradient(circle at top left, rgba(0,255,204,0.1), transparent 60%),
    rgba(2,6,23,0.98);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148,163,184,0.32);
  padding: 18px 20px 20px;
  box-shadow:
    0 24px 60px rgba(2,6,23,0.9),
    0 0 0 1px rgba(15,23,42,0.9);
}

/* Shared grid for form + results */

.lease-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lease-form-main {
  width: 100%;
}

.lease-text-input,
.lease-select {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #020617;
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 6px 10px;
}

.lease-text-input::placeholder {
  color: var(--text-muted);
}

.lease-text-input:focus,
.lease-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0,255,204,0.35);
}

/* Align inputs on one row but wrap nicely */

.lease-form-main .doc-check-row {
  flex-wrap: wrap;
}

.lease-form-main .doc-file-input {
  flex: 1 1 180px;
  min-width: 160px;
}

.lease-text-input {
  flex: 1 1 180px;
  min-width: 160px;
}

.lease-select {
  flex: 0 0 120px;
}

/* Meta / issues */

.lease-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.lease-result-section {
  background: rgba(15,23,42,0.9);
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.9);
  padding: 10px 11px;
}

.lease-meta-list,
.lease-issues-list {
  margin: 4px 0 0;
  padding-left: 16px;
  font-size: 0.82rem;
  color: rgba(229,231,235,0.95);
}

.lease-meta-list li + li,
.lease-issues-list li + li {
  margin-top: 4px;
}

/* Dispute small layout tweaks */

.dispute-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 4px;
  align-items: flex-end;
  justify-content: flex-start;
}

.dispute-meta-left,
.dispute-meta-right {
  flex: 1 1 160px;
}

/* Risk-level chip colours for disputes */

.chip-risk-green {
  background: rgba(22,163,74,0.18);
  color: #bbf7d0;
  border-color: #16a34a;
}

.chip-risk-amber {
  background: rgba(250,204,21,0.18);
  color: #fef3c7;
  border-color: #eab308;
}

.chip-risk-red {
  background: rgba(248,113,113,0.18);
  color: #fee2e2;
  border-color: #ef4444;
}

@media (max-width: 720px) {
  .lease-result-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ========== Lease decision brief ========== */

.decision-meta {
  position: relative;
  max-width: 1040px;
  margin: 26px auto 40px;
  padding: 18px 20px 18px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.6);
  background:
    radial-gradient(120% 200% at 0% 0%, rgba(45,212,191,0.20), transparent 60%),
    radial-gradient(140% 220% at 100% 0%, rgba(56,189,248,0.22), transparent 60%),
    rgba(15,23,42,0.96);
  box-shadow:
    0 22px 55px rgba(15,23,42,0.9),
    0 0 0 1px rgba(15,23,42,0.8) inset;
  color: #e5e7eb;
  opacity: 0;
  transform: translateY(6px);
  animation: decisionMetaIn 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}


/* verdict glow strip at the top edge */

.decision-meta::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border-top: 2px solid transparent;
  background:
    linear-gradient(90deg, rgba(34,197,94,0.0), rgba(34,197,94,0.9), rgba(34,197,94,0.0))
      border-box;
  opacity: 0.65;
}

/* override glow colour by verdict */

.decision-meta[data-verdict="green"]::before {
  background:
    linear-gradient(90deg, rgba(16,185,129,0.0), rgba(16,185,129,1), rgba(16,185,129,0.0))
      border-box;
}

.decision-meta[data-verdict="amber"]::before {
  background:
    linear-gradient(90deg, rgba(245,158,11,0.0), rgba(245,158,11,1), rgba(245,158,11,0.0))
      border-box;
}

.decision-meta[data-verdict="red"]::before {
  background:
    linear-gradient(90deg, rgba(239,68,68,0.0), rgba(239,68,68,1), rgba(239,68,68,0.0))
      border-box;
}

/* top layout */

.decision-meta__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.decision-meta__title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.decision-meta__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9ca3af;
  opacity: 0.9;
}

.decision-meta__headline {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.decision-meta__summary {
  margin: 2px 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #d1d5db;
}

/* verdict badge on the right */

.decision-meta__badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  background: radial-gradient(circle at 0 0, rgba(236,72,153,0.25), transparent 60%),
              rgba(15,23,42,0.9);
  min-width: 140px;
}

.decision-meta__badge-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
}

.decision-meta__badge-value {
  font-size: 0.9rem;
  font-weight: 600;
}

/* metrics row */

.decision-meta .meta-row,
.decision-meta__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  margin-top: 18px;
}

.decision-meta .meta-item {
  padding: 9px 11px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(51,65,85,0.95);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.decision-meta .meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
}

.decision-meta .meta-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f9fafb;
}

/* risk flags + notes */

.meta-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(31,41,55,0.9);
}

#leaseRiskFlags {
  list-style: none;
  margin: 9px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

#leaseRiskFlags li {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.7);
  font-size: 0.8rem;
  white-space: nowrap;
}

#leaseNotesOnHerald {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15,23,42,0.94);
  border: 1px solid rgba(55,65,81,0.9);
  font-size: 0.86rem;
  line-height: 1.6;
  color: #e5e7eb;
}

/* entrance anim */

@keyframes decisionMetaIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* responsive */

@media (max-width: 900px) {
  .decision-meta {
    padding: 16px 15px 16px;
    margin-top: 20px;
  }
  .decision-meta__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .decision-meta__badge {
    align-items: flex-start;
  }
  .decision-meta .meta-row,
  .decision-meta__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #leaseRiskFlags li {
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .decision-meta .meta-row,
  .decision-meta__metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Dispute “stepped” layout polish --- */

.dispute-step-header {
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin:16px 0 8px;
}

.dispute-step-kicker {
  font-size:0.7rem;
  text-transform:uppercase;
  letter-spacing:0.12em;
  opacity:0.7;
  padding-top:2px;
}

.dispute-step-title {
  font-weight:600;
  font-size:0.95rem;
}

.dispute-step-subtitle {
  font-size:0.8rem;
  opacity:0.75;
}

.field-hint {
  margin-top:4px;
  font-size:0.75rem;
  color:var(--text-muted);
}

.dispute-inline-lease-toggle {
  margin-top:10px;
}

.btn-ghost--subtle {
  font-size:0.8rem;
  padding-inline:0;
  border-color:transparent;
}

.btn-ghost--subtle:hover {
  border-color:var(--accent);
}

.dispute-inline-lease-fields {
  margin-top:8px;
}

.dispute-inline-lease-card {
  border-radius:12px;
  padding:12px 14px;
  border:1px solid rgba(148,163,184,0.35);
  background:rgba(15,23,42,0.96);
}

.dispute-inline-lease-header {
  margin-bottom:8px;
}

.dispute-inline-lease-title {
  font-weight:500;
  font-size:0.9rem;
}

.dispute-inline-lease-subtitle {
  font-size:0.75rem;
  opacity:0.75;
}

/* =========================
   CIVITAS TOOLTIP SYSTEM — FINAL
   ========================= */

/* The wrapper NEVER clips */
.civitas-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  overflow: visible !important;
}

/* The tooltip itself */
.civitas-tooltip {
  position: fixed; /* ✅ ESCAPES ALL CONTAINERS */
  left: 0;
  top: 0;

  transform: translate3d(-9999px, -9999px, 0); /* parked offscreen by default */

  background: #0f141b;
  color: #e6ebf3;

  font-size: 12px;
  line-height: 1.45;
  padding: 8px 12px;
  letter-spacing: 0.01em;

  border-radius: 9px;

  border: 1px solid rgba(255,255,255,0.12);

  box-shadow:
    0 4px 10px rgba(0,0,0,0.35),
    0 14px 30px rgba(0,0,0,0.55);

  white-space: nowrap;
  pointer-events: none;

  opacity: 0;

  transition:
    opacity 0.14s ease,
    transform 0.14s cubic-bezier(.2,.8,.2,1);

  z-index: 999999; /* ✅ cannot be beaten */
}

.civitas-tooltip-wrapper:hover .civitas-tooltip {
  opacity: 1;
}

.civitas-tooltip-wrapper:hover .civitas-tooltip {
  transition-delay: 0.05s;
}

