/* Anesthguide Tools - Basal metabolism */

.agtm-tool,
.agtm-tool * {
  box-sizing: border-box;
}

.agtm-tool {
  --agtm-surface: #ffffff;
  --agtm-surface-soft: #f7f9fc;
  --agtm-border: #d6dde8;
  --agtm-text: #1d2738;
  --agtm-muted: #5b667a;
  --agtm-primary: #0f5fd8;
  --agtm-primary-hover: #0a4db3;
  --agtm-success: #0a7a2f;
  --agtm-warn: #8a5b00;
  --agtm-danger: #b00020;
  --agtm-radius: 14px;
  --agtm-shadow: 0 10px 24px rgba(16, 33, 64, 0.08);
  --agtm-shadow-soft: 0 4px 10px rgba(16, 33, 64, 0.06);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font: inherit;
  color: var(--agtm-text);
}

.agtm-tool :is(input, select, button) {
  font: inherit;
}

.agtm-tool__header { margin: 0 0 .5rem; }

.agtm-tool__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--agtm-text);
  font-weight: 750;
}

.agtm-card {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--agtm-border);
  border-radius: var(--agtm-radius);
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, var(--agtm-surface-soft) 100%);
  box-shadow: var(--agtm-shadow-soft);
}

.agtm-form { margin: 0; }

.agtm-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agtm-grid > * { min-width: 0; }

@media (max-width: 720px) {
  .agtm-grid { grid-template-columns: 1fr; }
}

.agtm-field label {
  display: block;
  font-weight: 600;
  margin: 0 0 5px;
  font-size: .95rem;
}

.agtm-field input,
.agtm-field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--agtm-border);
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 16px;
  line-height: 1.2;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.agtm-field input:focus,
.agtm-field select:focus {
  outline: none;
  border-color: var(--agtm-primary);
  box-shadow: 0 0 0 3px rgba(15, 95, 216, 0.14);
}

.agtm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.agtm-btn {
  appearance: none;
  border: 1px solid var(--agtm-border);
  background: rgba(0, 0, 0, .03);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.1;
  transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, color .14s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.agtm-btn:hover {
  transform: translateY(-1px);
}

.agtm-btn--primary {
  background: linear-gradient(180deg, #2f7fff 0%, var(--agtm-primary) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--agtm-shadow-soft);
}

.agtm-btn--primary:hover {
  background: linear-gradient(180deg, #2a74e7 0%, var(--agtm-primary-hover) 100%);
}

.agtm-status {
  margin-top: 8px;
  font-size: .92rem;
}

.agtm-status[data-type="ok"] { color: var(--agtm-success); }
.agtm-status[data-type="warn"] { color: var(--agtm-warn); }
.agtm-status[data-type="error"] { color: var(--agtm-danger); }

.agtm-result {
  margin-top: 10px;
  border: 1px solid var(--agtm-border);
  background: #fff;
  box-shadow: var(--agtm-shadow);
}

.agtm-result__top {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agtm-result__top > * { min-width: 0; }

@media (max-width: 920px) {
  .agtm-result__top { grid-template-columns: 1fr; }
}

.agtm-result__value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  color: #102445;
}

.agtm-result__label {
  opacity: .85;
  font-size: .95rem;
}

.agtm-divider {
  height: 1px;
  background: rgba(0, 0, 0, .10);
  margin: 10px 0;
}

.agtm-result__bottom { font-size: .95rem; }
.agtm-result__row { margin: 6px 0; }

.agtm-details summary {
  cursor: pointer;
  font-weight: 700;
  margin-top: 6px;
}

.agtm-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.agtm-disclaimer {
  margin: 8px 0 0;
  font-size: .88rem;
  color: var(--agtm-muted);
}

@media print {
  body * {
    visibility: hidden !important;
  }

  .agtm-result,
  .agtm-result * {
    visibility: visible !important;
  }

  .agtm-result {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 12mm !important;
  }

  .agtm-actions,
  .agtm-status,
  .agtm-details summary {
    display: none !important;
  }

  .agtm-result__value { font-size: 18pt !important; }
  .agtm-result__label,
  .agtm-result__bottom { font-size: 11pt !important; }

  @page { margin: 10mm; }
}
