:root {
  --ink: #10201d;
  --muted: #65736f;
  --muted-2: #8a9692;
  --canvas: #f2f6f4;
  --surface: #ffffff;
  --surface-soft: #f7faf8;
  --surface-tint: #edf7f3;
  --line: #dfe8e4;
  --line-strong: #cfddd7;
  --navy: #071a18;
  --navy-2: #0b2521;
  --green: #0e755e;
  --green-dark: #075541;
  --green-light: #dff5eb;
  --mint: #8ce4c4;
  --lime: #c9f6e6;
  --blue: #2463eb;
  --amber: #9d6500;
  --amber-soft: #fff3d7;
  --danger: #b33b42;
  --danger-soft: #fdebed;
  --whatsapp: #d9fdd3;
  --shadow-xs: 0 1px 2px rgba(7, 26, 24, .06);
  --shadow-sm: 0 10px 28px rgba(7, 26, 24, .08);
  --shadow-lg: 0 28px 90px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

/* LOGIN */
.login-screen {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 12% 12%, rgba(59, 203, 156, .22), transparent 32%),
    radial-gradient(circle at 85% 85%, rgba(55, 117, 230, .12), transparent 32%),
    linear-gradient(145deg, #061613 0%, #071d1a 52%, #0a2823 100%);
}
.login-grid {
  position: absolute;
  inset: 0;
  opacity: .2;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.login-orb-one { width: 420px; height: 420px; right: -190px; top: -180px; border: 1px solid rgba(140, 228, 196, .18); box-shadow: inset 0 0 80px rgba(140,228,196,.04); }
.login-orb-two { width: 290px; height: 290px; left: 42%; bottom: -170px; border: 1px solid rgba(255,255,255,.08); }
.login-layout {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, .7fr);
  align-items: center;
  gap: clamp(50px, 8vw, 130px);
  padding: 54px 0;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.brand-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #138269, #075541);
  box-shadow: 0 10px 28px rgba(14,117,94,.25), inset 0 1px rgba(255,255,255,.22);
}
.brand-symbol span { font-size: 13px; font-weight: 900; letter-spacing: -.04em; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 14px; letter-spacing: -.01em; }
.brand-lockup small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-lockup-light small { color: rgba(255,255,255,.54); }
.hero-copy { margin-top: clamp(70px, 10vh, 125px); }
.pilot-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(140,228,196,.16);
  border-radius: 999px;
  color: #bdf4df;
  background: rgba(140,228,196,.07);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pilot-tag i, .live-pulse i, .model-chip i, .system-status i, .chat-contact span i, .composer-hint span i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #40d39d;
  box-shadow: 0 0 0 5px rgba(64,211,157,.1);
}
.hero-copy h1 {
  margin: 24px 0 22px;
  max-width: 760px;
  font-size: clamp(48px, 6.4vw, 88px);
  line-height: .95;
  letter-spacing: -.065em;
  font-weight: 720;
}
.hero-copy h1 em { color: var(--mint); font-style: normal; font-weight: 500; }
.hero-copy > p { max-width: 650px; margin: 0; color: rgba(255,255,255,.62); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.62; }
.login-capabilities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 58px; }
.login-capabilities article {
  min-height: 145px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
  backdrop-filter: blur(12px);
}
.login-capabilities article > span { color: var(--mint); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.login-capabilities strong { display: block; margin-top: 18px; font-size: 13px; }
.login-capabilities p { margin: 7px 0 0; color: rgba(255,255,255,.48); font-size: 11px; line-height: 1.55; }
.login-footnote { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; color: rgba(255,255,255,.44); font-size: 10px; }
.login-footnote strong { padding: 6px 8px; border: 1px solid rgba(255,255,255,.07); border-radius: 7px; color: rgba(255,255,255,.72); font-size: 9px; font-weight: 700; }
.login-card-wrap { width: min(100%, 470px); justify-self: end; }
.login-card {
  padding: 36px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 25px;
  color: var(--ink);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
}
.login-card-top { display: flex; align-items: center; gap: 9px; color: var(--green-dark); font-size: 10px; font-weight: 750; }
.secure-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--green-light); }
.secure-icon svg { width: 17px; height: 17px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.login-card .eyebrow { margin-top: 40px; }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.045em; }
.login-copy { margin: 12px 0 30px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-card label { display: block; margin-bottom: 9px; font-size: 11px; font-weight: 800; }
.password-field { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.password-field input {
  width: 100%;
  min-width: 0;
  padding: 15px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
}
.password-field input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(14,117,94,.09); }
.password-field button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(14,117,94,.2);
}
.password-field button:hover { background: var(--green-dark); }
.password-field button:disabled { opacity: .55; cursor: wait; }
.password-field button svg { width: 16px; height: 16px; }
.form-error { min-height: 18px; margin: 8px 0 0; color: var(--danger); font-size: 11px; }
.privacy-box { display: flex; gap: 11px; margin-top: 26px; padding: 15px; border: 1px solid #eadfbd; border-radius: 13px; background: #fffaeb; }
.privacy-box svg { flex: 0 0 19px; color: #98712a; }
.privacy-box p { margin: 0; color: #695a38; font-size: 10px; line-height: 1.55; }
.login-version { margin: 15px 0 0; color: rgba(255,255,255,.36); font-size: 9px; text-align: center; }

/* APP FRAME */
.workspace { min-height: 100vh; background: var(--canvas); }
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
}
.mode-switch { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.mode-button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 750; }
.mode-button svg { width: 15px; height: 15px; }
.mode-button.active { color: var(--green-dark); background: #fff; box-shadow: var(--shadow-xs); }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.model-chip { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.model-chip span small, .model-chip span strong { display: block; }
.model-chip span small { color: var(--muted-2); font-size: 8px; }
.model-chip span strong { margin-top: 1px; font-size: 9px; }
.logout-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; }
.logout-button:hover { color: var(--danger); border-color: #eccdd0; background: var(--danger-soft); }
.logout-button svg { width: 17px; height: 17px; }
.app-grid { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 286px minmax(520px, 1fr) 374px; gap: 1px; background: var(--line); }
.left-panel, .main-stage, .intelligence-panel { min-width: 0; background: var(--surface); }
.left-panel { display: flex; flex-direction: column; padding: 18px 16px 14px; }
.pilot-card { padding: 17px; border: 1px solid rgba(14,117,94,.16); border-radius: 16px; background: linear-gradient(145deg, #f3fbf7, #e8f7f1); }
.pilot-card-head { display: flex; justify-content: space-between; align-items: center; }
.live-pulse { display: inline-flex; align-items: center; gap: 7px; color: var(--green-dark); font-size: 8px; font-weight: 850; letter-spacing: .1em; }
.pilot-version { color: var(--muted-2); font-size: 8px; }
.pilot-card h2 { margin: 15px 0 7px; font-size: 16px; letter-spacing: -.025em; }
.pilot-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.coverage-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.coverage-row span { padding: 5px 7px; border: 1px solid rgba(14,117,94,.12); border-radius: 7px; color: var(--green-dark); background: rgba(255,255,255,.75); font-size: 8px; font-weight: 750; }
.sidebar-section { padding: 22px 3px 0; }
.section-title-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 11px; }
.section-title-row h3 { margin: 0; font-size: 12px; letter-spacing: -.01em; }
.count-chip { display: grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 7px; color: var(--muted); background: var(--surface-soft); font-size: 8px; font-weight: 800; }
.scenario-list, .sources-list { display: grid; gap: 7px; }
.scenario-button {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 16px;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: .15s ease;
}
.scenario-button:hover { border-color: rgba(14,117,94,.35); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.scenario-button.active { border-color: rgba(14,117,94,.45); background: var(--surface-tint); }
.scenario-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--green-dark); background: var(--green-light); font-size: 8px; font-weight: 850; }
.scenario-copy strong, .scenario-copy small { display: block; }
.scenario-copy strong { font-size: 10px; line-height: 1.35; }
.scenario-copy small { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.scenario-arrow { color: var(--muted-2); }
.scenario-arrow svg { width: 14px; height: 14px; }
.scenario-skeleton, .source-skeleton { border-radius: 11px; background: linear-gradient(90deg, #eef3f1, #f8faf9, #eef3f1); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.scenario-skeleton { height: 50px; }
.source-skeleton { height: 54px; }
.source-section { padding-top: 24px; }
.source-card { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.source-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--green-dark); background: var(--green-light); font-size: 8px; font-weight: 900; }
.source-card strong, .source-card small { display: block; }
.source-card strong { font-size: 9px; line-height: 1.35; }
.source-card small { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.source-state { width: 7px; height: 7px; border-radius: 50%; background: #bac4c0; }
.source-state.ready { background: #32bb86; box-shadow: 0 0 0 4px rgba(50,187,134,.1); }
.source-state.processing { background: #dca62d; animation: pulse 1.3s infinite; }
.source-state.fallback { background: #dca62d; box-shadow: 0 0 0 4px rgba(220,166,45,.1); }
.sidebar-footer { margin-top: auto; padding: 14px 3px 0; border-top: 1px solid var(--line); }
.system-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; }
.system-status.ready { color: var(--green-dark); }
.system-status.limited { color: #a67819; }
.system-status.limited i { background: #dca62d; }
.system-status b { font-weight: 750; }
.sidebar-footer small { display: block; margin-top: 8px; color: var(--muted-2); font-size: 8px; line-height: 1.4; }

/* MAIN STAGE */
.main-stage { padding: 22px clamp(18px, 2.2vw, 34px) 26px; background: var(--canvas); }
.stage-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.stage-header h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.stage-actions { display: flex; align-items: center; gap: 10px; }
.mode-status { padding: 7px 9px; border: 1px solid rgba(14,117,94,.14); border-radius: 8px; color: var(--green-dark); background: var(--green-light); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; font-weight: 800; }
.primary-button { padding: 12px 16px; border: 0; color: #fff; background: var(--green); font-size: 11px; box-shadow: 0 12px 25px rgba(14,117,94,.18); }
.primary-button:hover { background: var(--green-dark); }
.secondary-button { padding: 9px 11px; border: 1px solid var(--line-strong); color: var(--muted); background: #fff; font-size: 9px; }
.secondary-button:hover { color: var(--ink); border-color: #b8c9c2; }
.secondary-button svg, .primary-button svg { width: 15px; height: 15px; }
.value-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 17px 0 13px; }
.value-strip article { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.8); }
.value-strip article > span { display: grid; place-items: center; flex: 0 0 27px; height: 27px; border-radius: 8px; color: var(--green-dark); background: var(--green-light); font-size: 8px; font-weight: 900; }
.value-strip strong, .value-strip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value-strip strong { font-size: 9px; }
.value-strip small { margin-top: 2px; color: var(--muted-2); font-size: 7px; }
.chat-card { height: calc(100vh - 205px); min-height: 530px; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.chat-contact { display: flex; align-items: center; gap: 10px; }
.assistant-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #14836a, #075541); box-shadow: 0 8px 18px rgba(14,117,94,.18); }
.assistant-avatar svg { width: 19px; height: 19px; }
.chat-contact strong, .chat-contact span { display: block; }
.chat-contact strong { font-size: 11px; }
.chat-contact span { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 8px; }
.chat-contact span i { width: 5px; height: 5px; box-shadow: none; }
.chat-context { text-align: right; }
.chat-context span, .chat-context strong { display: block; }
.chat-context span { color: var(--muted-2); font-size: 7px; }
.chat-context strong { margin-top: 2px; font-size: 9px; }
.chat-messages {
  position: relative;
  overflow-y: auto;
  padding: 24px clamp(18px, 4vw, 50px) 30px;
  background-color: #eaf0ed;
  background-image:
    radial-gradient(circle at 20px 20px, rgba(7,85,65,.028) 1px, transparent 1px),
    radial-gradient(circle at 60px 60px, rgba(7,85,65,.025) 1px, transparent 1px);
  background-size: 80px 80px;
}
.welcome-panel { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.welcome-visual { position: relative; width: 94px; height: 94px; display: grid; place-items: center; margin-bottom: 24px; }
.orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(14,117,94,.16); }
.orbit-one { inset: 0; animation: slow-spin 16s linear infinite; }
.orbit-one::after { content: ""; position: absolute; width: 7px; height: 7px; top: 6px; left: 18px; border-radius: 50%; background: var(--green); }
.orbit-two { inset: 12px; border-style: dashed; animation: slow-spin 12s linear reverse infinite; }
.welcome-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; color: var(--green-dark); background: #fff; box-shadow: var(--shadow-sm); }
.welcome-icon svg { width: 25px; height: 25px; }
.welcome-panel h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.welcome-panel > p:not(.eyebrow) { max-width: 520px; margin: 10px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.message-row { display: flex; gap: 8px; margin-bottom: 14px; animation: rise .22s ease both; }
.message-row.user { justify-content: flex-end; }
.message-row.assistant { justify-content: flex-start; }
.message-bubble { position: relative; max-width: min(690px, 89%); padding: 12px 14px 9px; border-radius: 15px; box-shadow: 0 2px 4px rgba(7,26,24,.08); background: #fff; }
.message-row.user .message-bubble { border-top-right-radius: 5px; background: var(--whatsapp); }
.message-row.assistant .message-bubble { border-top-left-radius: 5px; }
.message-label { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 7px; }
.message-label strong { color: var(--green-dark); font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
.response-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; color: var(--green-dark); background: var(--green-light); font-size: 7px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.response-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #2ab47d; }
.response-status.missing_context { color: var(--amber); background: var(--amber-soft); }
.response-status.missing_context::before { background: #d5971c; }
.response-status.insufficient_evidence, .response-status.out_of_scope { color: var(--danger); background: var(--danger-soft); }
.response-status.insufficient_evidence::before, .response-status.out_of_scope::before { background: var(--danger); }
.message-text { color: #273530; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; line-height: 1.65; }
.message-row.user .message-text { color: #183129; }
.message-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 7px; color: #87938f; font-size: 7px; }
.message-meta .check { color: #2e82c5; font-size: 9px; letter-spacing: -3px; }
.safety-note { display: flex; gap: 8px; margin-top: 10px; padding: 9px 10px; border: 1px solid #ebdfbc; border-radius: 9px; color: #68532a; background: #fffaf0; font-size: 8px; line-height: 1.5; }
.safety-note::before { content: "!"; display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%; color: #fff; background: #c28b27; font-size: 8px; font-weight: 900; }
.citation-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; padding-top: 9px; border-top: 1px solid #edf1ef; }
.citation-links button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid #d8e7e0; border-radius: 7px; color: var(--green-dark); background: #f3faf7; font-size: 7px; font-weight: 800; }
.citation-links button:hover { border-color: var(--green); }
.feedback-row { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.feedback-row span { margin-right: 2px; color: var(--muted-2); font-size: 7px; }
.feedback-row button { display: grid; place-items: center; width: 25px; height: 23px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 10px; }
.feedback-row button.selected { border-color: var(--green); background: var(--green-light); }
.typing { display: flex; gap: 4px; padding: 6px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #87938f; animation: typing 1.15s infinite; }
.typing i:nth-child(2) { animation-delay: .14s; }
.typing i:nth-child(3) { animation-delay: .28s; }
.composer-area { padding: 10px 13px 12px; border-top: 1px solid var(--line); background: #fff; }
.composer-hint { display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 900px; margin: 0 auto 7px; }
.composer-hint span { display: inline-flex; align-items: center; gap: 6px; color: var(--green-dark); font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.composer-hint span i { width: 5px; height: 5px; box-shadow: none; }
.composer-hint p { margin: 0; color: var(--muted-2); font-size: 7px; }
.composer { display: flex; align-items: flex-end; gap: 8px; max-width: 900px; margin: 0 auto; }
.composer textarea { flex: 1; min-height: 45px; max-height: 135px; resize: none; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 13px; outline: none; color: var(--ink); background: var(--surface-soft); font-size: 10px; line-height: 1.45; }
.composer textarea:focus { border-color: rgba(14,117,94,.5); box-shadow: 0 0 0 4px rgba(14,117,94,.07); background: #fff; }
.composer button { display: grid; place-items: center; flex: 0 0 45px; height: 45px; border: 0; border-radius: 13px; color: #fff; background: var(--green); box-shadow: 0 10px 20px rgba(14,117,94,.18); }
.composer button:hover { background: var(--green-dark); }
.composer button:disabled { opacity: .45; cursor: wait; }
.composer button svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.composer-warning { margin: 6px 0 0; color: var(--muted-2); font-size: 7px; text-align: center; }

/* INTELLIGENCE PANEL */
.intelligence-panel { display: flex; flex-direction: column; padding: 20px 18px 16px; overflow-y: auto; }
.panel-topline { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-topline h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.mobile-close { display: none; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 8px; }
.trace-section, .evidence-section { padding-top: 18px; }
.right-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.right-section-heading span { font-size: 9px; font-weight: 800; }
.right-section-heading strong { color: var(--muted-2); font-size: 7px; font-weight: 700; }
.trace-list { display: grid; gap: 7px; }
.trace-empty { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px dashed var(--line-strong); border-radius: 11px; color: var(--muted); background: var(--surface-soft); }
.trace-empty svg { flex: 0 0 20px; color: var(--green); }
.trace-empty p { margin: 0; font-size: 8px; line-height: 1.5; }
.trace-item { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; transition: .2s ease; }
.trace-item.pending { opacity: .46; }
.trace-item.running { border-color: rgba(14,117,94,.32); background: var(--surface-tint); }
.trace-item.done { opacity: 1; }
.trace-marker { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: var(--muted); background: var(--surface-soft); }
.trace-item.running .trace-marker { color: var(--green-dark); background: var(--green-light); }
.trace-item.done .trace-marker { color: #fff; background: var(--green); }
.trace-marker svg { width: 13px; height: 13px; }
.trace-item.running .trace-marker svg { animation: spin 1.1s linear infinite; }
.trace-copy strong, .trace-copy small { display: block; }
.trace-copy strong { font-size: 8px; }
.trace-copy small { margin-top: 2px; color: var(--muted-2); font-size: 7px; line-height: 1.35; }
.trace-duration { color: var(--muted-2); font-size: 7px; }
.evidence-section { flex: 1; }
.evidence-empty { display: grid; place-items: center; padding: 28px 16px; border: 1px dashed var(--line-strong); border-radius: 13px; text-align: center; background: var(--surface-soft); }
.evidence-empty-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--green-dark); background: var(--green-light); }
.evidence-empty-icon svg { width: 21px; height: 21px; }
.evidence-empty h3 { margin: 12px 0 5px; font-size: 10px; }
.evidence-empty p { max-width: 250px; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.evidence-content { display: grid; gap: 8px; }
.evidence-summary { padding: 10px; border-radius: 9px; color: var(--green-dark); background: var(--green-light); font-size: 8px; line-height: 1.5; }
.evidence-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.evidence-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.evidence-card strong { font-size: 8px; line-height: 1.35; }
.evidence-card .location { flex: 0 0 auto; padding: 4px 6px; border-radius: 6px; color: var(--green-dark); background: var(--green-light); font-size: 6px; font-weight: 850; }
.evidence-card blockquote { margin: 10px 0; padding-left: 9px; border-left: 2px solid #a9cfc0; color: #53615c; font-size: 8px; line-height: 1.55; }
.evidence-card a { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 7px; font-weight: 800; text-decoration: none; }
.evidence-card a:hover { text-decoration: underline; }
.safety-card { display: flex; gap: 10px; margin-top: 17px; padding: 12px; border: 1px solid #eadfbd; border-radius: 12px; background: #fffbef; }
.safety-card-icon { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 9px; color: #916b26; background: #fff2c9; }
.safety-card-icon svg { width: 17px; height: 17px; }
.safety-card strong { display: block; font-size: 8px; }
.safety-card p { margin: 4px 0 0; color: #6b5b39; font-size: 7px; line-height: 1.45; }
.mobile-intelligence-button { display: none; }

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slow-spin { to { transform: rotate(360deg); } }

@media (max-width: 1240px) {
  .app-grid { grid-template-columns: 260px minmax(500px, 1fr) 330px; }
  .value-strip article { padding-inline: 8px; }
}
@media (max-width: 1080px) {
  .app-grid { grid-template-columns: 248px minmax(0, 1fr); }
  .intelligence-panel { position: fixed; z-index: 40; inset: 68px 0 0 auto; width: min(380px, 94vw); box-shadow: -22px 0 55px rgba(7,26,24,.2); transform: translateX(105%); transition: transform .22s ease; }
  .intelligence-panel.open { transform: translateX(0); }
  .mobile-close { display: inline-flex; }
  .mobile-intelligence-button { position: fixed; z-index: 35; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 0; border-radius: 12px; color: #fff; background: var(--green); box-shadow: var(--shadow-sm); font-size: 9px; font-weight: 800; }
  .mobile-intelligence-button svg { width: 16px; height: 16px; }
}
@media (max-width: 820px) {
  .login-layout { width: min(640px, calc(100% - 32px)); grid-template-columns: 1fr; gap: 35px; padding: 35px 0; }
  .login-story { text-align: center; }
  .brand-lockup-light { justify-content: center; }
  .hero-copy { margin-top: 50px; }
  .hero-copy h1 { margin-inline: auto; }
  .hero-copy > p { margin-inline: auto; }
  .login-capabilities { margin-top: 34px; text-align: left; }
  .login-footnote { justify-content: center; }
  .login-card-wrap { justify-self: center; }
  .topbar { grid-template-columns: 1fr auto; }
  .topbar > .brand-lockup { min-width: auto; }
  .topbar .mode-switch { position: fixed; z-index: 34; left: 50%; bottom: 14px; transform: translateX(-50%); box-shadow: var(--shadow-sm); }
  .model-chip { display: none; }
  .app-grid { display: block; }
  .left-panel { display: none; }
  .main-stage { min-height: calc(100vh - 68px); padding: 16px 10px 78px; }
  .chat-card { height: calc(100vh - 190px); min-height: 520px; }
  .value-strip { grid-template-columns: repeat(2, 1fr); }
  .stage-header { align-items: center; }
  .mode-status { display: none; }
}
@media (max-width: 560px) {
  .login-capabilities { grid-template-columns: 1fr; }
  .login-capabilities article { min-height: auto; }
  .login-card { padding: 28px 22px; }
  .password-field { grid-template-columns: 1fr; }
  .password-field button { min-height: 46px; }
  .topbar { height: 62px; padding: 0 12px; }
  .topbar .brand-lockup small { display: none; }
  .app-grid { min-height: calc(100vh - 62px); }
  .stage-header h1 { font-size: 21px; }
  .value-strip { display: none; }
  .chat-card { height: calc(100vh - 145px); margin-top: 12px; border-radius: 14px; }
  .chat-header { padding: 11px 12px; }
  .chat-context { display: none; }
  .chat-messages { padding: 18px 10px 22px; }
  .message-bubble { max-width: 93%; }
  .composer-hint p { display: none; }
  .welcome-panel h2 { font-size: 19px; }
  .welcome-actions { display: grid; width: 100%; }
  .welcome-actions button { width: 100%; }
  .intelligence-panel { top: 62px; }
}
