:root{
  --bg:#0b0e14;
  --panel:#111827;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --border:#243244;
  --accent:#60a5fa;
  --ok:#34d399;
  --warn:#fbbf24;
  --bad:#fb7185;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: linear-gradient(180deg, var(--bg), #06070a 80%);
  color:var(--text);
}

.container{
  width:min(1100px, 92vw);
  margin:0 auto;
}

.header{
  border-bottom:1px solid var(--border);
  background: linear-gradient(180deg, rgba(96,165,250,0.12), rgba(96,165,250,0.02));
  padding:26px 0 18px 0;
}

h1{
  margin:0 0 8px 0;
  font-size: 1.7rem;
}

.subhead{
  margin:0 0 14px 0;
  color:var(--muted);
  line-height:1.4;
}

.toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.main{
  padding:20px 0 30px 0;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px 16px 14px 16px;
  margin:14px 0;
}

h2{
  margin:0 0 10px 0;
  font-size: 1.2rem;
}

h3{
  margin:0;
  font-size: 1.05rem;
}

.hint{
  margin:0 0 10px 0;
  color:var(--muted);
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:10px 0;
}

.field span{
  font-weight:600;
}

textarea, select, .input{
  width:100%;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(15,23,42,0.85);
  color: var(--text);
  padding:10px 10px;
  outline:none;
}

textarea:focus, select:focus, .input:focus{
  border-color: rgba(96,165,250,0.8);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.18);
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

@media (max-width: 860px){
  .grid2{ grid-template-columns: 1fr; }
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
}

.btn{
  border:1px solid rgba(96,165,250,0.55);
  background: rgba(96,165,250,0.14);
  color: var(--text);
  padding:10px 12px;
  border-radius: 10px;
  cursor:pointer;
  font-weight:600;
}

.btn:hover{ background: rgba(96,165,250,0.22); }

.btn:disabled{
  opacity:0.45;
  cursor:not-allowed;
}

.btn-ghost{
  border:1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.btn-ghost:hover{ background: rgba(255,255,255,0.08); }

.btn-small{
  padding:7px 10px;
  font-weight:600;
}

.output{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius: 12px;
  background: rgba(3, 6, 14, 0.55);
}

.outputHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}

.pre{
  margin:0;
  padding:12px 12px 14px 12px;
  white-space:pre-wrap;
  line-height:1.45;
}

.details{
  border:1px dashed rgba(156,163,175,0.35);
  padding:10px 10px;
  border-radius: 12px;
  margin-top:10px;
  background: rgba(255,255,255,0.02);
}

.details summary{
  cursor:pointer;
  font-weight:700;
}

.detailsBody{
  margin-top:10px;
}

.small{
  color: var(--muted);
  font-size: 0.9rem;
}

.muted{ color: var(--muted); }

.footer{
  margin:18px 0 0 0;
  padding:10px 0 0 0;
  border-top: 1px solid var(--border);
}

/* Domain */
.domain{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
  margin-top:8px;
}
@media (max-width: 860px){
  .domain{ grid-template-columns: 1fr; }
}
.radio{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.radio input{ transform: scale(1.1); }

/* Blocks and gates */
.block{
  border:1px solid rgba(156,163,175,0.25);
  border-radius: 12px;
  padding:12px;
  margin:10px 0;
  background: rgba(255,255,255,0.015);
}
.blockHead{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:8px;
}

.gate{
  margin-top:8px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(156,163,175,0.25);
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  min-height: 22px;
}
.gate-ok{
  border-color: rgba(52,211,153,0.45);
  background: rgba(52,211,153,0.08);
  color: rgba(209,250,229,0.9);
}
.gate-warn{
  border-color: rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.07);
  color: rgba(253,230,138,0.95);
}
.gate-bad{
  border-color: rgba(251,113,133,0.45);
  background: rgba(251,113,133,0.07);
  color: rgba(255,228,230,0.95);
}

/* Wizard */
.wizard{
  border:1px solid var(--border);
  border-radius: 14px;
  padding:12px;
  background: rgba(3, 6, 14, 0.45);
}

.wizard.disabled{
  opacity:0.55;
  pointer-events:none;
}

.wizardTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  border-bottom:1px solid var(--border);
  padding-bottom:10px;
  margin-bottom:10px;
}

.wizardProgress{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.wizardBody{
  padding:6px 0 10px 0;
}

.wizQuestion{
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.wizardResults{
  border-top:1px solid var(--border);
  margin-top:10px;
  padding-top:10px;
}
/* ===============================
   SOoL IRAC+ PATCHES (MINIMAL)
   =============================== */

/* Step 3: Chain container */
.chain{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Wizard results emphasis */
.wizardResults h3{
  margin:0 0 8px 0;
  font-size:1.1rem;
  color: var(--accent);
}

/* Make print button visually distinct but consistent */
#btnPrint{
  border-color: rgba(52,211,153,0.55);
  background: rgba(52,211,153,0.14);
}
#btnPrint:hover{
  background: rgba(52,211,153,0.22);
}

/* ===============================
   MLC Status Bar
   =============================== */

.mlcFrame{
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(15,23,42,0.35);
  overflow:hidden;
}

/* Print / PDF mode */
@media print{
  body{
    background:#fff;
    color:#000;
  }

  .header,
  .toolbar,
  .btn,
  .btn-ghost,
  .wizard,
  .domain,
  .gate{
    display:none !important;
  }

  .card{
    border:1px solid #ccc;
    background:#fff;
    box-shadow:none;
  }

  .output{
    border:1px solid #ccc;
    background:#fff;
  }

  .pre{
    white-space:pre-wrap;
    font-size:11pt;
    color:#000;
  }
}
