:root{
  --bg: #0b1220;            /* page background (dark navy) */
  --card: #0f172a;          /* card bg */
  --text: #e5e7eb;          /* body text */
  --muted: #94a3b8;         /* secondary text */
  --line: #1f2937;          /* borders */
  --brand: #4f46e5;         /* primary */
  --brand-2:#22c55e;        /* success */
  --warn:#f59e0b;           /* amber */
  --danger:#ef4444;         /* red */
  --shadow: 0 10px 24px rgba(0,0,0,.28);
  --radius: 14px;
  --pad: 18px;
  --container: min(100%, 980px);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 900px at 10% -10%, #111827 10%, transparent 40%) , var(--bg);
  color:var(--text); -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}

/* Page header / hero */
h1{font-size: clamp(28px, 4vw, 40px); line-height:1.1; margin:32px auto 12px; width:var(--container); font-weight:700;}
h2{font-size: clamp(18px, 2.2vw, 22px); margin:0 0 10px; font-weight:600}
p,small{color:var(--muted)}

section.card{
  width:var(--container); margin:18px auto; background:var(--card);
  border:1px solid var(--line); border-radius:var(--radius);
  padding: clamp(16px, 2.5vw, 22px);
  box-shadow: var(--shadow);
}

.row{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.hr{height:1px; background:var(--line); margin:14px 0}

/* Inputs */
input[type="text"], input[type="file"], input[type="number"], textarea, select{
  background:#0b1020; color:var(--text); border:1px solid #1e293b; border-radius:10px;
  padding:10px 12px; outline:none; min-height:40px;
  transition:border-color .2s, box-shadow .2s; width:auto;
}
textarea{min-height:96px; width:100%}
input[type="text"]:focus, input[type="file"]:focus, textarea:focus, select:focus{
  border-color:#334155; box-shadow:0 0 0 3px rgba(79,70,229,.25)
}

/* Buttons */
.btn{
  appearance:none; border:1px solid #253047; background:#101a32; color:var(--text);
  padding:10px 14px; border-radius:10px; cursor:pointer; font-weight:600;
  transition:transform .02s ease-in, background .2s, border-color .2s;
}
.btn:hover{background:#142042; border-color:#2c3e66}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--brand); border-color:var(--brand); color:white}
.btn.primary:hover{filter:brightness(1.05)}
.btn.ghost{background:transparent; border-color:#334155}

/* Pills / chips (doc toggles, etc.) */
.pill, .chip, .tag, .doc-btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px; border:1px solid #2b3757; background:#0c152c; color:var(--text);
  white-space:nowrap; font-size:14px;
}

/* Tables */
.table{width:100%; border-collapse:collapse; margin-top:8px}
.table th, .table td{border:1px solid #1e293b; padding:10px 12px; text-align:left}
.table th{background:#0b1020; color:#cbd5e1; font-weight:600}
.table td.small{color:var(--muted)}
.code{font-family:var(--mono); background:#0b1020; border:1px solid #1e293b; padding:2px 6px; border-radius:8px}

/* Status badges */
.badge{padding:5px 10px; border-radius:999px; font-weight:700; font-size:13px}
.badge-invest{background:rgba(34,197,94,.15); color:#22c55e; border:1px solid rgba(34,197,94,.35)}
.badge-investigate{background:rgba(245,158,11,.12); color:#f59e0b; border:1px solid rgba(245,158,11,.35)}
.badge-pass{background:rgba(239,68,68,.12); color:#ef4444; border:1px solid rgba(239,68,68,.35)}

/* Heat for risk cells */
.risk-0{background: rgba(34,197,94,.12)}
.risk-1{background: rgba(34,197,94,.08)}
.risk-2{background: rgba(234,179,8,.10)}
.risk-3{background: rgba(234,179,8,.18)}
.risk-4{background: rgba(239,68,68,.16)}
.risk-5{background: rgba(239,68,68,.24)}

/* Memo block */
.memo{white-space:pre-wrap; background:#0b1020; border:1px solid #1e293b; border-radius:12px; padding:14px}

/* Uploader tweaks */
input[type="file"]{padding:8px; background:#0b1020}
label{color:#cbd5e1}

/* Tiny spinner */
.spinner{font-size:.95rem; color:#a3b1c7}

/* Make interactive controls larger on small screens */
@media (max-width:700px){
  section.card{margin:12px auto}
  .btn{width:100%}
  input[type="text"]{width:100%}
}

/* --- hotfix: hide accidental duplicate hero elements at the top --- */
body > h1 + h1 { display:none; }
body > h1 + p + p { display:none; }   /* if two consecutive taglines slipped in */

/* keep hero text within the page container */
body > p { width: var(--container); margin: 6px auto; }

/* tighten top spacing and keep sections consistent */
section.card:first-of-type { margin-top: 16px; }

/* polish inputs in the Ask/Upload rows */
input[type="text"]::placeholder { color:#94a3b8; }
input[type="file"] { border-radius:10px; border:1px solid #1e293b; }

/* make the Ask row breathe a bit */
.row .btn { height:auto; }

/* ensure long doc chips wrap nicely */
.pill,.chip,.doc-btn{ max-width:100%; overflow:hidden; text-overflow:ellipsis; }

/* Containers */
.container{ width: min(100%, 980px); margin: 0 auto; }

/* Cards */
.card--compact{ padding-top: 10px; padding-bottom: 10px; }
.fold > summary{
  list-style: none; cursor: pointer; user-select: none;
  font-weight: 600; color: #cbd5e1; padding: 6px 0;
}
.fold > summary::marker{ display:none }
.fold[open] > summary{ color:#e5e7eb }

/* Tabs */
.tabs{
  display:flex; gap:8px; margin:16px 0 12px;
  background:#0b1020; border:1px solid #1e293b; padding:6px; border-radius:12px;
}
.tab{
  appearance:none; background:transparent; border:1px solid transparent;
  color:#cbd5e1; padding:8px 12px; border-radius:10px; cursor:pointer; font-weight:600;
}
.tab.is-active{
  background:#111a2f; border-color:#2c3e66; color:#fff;
  box-shadow: inset 0 0 0 1px #2c3e66;
}

/* Make primary ask box prominent on mobile */
@media (max-width:700px){
  .tabs{ position: sticky; top: 0; z-index: 5; }
  #question{ width:100% }
  .btn{ width:auto }
}
.container{ width:min(100%,980px); margin:0 auto; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; }
.hr{ height:1px; background:#1e293b; margin:14px 0; }

