/* Anesthguide Tools - WETBAGS-5A */

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

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

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

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

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

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

.agtw-form { margin: 0; }

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

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

.agtw-field input {
  width: 100%;
  max-width: 320px;
  min-width: 0;
  border: 1px solid var(--agtw-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;
}

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

.agtw-help {
  margin-top: 5px;
  color: var(--agtw-muted);
  font-size: .88rem;
}

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

.agtw-btn {
  appearance: none;
  border: 1px solid var(--agtw-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;
}

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

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

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

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

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

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

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

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

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

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

.agtw-result__value--small {
  font-size: 1rem;
  line-height: 1.25;
}

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

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

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

.agtw-section-title {
  margin: 12px 0 8px;
  font-size: 1rem;
  line-height: 1.2;
}

.agtw-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--agtw-border);
  border-radius: 12px;
  background: #fff;
}

.agtw-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.agtw-table th,
.agtw-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--agtw-border);
  text-align: left;
  vertical-align: top;
}

.agtw-table th {
  background: var(--agtw-surface-soft);
  font-weight: 750;
}

.agtw-table tr:last-child td {
  border-bottom: none;
}

.agtw-table__acronym {
  width: 68px;
  font-weight: 800;
  color: #102445;
}

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

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

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

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

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

  .agtw-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;
  }

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

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

  @page { margin: 10mm; }
}
