:root{
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --shadow: 0 10px 30px rgba(0,0,0,0.06);
  --focus: #4b5563;

  --primary: #3b82f6;
  --primary2: #2563eb;

  --secondaryBg: #eef2ff;
  --secondaryText: #374151;

  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Helvetica Neue";
  background: var(--bg);
  color: var(--text);
}

.container{
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}

.header{ margin-bottom: 16px; }
.header h1{
  font-size: 28px;
  margin: 0 0 6px 0;
}
.subtitle{
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.logo{
  width: 70px;
  height: auto;
  border-radius: 90px;
  display: grid;
  place-items: center;
  display: block;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.sectionTitle{ margin: 0 0 10px 0; font-size: 18px; }

.row{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 760px){
  .grid{
    grid-template-columns: 1.45fr 0.55fr;
    align-items: start;
  }
}

.label{ font-weight: 650; font-size: 14px; }

.input{
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 15px;
  outline: none;
}

.input:focus{
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(75, 85, 99, 0.15);
}

.fields{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: #fafafa;
  min-height: 180px;
}

.shapeFields{ }
.hidden{ display: none; }

.unitRow{ margin-bottom: 0; }

.btn{
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  margin-right: 10px;
}

.btn:hover{ background: var(--primary2); }

.btn.secondary{
  background: var(--secondaryBg);
  color: var(--secondaryText);
  border: 1px solid var(--border);
  margin-right: 0;
}

.btn.secondary:hover{ background: #e0e7ff; }

.resultBox{
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px;
  background: #fbfbfd;
}

.resultRow{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 760px){
  .resultRow{ grid-template-columns: 1fr 1fr; align-items: start; }
}

.resultTitle{
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 6px;
}

.resultValue{
  font-size: 26px;
  font-weight: 800;
  word-break: break-word;
}

.resultMeta{
  border-left: 3px solid #e5e7eb;
  padding-left: 12px;
}

.metaLine{
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.metaFormula{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  margin-top: 6px;
  color: #111827;
}

.metaDetail{
  font-size: 13px;
  color: #374151;
  margin-top: 6px;
  white-space: pre-wrap;
}

.historyTop{
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.historyHint{ margin: 0; color: var(--muted); font-size: 14px; }

.historyList{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.historyList li{
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.historyItemTop{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.historyShape{ font-weight: 750; }
.historyValue{ font-weight: 850; }

.historySmall{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.historyEmpty{ margin: 12px 0 0 0; color: var(--muted); }

.footer{
  color: var(--muted);
  font-size: 14px;
  padding: 0 6px;
}
