/* static/css/style.css */
/* =========================================================
   GrassRootsAI – Sovereign Web Chat (CLASSIC RESTORE)
   Layout: Left Stats | Center Chat | Right Modes
   ========================================================= */

/* ===================== RESET ===================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { height: 100%; }

body {
  font-family: Arial, sans-serif;
  background: #6f6bd8; /* purple frame */
  color: #222;
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* no whole-page scrollbar */
  padding: 14px;
}

/* ===================== HEADER ===================== */
.header {
  background: #58a84f;
  color: white;
  text-align: center;
  padding: 26px 16px;
  flex: 0 0 auto;
}

.header-text {
  font-size: 2rem;
  font-weight: bold;
  display: none; /* controlled below */
}

.header-logo {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: none; /* controlled below */
}

/* ===================== MOBILE TABS ===================== */
.mobile-tabs {
  display: none;
  gap: 10px;
  padding: 10px;
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  flex: 0 0 auto;
}

/* ===================== MAIN LAYOUT ===================== */
.main-layout {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  border-radius: 18px;
}

/* ===================== SIDEBAR SAFETY ===================== */
.sidebar,
.left-sidebar,
.right-sidebar {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  flex: 0 0 auto;
  min-height: 0;
  z-index: auto;
}

/* ===================== LEFT SIDEBAR ===================== */
.left-sidebar {
  width: 260px;
  border-right: 2px solid #2f73ff;
  padding: 18px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.55)),
    url("../images/7c.jpg") center / cover no-repeat;
  color: #f1f1f1;
  height: 100%;
}

.left-sidebar h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.left-sidebar .status-panel { background: rgba(0,0,0,0.45); }

.status-panel {
  background: white;
  border: 2px solid #2f73ff;
  border-radius: 12px;
  padding: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

/* ===================== CENTER CHAT ===================== */
.main-chat,
#panel-chat {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: #ebe8de;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  height: 100%;
}

.chat-output,
#chat-box {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 110px; /* keep last msg above input bar */
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.chat-message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
}

.chat-message.ai {
  white-space: pre-wrap;
  background: white;
  align-self: flex-start;
  border: 1px solid #ddd;
}

.chat-message.user {
  background: #dfefff;
  align-self: flex-end;
  border: 1px solid #b5d4ff;
}

/* ===================== PHASE 5.9 GOVERNANCE RECEIPT ===================== */

.governance-receipt {
  align-self: flex-start;
  max-width: 75%;
  margin-top: -6px;
  margin-bottom: 8px;
  padding: 9px 13px;
  border: 1px solid #d9d5ff;
  border-left: 4px solid #6f6bd8;
  border-radius: 10px;
  background: rgba(239, 237, 255, 0.92);
  color: #413c9b;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(111, 107, 216, 0.12);
}

.governance-receipt strong {
  font-family: Arial, sans-serif;
  letter-spacing: 0.04em;
}

.governance-receipt.permit {
  border-left-color: #39a35a;
  background: #f3fbf5;
  color: #1e6b3a;
}

.governance-receipt.hold {
  border-left-color: #d14b4b;
  background: #fff6f6;
  color: #9b2929;
}

/* ===================== INPUT BAR ===================== */
.input-bar {
  background: #58a84f;
  padding: 14px;
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.18);
}

.input-container {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.input-bar input {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  min-width: 0;
}

.input-bar button {
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  background: #3e8e41;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.input-bar button:hover { filter: brightness(0.95); }

/* ===================== RIGHT SIDEBAR ===================== */
.right-sidebar {
  width: 280px;
  border-left: 2px solid #cfd8b6;
  padding: 18px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.55)),
    url("../images/7b.jpg") center / cover no-repeat;
  color: #f1f1f1;
  height: 100%;
}

.right-sidebar h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.right-sidebar .status-panel { background: rgba(0,0,0,0.45); }

/* ===================== MODE BUTTONS ===================== */
.mode-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
  font-weight: bold;
}

.mode-btn.active {
  background: #58a84f;
  color: white;
  border-color: #3e8e41;
}

/* ===================== ANABELLE IMAGE ===================== */
.sidebar-filler-img,
.anabelle-image img {
  width: 100%;
  border-radius: 8px;
  margin-top: 12px;
}

/* ===================== HIDE OLD SLIDERS ===================== */
#temperature,
#verbosity,
#response-speed,
#temp-value,
#verbosity-value,
#speed-value {
  display: none !important;
}

/* ===================== AGE MODAL ===================== */
#age-verification-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#age-verification-modal.hidden {
  display: none;
  pointer-events: none;
}

.age-modal-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 420px;
  text-align: center;
}

.age-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.age-btn {
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: bold;
  border: none;
  cursor: pointer;
}

#confirm-18 {
  background: #58a84f;
  color: white;
}

#under-18 {
  background: #f44336;
  color: white;
}

/* ===================== AUTH UI ===================== */
.auth-input {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid #cfd8b6;
  font-size: 1rem;
}

.auth-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.auth-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #58a84f;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.auth-btn:hover { filter: brightness(0.95); }

.small-btn {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #2f73ff;
  background: #ffffff;
  cursor: pointer;
  font-weight: bold;
}

/* Auth status message */
.auth-msg {
  margin-top: 10px;
  font-size: 0.95rem;
}

/* ============ Mobile tabs layout ============ */
.tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: #fff;
  font-weight: bold;
  cursor: pointer;
}

.tab-btn.active {
  background: #58a84f;
  color: #fff;
  border-color: #3e8e41;
}

/* ===================== FIRST RUN HINT ===================== */
.first-run-hint {
  padding: 14px 16px;
  margin: 10px 0 14px 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.first-run-hint h2 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
}

.first-run-hint p { margin: 6px 0; }

/* ===================== MIC BUTTON ===================== */
.mic-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 10px;
  border: none;
  background: #3e8e41;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mic-btn:hover { filter: brightness(0.95); }

.mic-btn.listening {
  outline: 3px solid rgba(255, 255, 255, 0.65);
  filter: brightness(1.05);
}

.mic-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mic-status {
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.9);
  min-height: 1em;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .mobile-tabs { display: flex; }

  .main-layout {
    flex-direction: column;
    overflow: hidden;
  }

  #panel-stats, #panel-modes { display: none; }
  #panel-chat { display: flex; height: 100%; }

  body.show-stats #panel-chat,
  body.show-stats #panel-stats { display: block; height: 100%; }
  body.show-stats #panel-modes { display: none; }

  body.show-modes #panel-modes { display: block; height: 100%; }
  body.show-modes #panel-chat,
  body.show-modes #panel-stats { display: none; }

  body.show-chat #panel-chat { display: flex; height: 100%; }
  body.show-chat #panel-stats,
  body.show-chat #panel-modes { display: none; }

  .left-sidebar, .right-sidebar {
    width: 100%;
    max-height: none;
    border: none;
    height: 100%;
    overflow-y: auto;
  }

  .chat-output { padding: 14px; }
  .input-bar { padding: 12px; }
}

/* ===================== HEADER BANNER ===================== */
.header {
  width: 100%;
  height: 140px;

  background-image: url('/static/images/grailogo2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===================== MOBILE FIX ===================== */
@media (max-width: 900px) {
  .header {
    height: 100px;

    background-size: contain;     /* show full logo */
    background-position: center;
    background-color: #0f0f1a;    /* fills empty space cleanly */

    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Extra small screens */
@media (max-width: 600px) {
  .header {
    height: 80px;
  }
}

/* ===================== THINKING INDICATOR ===================== */
.thinking-indicator{
  position: sticky;
  bottom: 86px;               /* sits just above the input bar */
  margin: 0 20px 12px 20px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.12);
  align-self: flex-start;
  width: fit-content;
  font-weight: bold;
  font-size: 0.95rem;
  z-index: 9;
}

/* Animated dots */
.thinking-indicator .dots span{
  display: inline-block;
  width: 0.35em;
  text-align: center;
  animation: grDot 1.2s infinite;
  opacity: 0.2;
}

.thinking-indicator .dots span:nth-child(2){ animation-delay: 0.2s; }
.thinking-indicator .dots span:nth-child(3){ animation-delay: 0.4s; }

@keyframes grDot{
  0%, 80%, 100% { transform: translateY(0); opacity: 0.2; }
  40%          { transform: translateY(-2px); opacity: 1; }
}

/* ===================== ANABELLE'S EMOTIONAL WARMTH ENHANCEMENTS ===================== */
/* Light purple for Anabelle, Light green for user */

/* Enhanced Anabelle message appearance - LIGHT PURPLE */
.chat-message.ai {
    position: relative;
    border-left: 4px solid #b19cd9 !important;  /* Light purple */
    padding-left: 20px !important;
    margin: 14px 0 !important;
    animation: gentle-appear 0.6s ease-out !important;
    box-shadow: 0 2px 8px rgba(177, 156, 217, 0.15) !important;
    background: linear-gradient(to right, rgba(177, 156, 217, 0.05), rgba(255, 255, 255, 0.95)) !important;
}

/* Subtle breathing effect - light purple */
.chat-message.ai::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #b19cd9;  /* Light purple */
    border-radius: 50%;
    animation: gentle-pulse 3s infinite ease-in-out;
    opacity: 0.7;
}

/* Make each new message appear softly */
@keyframes gentle-appear {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Breathing pulse animation - light purple */
@keyframes gentle-pulse {
    0% { 
        opacity: 0.4; 
        transform: translateY(-50%) scale(0.9); 
        box-shadow: 0 0 0 0 rgba(177, 156, 217, 0.4);
    }
    50% { 
        opacity: 0.8; 
        transform: translateY(-50%) scale(1.1); 
        box-shadow: 0 0 0 6px rgba(177, 156, 217, 0);
    }
    100% { 
        opacity: 0.4; 
        transform: translateY(-50%) scale(0.9); 
        box-shadow: 0 0 0 0 rgba(177, 156, 217, 0.4);
    }
}

/* Enhanced thinking indicator with light purple */
.thinking-indicator {
    border-left: 3px solid #b19cd9 !important;  /* Light purple */
    background: rgba(177, 156, 217, 0.08) !important;
    animation: thinking-pulse 2s infinite !important;
}

@keyframes thinking-pulse {
    0%, 100% { background-color: rgba(177, 156, 217, 0.08); }
    50% { background-color: rgba(177, 156, 217, 0.15); }
}

/* Make dots blink with light purple */
.thinking-indicator .dots span {
    animation: emotional-blink 1.4s infinite !important;
    color: #b19cd9 !important;  /* Light purple */
}

.thinking-indicator .dots span:nth-child(2) {
    animation-delay: 0.3s !important;
}

.thinking-indicator .dots span:nth-child(3) {
    animation-delay: 0.6s !important;
}

@keyframes emotional-blink {
    0%, 100% { 
        opacity: 0.3; 
        transform: translateY(0);
    }
    25% { 
        opacity: 0.7; 
        transform: translateY(-1px);
    }
    50% { 
        opacity: 1; 
        transform: translateY(-2px);
        color: #9370db !important;  /* Slightly darker purple */
    }
    75% { 
        opacity: 0.7; 
        transform: translateY(-1px);
    }
}

/* User message - LIGHT GREEN */
.chat-message.user {
    border-right: 4px solid #90ee90 !important;  /* Light green */
    padding-right: 20px !important;
    margin: 14px 0 !important;
    background: linear-gradient(to left, rgba(144, 238, 144, 0.05), rgba(255, 255, 255, 0.95)) !important;
    animation: user-appear 0.5s ease-out !important;
}

/* User message animation */
@keyframes user-appear {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Optional: Add a subtle dot for user messages too */
.chat-message.user::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #90ee90;  /* Light green */
    border-radius: 50%;
    opacity: 0.5;
}
.fear-btn, .delta-btn {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  font-family: 'Cinzel Decorative', cursive;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  border: 2px solid transparent;
}

.fear-btn {
  background: #442222;
  color: #ffaaaa;
  border-color: #ff6b6b;
}

.fear-btn:hover {
  background: #ff6b6b;
  color: #442222;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

.delta-btn {
  background: #224422;
  color: #aaffaa;
  border-color: #6bff9d;
}

.delta-btn:hover {
  background: #6bff9d;
  color: #224422;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(107, 255, 157, 0.6);
}

.delta-btn.active {
  background: #6bff9d;
  color: #224422;
  box-shadow: 0 0 30px #6bff9d;
}

#user-input {
  min-height: 60px;
  max-height: 160px;
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  line-height: 1.4;
  border-radius: 8px;
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
}

/* =========================================================
GOVERNED AI EVIDENCE DEMONSTRATION
Scoped to governed_chat_demo.html only
========================================================= */

body.governed-demo-body {
display: block;
height: auto;
min-height: 100vh;
overflow-y: auto;
padding: 24px;
background:
radial-gradient(circle at top left, rgba(111, 107, 216, 0.45), transparent 34%),
linear-gradient(145deg, #101322, #1b2138 55%, #101322);
color: #172033;
}

.governed-demo-body .demo-page {
width: min(1500px, 100%);
margin: 0 auto;
}

.governed-demo-body .demo-header {
margin-bottom: 22px;
padding: 28px 32px;
border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 20px;
background: rgba(255, 255, 255, 0.96);
box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
}

.governed-demo-body .demo-eyebrow {
margin-bottom: 8px;
color: #615cc5;
font-size: 0.8rem;
font-weight: 800;
letter-spacing: 0.18em;
}

.governed-demo-body .demo-header h1 {
margin-bottom: 10px;
font-size: clamp(2rem, 4vw, 3.4rem);
line-height: 1.05;
}

.governed-demo-body .demo-subtitle {
max-width: 850px;
color: #505b70;
font-size: 1.08rem;
line-height: 1.6;
}

.governed-demo-body .demo-principle {
display: inline-block;
margin-top: 18px;
padding: 9px 14px;
border-radius: 999px;
background: #e9e7ff;
color: #413c9b;
font-weight: 800;
}

.governed-demo-body .demo-layout {
display: grid;
grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
gap: 22px;
align-items: stretch;
}

.governed-demo-body .demo-panel,
.governed-demo-body .evidence-timeline {
margin-bottom: 22px;
padding: 24px;
border: 1px solid rgba(255, 255, 255, 0.14);
border-radius: 20px;
background: rgba(255, 255, 255, 0.97);
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.governed-demo-body .panel-heading {
display: flex;
gap: 14px;
align-items: flex-start;
margin-bottom: 20px;
}

.governed-demo-body .panel-number {
display: inline-flex;
width: 38px;
height: 38px;
flex: 0 0 38px;
align-items: center;
justify-content: center;
border-radius: 50%;
background: #6f6bd8;
color: #fff;
font-size: 0.85rem;
font-weight: 800;
}

.governed-demo-body .panel-heading h2 {
margin-bottom: 4px;
font-size: 1.35rem;
}

.governed-demo-body .panel-heading p {
color: #687287;
line-height: 1.45;
}

.governed-demo-body .conversation-panel {
display: flex;
min-height: 690px;
flex-direction: column;
}

.governed-demo-body .conversation-area {
flex: 1 1 auto;
min-height: 390px;
max-height: 520px;
overflow-y: auto;
padding: 18px;
border: 1px solid #d9deea;
border-radius: 16px;
background: #f5f6fa;
}

.governed-demo-body .conversation-message {
width: fit-content;
max-width: 85%;
margin-bottom: 14px;
padding: 14px 16px;
border-radius: 14px;
line-height: 1.55;
}

.governed-demo-body .conversation-message.system-message {
border: 1px solid #d9d5ff;
background: #efedff;
}

.governed-demo-body .message-label {
margin-bottom: 6px;
color: #5a55b7;
font-size: 0.76rem;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}

.governed-demo-body .conversation-input-area {
margin-top: 18px;
}

.governed-demo-body .conversation-input-area label {
display: block;
margin-bottom: 8px;
font-weight: 800;
}

.governed-demo-body .conversation-input-area textarea {
width: 100%;
min-height: 112px;
padding: 14px;
border: 1px solid #cbd2df;
border-radius: 12px;
background: #fff;
color: #172033;
font: inherit;
line-height: 1.45;
resize: vertical;
}

.governed-demo-body button {
border: none;
border-radius: 11px;
background: #5e59c7;
color: #fff;
font: inherit;
font-weight: 800;
cursor: pointer;
transition:
transform 0.16s ease,
filter 0.16s ease,
box-shadow 0.16s ease;
}

.governed-demo-body button {
transform: translateY(-1px);
filter: brightness(1.05);
box-shadow: 0 8px 20px rgba(71, 66, 165, 0.25);
}

.governed-demo-body button {
outline: 3px solid rgba(111, 107, 216, 0.32);
outline-offset: 3px;
}

.governed-demo-body #sendPromptButton,
.governed-demo-body #captureDeclarationButton {
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
}

.governed-demo-body .status-card,
.governed-demo-body .receipt-card {
padding: 18px;
border: 1px solid #dce1eb;
border-radius: 16px;
background: #f8f9fc;
}

.governed-demo-body .status-card {
margin-bottom: 16px;
}

.governed-demo-body .card-heading {
display: flex;
gap: 12px;
align-items: center;
justify-content: space-between;
margin-bottom: 14px;
}

.governed-demo-body .status-badge {
padding: 6px 10px;
border-radius: 999px;
font-size: 0.78rem;
font-weight: 800;
}

.governed-demo-body .status-neutral {
background: #e8eaf0;
color: #4f596c;
}

.governed-demo-body .status-success {
background: #ddf6e5;
color: #1e6b3a;
}

.governed-demo-body .status-warning {
background: #fff0cf;
color: #8a5d00;
}

.governed-demo-body .status-error {
background: #ffe0e0;
color: #9b2929;
}

.governed-demo-body .status-list > div,
.governed-demo-body .receipt-details > div {
display: grid;
grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.2fr);
gap: 12px;
padding: 11px 0;
border-bottom: 1px solid #e3e6ed;
}

.governed-demo-body .status-list > div,
.governed-demo-body .receipt-details > div {
border-bottom: none;
}

.governed-demo-body dt {
color: #667085;
font-size: 0.9rem;
}

.governed-demo-body dd {
overflow-wrap: anywhere;
font-weight: 800;
}

.governed-demo-body .receipt-label,
.governed-demo-body .result-label,
.governed-demo-body .timeline-label {
margin-bottom: 8px;
color: #625dc8;
font-size: 0.76rem;
font-weight: 800;
letter-spacing: 0.11em;
text-transform: uppercase;
}

.governed-demo-body .receipt-card h3 {
margin-bottom: 12px;
font-size: 1.3rem;
}

.governed-demo-body .controls-grid {
display: grid;
grid-template-columns: repeat(4, minmax(170px, 1fr));
gap: 12px;
}

.governed-demo-body .controls-grid button {
min-height: 58px;
padding: 12px 14px;
}

.governed-demo-body .controls-grid .secondary-button {
border: 1px solid #bac1cf;
background: #fff;
color: #384052;
}

.governed-demo-body .result-card {
padding: 22px;
border: 1px solid #dce1eb;
border-left-width: 6px;
border-radius: 15px;
background: #f8f9fc;
}

.governed-demo-body .result-neutral {
border-left-color: #8a92a3;
}

.governed-demo-body .result-success {
border-left-color: #39a35a;
background: #f3fbf5;
}

.governed-demo-body .result-warning {
border-left-color: #dda91c;
background: #fffaf0;
}

.governed-demo-body .result-error {
border-left-color: #d14b4b;
background: #fff6f6;
}

.governed-demo-body .result-card h3 {
margin-bottom: 8px;
font-size: 1.45rem;
}

.governed-demo-body .result-card > p {
color: #4f596c;
line-height: 1.55;
}

.governed-demo-body .technical-details {
margin-top: 18px;
border-top: 1px solid #dce1eb;
padding-top: 14px;
}

.governed-demo-body .technical-details summary {
cursor: pointer;
color: #534eb1;
font-weight: 800;
}

.governed-demo-body .technical-details pre {
margin-top: 12px;
max-height: 280px;
overflow: auto;
padding: 15px;
border-radius: 11px;
background: #121724;
color: #e9edf5;
font-family: Consolas, Monaco, monospace;
font-size: 0.86rem;
line-height: 1.5;
white-space: pre-wrap;
overflow-wrap: anywhere;
}

.governed-demo-body .timeline-heading {
margin-bottom: 18px;
}

.governed-demo-body .timeline-list {
display: grid;
grid-template-columns: repeat(4, minmax(170px, 1fr));
gap: 14px;
list-style: none;
}

.governed-demo-body .timeline-list li {
display: flex;
gap: 12px;
min-height: 130px;
padding: 16px;
border: 1px solid #dde1eb;
border-radius: 14px;
background: #f7f8fb;
}

.governed-demo-body .timeline-number {
display: inline-flex;
width: 32px;
height: 32px;
flex: 0 0 32px;
align-items: center;
justify-content: center;
border-radius: 50%;
background: #6f6bd8;
color: #fff;
font-weight: 800;
}

.governed-demo-body .timeline-list strong {
display: block;
margin-bottom: 7px;
}

.governed-demo-body .timeline-list p {
color: #687287;
line-height: 1.45;
}

.governed-demo-body .demo-footer {
padding: 20px;
text-align: center;
color: #fff;
font-size: 1.08rem;
font-weight: 800;
letter-spacing: 0.04em;
}

@media (max-width: 1100px) {
.governed-demo-body .demo-layout {
grid-template-columns: 1fr;
}

.governed-demo-body .conversation-panel {
min-height: 620px;
}

.governed-demo-body .controls-grid,
.governed-demo-body .timeline-list {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}

@media (max-width: 650px) {
body.governed-demo-body {
padding: 10px;
}

.governed-demo-body .demo-header,
.governed-demo-body .demo-panel,
.governed-demo-body .evidence-timeline {
padding: 18px;
border-radius: 15px;
}

.governed-demo-body .controls-grid,
.governed-demo-body .timeline-list {
grid-template-columns: 1fr;
}

.governed-demo-body .status-list > div,
.governed-demo-body .receipt-details > div {
grid-template-columns: 1fr;
gap: 5px;
}

.governed-demo-body .conversation-message {
max-width: 100%;
}
}

.governed-demo-body .operator-session-status {
display: inline-flex;
align-items: center;
justify-content: center;
margin-top: 12px;
padding: 8px 14px;
border: 1px solid transparent;
border-radius: 999px;
font-size: 0.88rem;
font-weight: 700;
letter-spacing: 0.02em;
}

.governed-demo-body .operator-session-status::before {
content: "";
width: 9px;
height: 9px;
margin-right: 8px;
border-radius: 50%;
background: currentColor;
}

.governed-demo-body .session-checking {
color: #8a6d1d;
background: rgba(255, 213, 79, 0.14);
border-color: rgba(255, 213, 79, 0.4);
}

.governed-demo-body .session-verified {
color: #1e7a4c;
background: rgba(46, 204, 113, 0.12);
border-color: rgba(46, 204, 113, 0.38);
}

.governed-demo-body .session-invalid {
color: #b33a3a;
background: rgba(231, 76, 60, 0.12);
border-color: rgba(231, 76, 60, 0.38);
}