main.container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 1rem;
}

#panel {
  max-width: 640px;
  width: 100%;
}

#person-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#tab-list {
  display: flex;
  flex: 1;
  gap: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--pico-muted-color);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--pico-primary);
}

.tab-btn.active {
  color: var(--pico-primary);
  border-bottom-color: var(--pico-primary);
}

.tab-add {
  font-size: 1.1rem;
  font-weight: bold;
  padding: 0.5rem 0.65rem;
  color: var(--pico-primary);
}

.tab-add:hover {
  color: var(--pico-primary-hover);
}

#edit-dropdown {
  position: relative;
  flex-shrink: 0;
}

#btn-edit-toggle {
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
}

#edit-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  min-width: 170px;
  background: var(--pico-card-background-color, #1e1e1e);
  border: 1px solid var(--pico-muted-border-color, rgba(255,255,255,0.1));
  border-radius: var(--pico-border-radius, 6px);
  padding: 0.4rem 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

#edit-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background: none;
  border: none;
  text-align: left;
  color: var(--pico-color);
  cursor: pointer;
}

#edit-menu button:hover {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

#edit-menu hr {
  margin: 0.3rem 0;
  border: none;
  border-top: 1px solid var(--pico-muted-border-color, rgba(255,255,255,0.1));
}

#edit-menu button.contrast {
  color: var(--pico-del-color);
}

#edit-menu button.contrast:hover {
  background: var(--pico-del-color);
  color: #fff;
}

#chart-container {
  margin-top: 0.5rem;
}

#chart-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

#chart-nav button {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
}

#chart-label {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  min-width: 4rem;
  text-align: center;
}

#chart-slider-wrap {
  overflow: hidden;
}
#chart-slider {
  width: 100%;
}
#chart-wrapper {
  position: relative;
}

#donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

#donut-center-label .kcal-total {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--pico-color);
}

#donut-center-label .kcal-goal {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
}

#donut-center-label .kcal-over {
  font-size: 0.75rem;
  color: var(--pico-del-color);
  margin-top: 0.2rem;
}

#range-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

#range-buttons .range-btn {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
}

#range-buttons .range-btn.active {
  background: var(--pico-primary);
  border-color: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

#weight-chart {
  max-height: 280px;
  width: 100%;
}

#add-weight-dialog article {
  max-width: 360px;
}

#measurements-dialog article {
  max-width: 520px;
}

#measurements-dialog figure {
  margin-bottom: 0;
}

#measurements-dialog table {
  margin-bottom: 0;
}

#measurements-dialog td:last-child,
#measurements-dialog th:last-child {
  width: 3rem;
  text-align: center;
}

#measurements-dialog td:last-child button {
  padding: 0.125rem 0.5rem;
  margin: 0;
  width: auto;
}

#pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

#page-info {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.weight-value {
  white-space: nowrap;
}

#food-search-wrapper {
  position: relative;
  margin-bottom: 0.75rem;
}

.dropdown-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: var(--pico-card-background-color, #1e1e1e);
  border: 1px solid var(--pico-muted-border-color, rgba(255,255,255,0.1));
  border-radius: var(--pico-border-radius, 6px);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.dropdown-results button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  background: none;
  border: none;
  text-align: left;
  color: var(--pico-color);
  cursor: pointer;
}

.dropdown-results button:hover {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

.dropdown-results button span {
  font-size: 0.75rem;
}

#food-section table {
  margin-bottom: 0;
}

#food-section td:last-child,
#food-section th:last-child {
  width: 3rem;
  text-align: center;
}

#food-section td:last-child button {
  padding: 0.125rem 0.5rem;
  margin: 0;
  width: auto;
}

#no-foods {
  text-align: center;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

dialog article {
  max-width: 360px;
}

dialog footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (max-width: 576px) {
  #panel > header {
    display: none;
  }
}
