@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/*
  Terra Vita Hub v169 — UI Governance Shell Pass
  Scope: typography tokens, governed colour tokens, CTA classes, module shell, logout visibility.
  This layer is deliberately presentation-only: no auth rules, Supabase policies, SQL, server APIs,
  or protected business logic are changed here.
*/

:root {
  --tvh-font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --tvh-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --tvh-green: #163D2D;
  --tvh-green-deep: #0E2F24;
  --tvh-sage: #DCE8D8;
  --tvh-bg: #F6F1E7;
  --tvh-ivory: #FBF8F0;
  --tvh-surface: #FFFFFF;
  --tvh-teal: #0F766E;
  --tvh-blue: #256F8F;
  --tvh-warning: #B7791F;
  --tvh-risk: #B42318;
  --tvh-approved: #1F7A4D;
  --tvh-ink: #17211B;
  --tvh-muted: #647064;
  --tvh-border: #DDD6C8;
  --tvh-shadow: 0 16px 36px rgba(23, 33, 27, 0.08);
  --tvh-radius-sm: 12px;
  --tvh-radius-md: 18px;
  --tvh-radius-lg: 26px;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--tvh-font-sans) !important;
}

code,
pre,
kbd,
samp,
.mono,
.code,
.audit,
.audit-log,
.metric-code,
.reference-code,
.record-id,
[data-code],
[class*="code"],
[class*="audit"],
[class*="metric"],
[class*="record-id"] {
  font-family: var(--tvh-font-mono) !important;
}

body.tvh-ui-governed {
  background: var(--tvh-bg);
  color: var(--tvh-ink);
}

.tvh-ui-governance-shell,
.tvh-ui-governance-shell * {
  box-sizing: border-box;
}

.tvh-ui-governance-shell {
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--tvh-border);
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,241,231,.96));
  color: var(--tvh-ink);
  box-shadow: 0 10px 28px rgba(23, 33, 27, 0.08);
  backdrop-filter: blur(14px);
}

.tvh-ui-governance-shell .tvh-ui-brand {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  gap: 2px;
}

.tvh-ui-governance-shell .tvh-ui-brand strong {
  font-size: 15px;
  letter-spacing: .01em;
  font-weight: 800;
  color: var(--tvh-green-deep);
}

.tvh-ui-governance-shell .tvh-ui-brand span {
  font-size: 12px;
  color: var(--tvh-muted);
  font-weight: 700;
}

.tvh-ui-governance-shell .tvh-ui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.tvh-ui-btn,
a.tvh-ui-btn,
button.tvh-ui-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--tvh-border);
  background: var(--tvh-surface);
  color: var(--tvh-ink);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 33, 27, 0.05);
}

.tvh-ui-btn:hover,
a.tvh-ui-btn:hover,
button.tvh-ui-btn:hover {
  border-color: rgba(15, 118, 110, .38);
  background: var(--tvh-ivory);
  color: var(--tvh-green-deep);
}

.tvh-ui-btn-primary {
  background: var(--tvh-green);
  border-color: var(--tvh-green);
  color: var(--tvh-surface);
}

.tvh-ui-btn-primary:hover {
  background: var(--tvh-green-deep);
  color: var(--tvh-surface);
}

.tvh-ui-btn-danger {
  color: var(--tvh-risk);
  border-color: rgba(180, 35, 24, .24);
}

body.tvh-ui-governed .btn,
body.tvh-ui-governed .button,
body.tvh-ui-governed button:not(.tvh-ui-btn),
body.tvh-ui-governed input[type="submit"] {
  border-radius: var(--tvh-radius-sm);
}

body.tvh-ui-governed .card,
body.tvh-ui-governed .panel,
body.tvh-ui-governed .surface,
body.tvh-ui-governed .shell,
body.tvh-ui-governed .boot-card {
  border-color: var(--tvh-border);
}

body.tvh-ui-governed .badge,
body.tvh-ui-governed .pill,
body.tvh-ui-governed .tag,
body.tvh-ui-governed .status {
  border-radius: 999px;
}

body.tvh-ui-governed .status-approved,
body.tvh-ui-governed .approved,
body.tvh-ui-governed .connected,
body.tvh-ui-governed .success {
  color: var(--tvh-approved);
}

body.tvh-ui-governed .status-warning,
body.tvh-ui-governed .warning,
body.tvh-ui-governed .pending,
body.tvh-ui-governed .eligible {
  color: var(--tvh-warning);
}

body.tvh-ui-governed .status-risk,
body.tvh-ui-governed .risk,
body.tvh-ui-governed .blocked,
body.tvh-ui-governed .danger {
  color: var(--tvh-risk);
}

.tvh-hidden-by-native-shell {
  display: none !important;
}

@media (max-width: 860px) {
  .tvh-ui-governance-shell {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .tvh-ui-governance-shell .tvh-ui-actions {
    justify-content: flex-start;
  }
}

/* v169 institutional reviewer route + diligence question layer */
.tvh-reviewer-route-panel{margin-top:18px;padding:20px;border-radius:var(--tvh-radius-lg);background:linear-gradient(180deg,var(--tvh-surface),var(--tvh-ivory));border:1px solid var(--tvh-border);box-shadow:var(--tvh-shadow)}
.tvh-reviewer-route-kicker{font-family:var(--tvh-font-mono);font-size:.76rem;letter-spacing:.12em;text-transform:uppercase;color:var(--tvh-teal);font-weight:800;margin-bottom:8px}
.tvh-reviewer-route-panel h2,.tvh-reviewer-route-panel h3{margin-top:0;color:var(--tvh-green-deep)}
.tvh-reviewer-route-panel p{color:var(--tvh-ink);line-height:1.6}
.tvh-reviewer-route-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:16px 0 0;padding:0;list-style:none;counter-reset:tvhroute}
.tvh-reviewer-route-list li{counter-increment:tvhroute;position:relative;padding:16px 16px 16px 52px;border-radius:18px;background:rgba(15,118,110,.055);border:1px solid rgba(15,118,110,.16);min-height:112px}
.tvh-reviewer-route-list li:before{content:counter(tvhroute);position:absolute;left:16px;top:16px;width:24px;height:24px;border-radius:999px;background:var(--tvh-green);color:var(--tvh-surface);display:grid;place-items:center;font-family:var(--tvh-font-mono);font-size:.82rem;font-weight:800}
.tvh-reviewer-route-list strong{display:block;color:var(--tvh-green-deep);margin-bottom:6px}
.tvh-reviewer-route-list span{display:block;color:var(--tvh-muted);line-height:1.45}
.tvh-reviewer-question-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px;margin-top:18px}
.tvh-reviewer-question-card{padding:18px;border-radius:20px;background:var(--tvh-surface);border:1px solid var(--tvh-border);box-shadow:0 10px 24px rgba(23,33,27,.045)}
.tvh-reviewer-question-card h3{margin:0 0 8px;color:var(--tvh-teal)}
.tvh-reviewer-question-card ul{margin:10px 0 0;padding-left:20px;color:var(--tvh-ink);line-height:1.55}
.tvh-reviewer-question-card li{margin:6px 0}
.tvh-reviewer-note{margin-top:14px;padding:14px 16px;border-radius:16px;background:rgba(183,121,31,.08);border:1px solid rgba(183,121,31,.22);color:var(--tvh-ink)}
.tvh-cta-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px;align-items:center}
@media(max-width:720px){.tvh-reviewer-route-list{grid-template-columns:1fr}.tvh-reviewer-question-grid{grid-template-columns:1fr}.tvh-cta-row{display:grid;grid-template-columns:1fr}.tvh-cta-row .btn,.tvh-cta-row .cta-tertiary{width:100%;justify-content:center;text-align:center}}

