/* APN v94 — antropometria horizontal, resultado compacto e adaptação retrato */
.anthro-admin {
  --anthro-panel: #ffffff;
  --anthro-panel-soft: #f7f5fa;
  --anthro-line: #dcd6e4;
  --anthro-text: #17131d;
  --anthro-muted: #6f6777;
  --anthro-shadow: rgba(41, 24, 58, 0.09);
}

html[data-theme="dark"] .anthro-admin {
  --anthro-panel: #111316;
  --anthro-panel-soft: #1a1d21;
  --anthro-line: #373b42;
  --anthro-text: #f7f7f8;
  --anthro-muted: #adb1b8;
  --anthro-shadow: rgba(0, 0, 0, 0.28);
}

.anthro-admin form,
html[data-theme="light"] .anthro-admin form {
  display: block !important;
}

.anthro-workspace,
.anthro-workspace.has-results,
.anthro-workspace.without-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px;
  min-width: 0;
}

.anthro-entry-panel,
.anthro-results {
  min-width: 0;
}

.anthro-entry-panel {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--anthro-line);
  border-radius: 16px;
  background: var(--anthro-panel-soft);
}

.anthro-admin .anthro-fields {
  gap: 10px !important;
}

.anthro-workspace .anthro-fields.fixed,
.anthro-workspace.has-results .anthro-fields.fixed,
.anthro-workspace.without-results .anthro-fields.fixed {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.anthro-workspace .anthro-fields.variables,
.anthro-workspace.has-results .anthro-fields.variables,
.anthro-workspace.without-results .anthro-fields.variables {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

.anthro-admin .anthro-fields.variables {
  margin-top: 0 !important;
  padding-top: 11px;
  border-top: 1px solid var(--anthro-line);
}

.anthro-admin .anthro-fields label {
  gap: 4px !important;
  min-width: 0;
  color: var(--anthro-text) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.anthro-admin .anthro-fields input,
.anthro-admin .anthro-fields select {
  width: 100%;
  min-width: 0;
  min-height: 38px !important;
  padding: 7px 10px !important;
  border-color: var(--anthro-line) !important;
  border-radius: 10px !important;
  background: var(--anthro-panel) !important;
  color: var(--anthro-text) !important;
  -webkit-text-fill-color: var(--anthro-text) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

.anthro-fixed-action {
  align-items: end !important;
  grid-column: auto !important;
}

.anthro-fixed-action .anthro-fixed-save {
  width: 100% !important;
  min-height: 38px !important;
  padding: 7px 11px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
}

.anthro-entry-panel > .notice,
.anthro-entry-panel > .anthro-editing-banner {
  margin: 0 !important;
}

.anthro-results {
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid var(--anthro-line) !important;
  border-radius: 16px !important;
  background: var(--anthro-panel) !important;
  color: var(--anthro-text) !important;
  box-shadow: 0 12px 28px var(--anthro-shadow);
}

.anthro-result-top {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid var(--anthro-line) !important;
  background: var(--anthro-panel-soft) !important;
}

.anthro-result-top > span {
  display: flex !important;
  min-width: 0;
  min-height: 48px;
  flex-direction: column;
  justify-content: center;
  gap: 2px !important;
  padding: 6px 12px;
  border-right: 1px solid var(--anthro-line);
}

.anthro-result-top > span:last-child {
  border-right: 0;
}

.anthro-result-top small {
  overflow: hidden;
  color: var(--anthro-muted) !important;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anthro-result-top strong {
  overflow: hidden;
  color: var(--anthro-text) !important;
  font-size: 14px !important;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anthro-result-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.36fr);
  align-items: stretch;
  gap: 12px;
  padding: 12px;
}

.anthro-result-table-wrap {
  width: 100%;
  min-width: 0;
  overflow: hidden !important;
  border: 1px solid var(--anthro-line);
  border-radius: 12px;
}

.anthro-result-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.anthro-result-table th,
.anthro-result-table td {
  padding: 7px 10px !important;
  border-bottom: 1px solid var(--anthro-line) !important;
  color: var(--anthro-text) !important;
  text-align: left;
  font-size: 10.5px !important;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.anthro-result-table th:first-child {
  width: 39%;
}

.anthro-result-table th:nth-child(2) {
  width: 25%;
}

.anthro-result-table th:nth-child(3) {
  width: 36%;
}

.anthro-result-table thead th,
html[data-theme="light"] .anthro-result-table thead th {
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  background: #ffffff !important;
  color: #17131d !important;
  -webkit-text-fill-color: #17131d !important;
  font-size: 9px !important;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html[data-theme="dark"] .anthro-result-table thead th {
  background: #202328 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.anthro-result-table tbody th {
  font-weight: 800;
}

.anthro-result-table tbody td {
  font-weight: 400;
}

.anthro-result-table tbody tr:last-child th,
.anthro-result-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.anthro-result-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--anthro-panel-soft) 70%, transparent);
}

.anthro-pie-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--anthro-line);
  border-radius: 12px;
  background: var(--anthro-panel-soft);
}

.anthro-pie-heading {
  align-self: stretch;
  margin-bottom: 5px;
  text-align: left;
}

.anthro-pie-heading strong {
  display: block;
}

.anthro-pie-heading strong {
  color: var(--anthro-text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.anthro-pie-visual {
  position: relative;
  width: clamp(150px, 14vw, 196px);
  aspect-ratio: 1;
  flex: 0 0 auto;
}

.anthro-pie-chart {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: 0 8px 20px var(--anthro-shadow);
}

.anthro-pie-chart > span {
  display: flex;
  width: 57%;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 50%;
  background: var(--anthro-panel);
  color: var(--anthro-text);
  box-shadow: inset 0 0 0 1px var(--anthro-line);
}

.anthro-pie-chart strong {
  max-width: 86%;
  overflow: hidden;
  font-size: 15px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anthro-pie-chart small {
  margin-top: 3px;
  color: var(--anthro-muted);
  font-size: 9px;
  font-weight: 700;
}

.anthro-pie-percent {
  position: absolute;
  z-index: 2;
  translate: -50% -50%;
  color: #ffffff;
  font-size: clamp(7px, 0.65vw, 9px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62);
  white-space: nowrap;
}

.anthro-pie-percent.is-fat {
  color: #2d2208;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.42);
}

.anthro-pie-legend {
  display: grid;
  width: 100%;
  gap: 5px;
  margin-top: 10px;
}

.anthro-pie-legend > div {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.anthro-pie-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.anthro-pie-legend span {
  overflow: hidden;
  color: var(--anthro-muted);
  font-size: 9px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anthro-pie-legend strong {
  color: var(--anthro-text);
  font-size: 9px;
  white-space: nowrap;
}

.anthro-pie-legend small {
  min-width: 30px;
  color: var(--anthro-muted);
  font-size: 8px;
  font-weight: 700;
  text-align: right;
}

.anthro-admin .anthro-circumferences {
  margin-top: 14px !important;
  padding: 14px !important;
}

.anthro-admin .circumference-fields {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.anthro-admin .anthro-actions {
  gap: 9px !important;
  margin-top: 14px !important;
}

@media (max-width: 1180px) {
  .anthro-workspace .anthro-fields.variables {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .anthro-admin .circumference-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 820px) {
  .anthro-workspace .anthro-fields.fixed {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .anthro-result-content {
    grid-template-columns: minmax(0, 1fr) minmax(205px, 0.42fr);
    gap: 8px;
    padding: 8px;
  }

  .anthro-result-table th,
  .anthro-result-table td {
    padding: 6px 7px !important;
    font-size: 9.5px !important;
  }

  .anthro-pie-panel {
    padding: 9px;
  }
}

@media (max-width: 680px) {
  .anthro-workspace .anthro-fields.variables,
  .anthro-admin .circumference-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .anthro-result-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anthro-result-top > span:nth-child(2) {
    border-right: 0;
  }

  .anthro-result-top > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--anthro-line);
  }

  .anthro-result-content {
    grid-template-columns: 1fr;
  }

  .anthro-pie-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 12px;
  }

  .anthro-pie-heading {
    grid-column: 1 / -1;
  }

  .anthro-pie-visual {
    width: 132px;
  }

  .anthro-pie-legend {
    align-self: center;
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .anthro-entry-panel {
    padding: 10px;
  }

  .anthro-workspace .anthro-fields.fixed,
  .anthro-workspace .anthro-fields.variables,
  .anthro-admin .circumference-fields {
    grid-template-columns: 1fr !important;
  }

  .anthro-result-table th:first-child {
    width: 36%;
  }

  .anthro-result-table th:nth-child(2) {
    width: 24%;
  }

  .anthro-result-table th:nth-child(3) {
    width: 40%;
  }
}
