.chemistry-tools-hess{
  --card:#ffffff;
  --ink:#172033;
  --muted:#657086;
  --line:#dbe3ef;
  --accent:#2857c5;
  --accent-soft:#eef3ff;
  --success:#16794b;
  --error:#9b2525;

  font-family:Arial,Helvetica,sans-serif;
  color:var(--ink);
  line-height:1.5;
}

.chemistry-tools-hess,
.chemistry-tools-hess *{
  box-sizing:border-box;
}

.chemistry-tools-hess .page{
  max-width:1000px;
  margin:0 auto;
  padding:28px 18px 50px;
}

.chemistry-tools-hess h1{
  margin:0 0 6px;
  font-size:clamp(28px,4vw,40px);
}

.chemistry-tools-hess .subtitle{
  color:var(--muted);
  margin:0 0 22px;
}

.chemistry-tools-hess .card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:20px;
  box-shadow:0 4px 18px rgba(30,55,90,.05);
  margin-bottom:18px;
}

.chemistry-tools-hess .toolbar{
  display:flex;
  gap:16px;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
}

.chemistry-tools-hess .field{
  flex:1;
  min-width:220px;
}

.chemistry-tools-hess .question-field{
  max-width:310px;
}

.chemistry-tools-hess label{
  display:block;
  font-weight:700;
  margin-bottom:6px;
}

.chemistry-tools-hess input,
.chemistry-tools-hess select{
  width:100%;
  padding:11px 12px;
  border:1px solid #bcc8da;
  border-radius:9px;
  font-size:16px;
  background:#fff;
  color:var(--ink);
}

.chemistry-tools-hess input:focus,
.chemistry-tools-hess select:focus{
  outline:3px solid rgba(40,87,197,.15);
  border-color:var(--accent);
}

.chemistry-tools-hess button{
  padding:12px 18px;
  border:0;
  border-radius:9px;
  background:var(--accent);
  color:#fff;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}

.chemistry-tools-hess button.secondary{
  background:#fff;
  color:var(--accent);
  border:1px solid var(--accent);
}

.chemistry-tools-hess button:hover{
  filter:brightness(.96);
}

.chemistry-tools-hess .button-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.chemistry-tools-hess .hint{
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
}

.chemistry-tools-hess .question-label{
  color:var(--muted);
  font-size:14px;
  font-weight:700;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.chemistry-tools-hess .question-text{
  font-size:18px;
  line-height:1.7;
  margin-bottom:16px;
}

.chemistry-tools-hess .target-reaction{
  font-family:"Cambria Math","Times New Roman",serif;
  font-size:21px;
  padding:12px 14px;
  background:#f8faff;
  border-left:4px solid var(--accent);
  border-radius:7px;
  margin:10px 0 16px;
  overflow:auto;
}

.chemistry-tools-hess .cycle-wrap{
  margin:20px 0 24px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fbfcff;
  overflow-x:auto;
}

.chemistry-tools-hess .cycle-wrap svg{
  display:block;
  width:100%;
  min-width:680px;
  height:auto;
}

.chemistry-tools-hess .cycle-node{
  fill:#ffffff;
  stroke:#bcc8da;
  stroke-width:1.5;
}

.chemistry-tools-hess .cycle-target{
  stroke:#2857c5;
  stroke-width:3;
  fill:none;
}

.chemistry-tools-hess .cycle-path{
  stroke:#657086;
  stroke-width:2.4;
  fill:none;
}

.chemistry-tools-hess .node-text{
  font-family:"Cambria Math","Times New Roman",serif;
  font-size:20px;
  fill:#172033;
  text-anchor:middle;
  dominant-baseline:middle;
}

.chemistry-tools-hess .arrow-label{
  font-family:Arial,Helvetica,sans-serif;
  font-size:15px;
  font-weight:700;
  fill:#172033;
  text-anchor:middle;
}

.chemistry-tools-hess .target-label{
  fill:#2857c5;
  font-size:16px;
}

.chemistry-tools-hess .answer-area{
  margin-top:20px;
  padding-top:20px;
  border-top:1px solid var(--line);
}

.chemistry-tools-hess .answer-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:end;
}

.chemistry-tools-hess .answer-input-wrap{
  position:relative;
}

.chemistry-tools-hess .answer-input-wrap input{
  padding-right:95px;
}

.chemistry-tools-hess .answer-unit{
  position:absolute;
  right:13px;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.chemistry-tools-hess .feedback{
  display:none;
  margin-top:14px;
  padding:13px;
  border-radius:9px;
}

.chemistry-tools-hess .feedback.good{
  display:block;
  background:#eefaf4;
  border:1px solid #ccebdc;
  color:var(--success);
}

.chemistry-tools-hess .feedback.bad{
  display:block;
  background:#fff2f2;
  border:1px solid #efc7c7;
  color:var(--error);
}

.chemistry-tools-hess .working-button{
  margin-top:14px;
}

.chemistry-tools-hess .working{
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid var(--line);
}

.chemistry-tools-hess .working h3{
  margin:18px 0 8px;
  font-size:18px;
}

.chemistry-tools-hess .working h3:first-child{
  margin-top:0;
}

.chemistry-tools-hess .calculation{
  background:#fbfcff;
  border:1px solid var(--line);
  border-radius:10px;
  padding:13px 14px;
  margin:9px 0;
  font-family:"Cambria Math","Times New Roman",serif;
  font-size:18px;
  overflow:auto;
}

.chemistry-tools-hess .final-answer{
  background:#eefaf4;
  border:1px solid #ccebdc;
  color:var(--success);
  border-radius:10px;
  padding:14px;
  margin-top:16px;
  font-size:20px;
  font-weight:800;
}

@media(max-width:720px){

  .chemistry-tools-hess .answer-row{
    grid-template-columns:1fr;
  }

  .chemistry-tools-hess .answer-row button{
    width:100%;
  }

  .chemistry-tools-hess .button-row{
    width:100%;
  }

  .chemistry-tools-hess .button-row button{
    flex:1 1 140px;
  }
}