.hemat-edit, .hemat-math { border-block: 1px solid var(--line); }
.hemat-edit { margin: 22px 0 16px; }
.hemat-edit summary, .hemat-math summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 8px 2px;
  cursor: pointer;
  color: var(--teal);
  font: 580 .95rem/1.45 var(--ui);
  list-style: none;
}
.hemat-edit summary::-webkit-details-marker, .hemat-math summary::-webkit-details-marker { display: none; }
.hemat-edit summary::after, .hemat-math summary::after {
  content: "";
  margin-right: 7px;
  width: 9px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.hemat-edit[open] summary::after, .hemat-math[open] summary::after { transform: rotate(225deg); }
.hemat-edit summary:hover, .hemat-math summary:hover { text-decoration: underline; text-underline-offset: .22em; }
#hitung-hemat :focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
#hemat-form { margin: 0 0 22px; padding: clamp(15px, 3vw, 28px); border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
#hemat-form fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; padding: 0; min-width: 0; margin: 0; border: 0; }
#hemat-form fieldset + fieldset { margin-top: 20px; }
#hemat-form legend { padding: 0 0 6px; font: 640 1.02rem/1.45 var(--ui); color: var(--ink); }
#hemat-form label { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .91rem; }
#hemat-form input { width: 100%; min-width: 0; min-height: 46px; padding: 7px 12px; border: 1px solid #87958c; border-radius: 4px; background: #fff; color: var(--ink); font: 500 1rem/1.4 var(--ui); }
.hemat-hint { margin-top: 12px; color: var(--muted); font-size: .87rem; }
.hemat-actions { display: flex; flex-wrap: wrap; gap: 7px 17px; margin-top: 17px; }
.hemat-actions button { min-height: 46px; padding: 7px 15px; cursor: pointer; border-radius: 4px; font: 550 .9rem/1.4 var(--ui); }
.hemat-actions button[type=submit] { color: #fff; background: var(--teal); }
.hemat-actions button[type=submit]:hover { background: #123d34; }
.hemat-actions button[type=reset] { color: var(--teal); text-decoration: underline; text-underline-offset: .2em; }
.hemat-results {
  margin: 16px 0;
  padding: clamp(18px, 3.3vw, 38px);
  border-radius: 7px;
  background: #17473c;
  color: #fffdf3;
  scroll-margin-block: 20px;
}
.hemat-results h3 { margin-bottom: 16px; font: 510 .85rem/1.45 var(--mono); color: #d9e7dc; }
.hemat-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-block: 16px 23px; border-block: 1px solid #678378; }
.hemat-figures dt { font-size: .96rem; line-height: 1.4; }
.hemat-figures dd { margin-top: 8px; font: 530 clamp(1.55rem, 2.9vw, 2.65rem)/1.1 var(--ui); letter-spacing: -.055em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hemat-figures div:last-child dd { color: #f8da97; }
.hemat-results > p { max-width: 65ch; margin: 17px 0 0; color: #e4eee6; line-height: 1.55; }
.hemat-math ul { padding: 0 0 17px 1.2rem; list-style: disc; color: var(--muted); font-size: .93rem; }
.hemat-math li + li { margin-top: 7px; }
.hemat-note { font-size: .94rem; }
@media (max-width: 610px) {
  .hemat-figures, #hemat-form fieldset { grid-template-columns: 1fr; }
  .hemat-figures { gap: 15px; }
}
