:root {
  --zbtool-shell-padding: 24px;
  --bmi-border: #dfe6f0;
  --bmi-text: #0f172a;
  --bmi-muted: #64748b;
  --bmi-green: #176c39;
  --bmi-green-soft: #eef8f1;
  --bmi-blue-soft: #eef4ff;
  --bmi-gold-soft: #fff7e8;
  --bmi-red-soft: #fff1ef;
}

.zbtool-card {
  max-width: none;
}

.panel-work,
.panel-guides,
.panel-related,
.panel-comments {
  display: grid;
  gap: 18px;
}

.bmi-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.bmi-main,
.bmi-side,
.guide-layout {
  display: grid;
  gap: 18px;
}

.bmi-main,
.bmi-side {
  grid-template-rows: auto 1fr;
  min-width: 0;
  height: 100%;
  align-content: stretch;
}

.guide-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-block {
  box-sizing: border-box;
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #e4e8ef;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.section-title-row,
.result-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef8f1 0%, #dff3e5 100%);
  color: #13633a;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #c3e8d0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.section-pill-soft {
  background: linear-gradient(180deg, #f3f7ff 0%, #e8f0ff 100%);
  border-color: #d5e2ff;
  color: #28507a;
}

.block-note,
.formula-copy,
.result-summary,
.result-disclaimer,
.empty-state {
  margin: 0;
  color: var(--bmi-muted);
  line-height: 1.8;
}

.input-grid,
.metric-strip,
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.control {
  display: grid;
  gap: 8px;
}

.control span {
  font-size: 13px;
  color: #4b5563;
}

.control small {
  font-size: 12px;
  color: var(--bmi-muted);
  line-height: 1.6;
}

.control input,
.zbtool-comments .com_box textarea,
.zbtool-comments .com_info li input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #d6deea;
  border-radius: 20px;
  background: #fff;
  color: #1f2937;
  padding: 14px 16px;
  font-size: 14px;
}

.control input:focus,
.zbtool-comments .com_box textarea:focus,
.zbtool-comments .com_info li input:focus {
  outline: none;
  border-color: #4e8d6d;
  box-shadow: 0 0 0 4px rgba(78, 141, 109, 0.12);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row button,
.zbtool-comments .com_info button {
  border: 1px solid #ced7e3;
  background: #f7fafc;
  color: #334155;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.action-row button:hover,
.zbtool-comments .com_info button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -18px rgba(51, 65, 85, 0.45);
  background: #ffffff;
}

.action-row button.primary {
  background: linear-gradient(180deg, #1f8a4b 0%, #176c39 100%);
  border-color: #176c39;
  color: #fff;
  box-shadow: 0 16px 26px -18px rgba(23, 108, 57, 0.9);
}

.tool-tip {
  min-height: 22px;
  color: #334155;
  font-size: 13px;
}

.tool-tip.error {
  color: #b42318;
}

.metric-chip,
.result-row,
.guide-card {
  border: 1px solid var(--bmi-border);
  border-radius: 20px;
  background: #f8fafc;
}

.metric-chip {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
}

.metric-chip span {
  font-size: 12px;
  color: var(--bmi-muted);
}

.metric-chip strong {
  color: var(--bmi-text);
  font-size: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.reference-block {
  min-width: 0;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
}

.reference-block .table-wrap {
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow-x: auto;
}

.formula-block {
  min-width: 0;
  overflow: hidden;
  align-self: end;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.formula-block > * {
  min-width: 0;
}

.formula-copy,
.formula-box,
.example-box,
.example-box p {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.range-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.reference-block .range-table th,
.reference-block .range-table td {
  padding-top: 22px;
  padding-bottom: 22px;
}

.range-table th,
.range-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e8edf4;
  text-align: left;
  font-size: 14px;
}

.range-table th {
  color: #475569;
  font-weight: 600;
  background: #f8fafc;
}

.range-table tbody tr.is-active {
  background: var(--bmi-green-soft);
}

.range-table tbody tr.is-active td {
  color: var(--bmi-green);
  font-weight: 600;
}

.formula-box {
  padding: 14px 18px;
  border-radius: 22px;
  border: 1px solid #d7e5da;
  background: linear-gradient(180deg, #f7fcf8 0%, #eef8f1 100%);
  color: var(--bmi-green);
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 700;
  text-align: center;
  line-height: 1.6;
}

.example-box {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid #e5ebf3;
  background: #f8fafc;
}

.example-box strong {
  color: var(--bmi-text);
}

.example-box p {
  margin: 0;
  color: var(--bmi-muted);
  line-height: 1.8;
}

.result-card {
  position: sticky;
  top: 18px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #eef6ff;
  color: #225282;
  border: 1px solid #c8def6;
  font-size: 13px;
  font-weight: 600;
}

.result-hero {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid #dfe8f4;
  background: radial-gradient(circle at top, #f8fbff 0%, #eef4ff 52%, #f9fbff 100%);
}

.result-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b7288;
}

.result-value {
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1;
  color: var(--bmi-text);
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.result-row span {
  color: var(--bmi-muted);
  font-size: 13px;
}

.result-row strong {
  color: var(--bmi-text);
  font-size: 15px;
  text-align: right;
}

.quick-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid #e3e8f0;
  background: #f8fafc;
}

.quick-list,
.guide-list {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  line-height: 1.85;
}

.guide-card {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid #dfe6f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 14px 30px -30px rgba(15, 23, 42, 0.45);
  --guide-accent: #7ba7d6;
  --guide-accent-soft: rgba(123, 167, 214, 0.14);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.guide-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--guide-accent) 0%, rgba(255, 255, 255, 0) 78%);
}

.guide-card h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 10px !important;
  background: transparent !important;
  border: 0 !important;
  border-left: 0 !important;
  text-indent: 0 !important;
  box-shadow: none !important;
  color: var(--bmi-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.guide-card h3::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 3px;
  background: var(--guide-accent);
  box-shadow: 0 0 0 6px var(--guide-accent-soft);
}

.guide-card h3::after {
  content: "";
  flex: 1;
  min-width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--guide-accent-soft) 0%, rgba(255, 255, 255, 0) 100%);
}

.guide-list {
  padding-left: 20px;
}

.guide-list li::marker {
  color: var(--guide-accent);
}

.guide-card[data-category="underweight"] {
  --guide-accent: #5d8fcb;
  --guide-accent-soft: rgba(93, 143, 203, 0.18);
}

.guide-card[data-category="normal"] {
  --guide-accent: #4a9b66;
  --guide-accent-soft: rgba(74, 155, 102, 0.18);
}

.guide-card[data-category="overweight"] {
  --guide-accent: #d59a3c;
  --guide-accent-soft: rgba(213, 154, 60, 0.18);
}

.guide-card[data-category="obese"] {
  --guide-accent: #d56d67;
  --guide-accent-soft: rgba(213, 109, 103, 0.18);
}

.guide-card.is-active {
  border-color: var(--guide-accent);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 20px 34px -28px rgba(15, 23, 42, 0.26), inset 0 0 0 1px var(--guide-accent-soft);
  transform: translateY(-1px);
}

.result-card.is-underweight .result-badge,
.result-card.is-underweight .result-hero {
  background: linear-gradient(180deg, #eef6ff 0%, #f7fbff 100%);
}

.result-card.is-normal .result-badge,
.result-card.is-normal .result-hero {
  background: linear-gradient(180deg, #eef8f1 0%, #f7fcf8 100%);
}

.result-card.is-overweight .result-badge,
.result-card.is-overweight .result-hero {
  background: linear-gradient(180deg, var(--bmi-gold-soft) 0%, #fffdf7 100%);
}

.result-card.is-obese .result-badge,
.result-card.is-obese .result-hero {
  background: linear-gradient(180deg, var(--bmi-red-soft) 0%, #fff8f7 100%);
}

.result-card.is-underweight .result-badge {
  border-color: #bfd8ff;
  color: #28507a;
}

.result-card.is-normal .result-badge {
  border-color: #b7e0c5;
  color: #13633a;
}

.result-card.is-overweight .result-badge {
  border-color: #f4d4a0;
  color: #8a5100;
}

.result-card.is-obese .result-badge {
  border-color: #f2c0bc;
  color: #b42318;
}

.panel-related h2,
.zbtool-comments h3 {
  display: block !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-left: 0 !important;
  background: transparent !important;
  color: #333 !important;
  text-indent: 0 !important;
  font-size: 18px !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
}

.panel-related .zbtool-related-list {
  margin-right: -2%;
}

.panel-related .zbtool-related-list li {
  box-shadow: 1px 2px 8px rgba(15, 23, 42, 0.08);
}

.zbtool-comments .compost {
  margin: 15px 0;
}

.zbtool-comments .com_name {
  display: block;
  color: #5781bf;
}

.zbtool-comments .com_name a,
.zbtool-comments .clbody .cinfo h5,
.zbtool-comments .clbody .cinfo span a,
.zbtool-comments .clbody p a {
  color: #5781bf;
}

.zbtool-comments .com_info {
  margin-top: 15px;
  overflow: hidden;
}

.zbtool-comments .com_info ul {
  display: inline-block;
  float: left;
  list-style: none;
  margin: 0;
  padding: 0;
}

.zbtool-comments .com_info li {
  float: left;
  margin: 0 15px 15px 0;
}

.zbtool-comments .com_info li input {
  width: 160px;
  height: 30px;
  line-height: 30px;
  padding: 0 0 0 4px;
  border: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  font-size: 14px;
}

.zbtool-comments .com_box {
  margin-bottom: 15px;
}

.zbtool-comments .com_box textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  border: 1px solid #ddd;
  border-radius: 0;
  padding: 10px;
  background: #fff;
  font-size: 14px;
  line-height: 1.6;
}

.zbtool-comments .com_info button {
  background: #5781bf;
  border: 0;
  border-radius: 3px;
  padding: 8px 20px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.zbtool-comments .com_info button:hover {
  background: #6b90c7;
}

.zbtool-comments .comlist ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid #ededed;
}

.zbtool-comments .comlist ul ul {
  margin-left: 28px;
}

.zbtool-comments .comlist li {
  display: block;
  overflow: hidden;
  padding: 15px 0;
}

.zbtool-comments .comlist li img {
  float: left;
  width: 40px;
  height: 40px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
}

.zbtool-comments .comlist li .clbody {
  margin-left: 50px;
}

.zbtool-comments .clbody .cinfo {
  display: block;
  overflow: hidden;
}

.zbtool-comments .clbody .cinfo h5 {
  float: left;
  margin: 0;
  font-size: 14px;
  line-height: 18px;
  font-weight: 400;
}

.zbtool-comments .clbody .cinfo span {
  float: right;
}

.zbtool-comments .clbody em {
  display: block;
  margin-top: 0;
  color: #888;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  font-style: normal;
}

.zbtool-comments .clbody p {
  margin: 0;
  line-height: 24px;
  color: #4a4a4a;
  overflow: hidden;
}

.pagebar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagebar a,
.pagebar .now-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #d6deea;
  text-decoration: none;
  color: #334155;
  background: #fff;
}

.pagebar .now-page {
  background: #eef6ff;
  border-color: #c8def6;
  color: #225282;
}

@media (max-width: 980px) {
  .bmi-layout,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .result-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .input-grid,
  .metric-strip,
  .guide-grid,
  .zbtool-comments .com_info ul {
    grid-template-columns: 1fr;
  }

  .tool-block {
    padding: 18px;
    border-radius: 18px;
  }

  .control input,
  .metric-chip,
  .formula-box,
  .result-row,
  .guide-card {
    border-radius: 18px;
  }

  .range-table {
    min-width: 100%;
  }

  .zbtool-comments .comlist ul ul {
    margin-left: 16px;
  }
}
