.top-bar {
  z-index: 1000;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: calc(0.75rem + env(safe-area-inset-top)) 1rem 0.75rem;
  background: rgba(255, 252, 244, 0.96);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.title-block {
  min-width: 0;
}

.top-bar h1 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.top-bar p {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #4a5b3f;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.floating-add-button {
  position: absolute;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 900;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  padding: 0;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.28);
}

.place-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1200;
  max-height: calc(100vh - 1rem);
  padding: 0.65rem 1rem calc(1rem + env(safe-area-inset-bottom));
  border-radius: 1.25rem 1.25rem 0 0;
  background: #fffaf0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
}

.sheet-handle {
  width: 3rem;
  height: 0.28rem;
  margin: 0.1rem auto 0.75rem;
  border-radius: 999px;
  background: #c9c0ad;
}

.place-sheet h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

#placeForm {
  display: grid;
  gap: 0.9rem;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.sheet-help {
  margin: 0 0 1rem;
  color: #4a5b3f;
  line-height: 1.4;
}

.data-actions {
  display: grid;
  gap: 0.75rem;
}

.data-actions button {
  width: 100%;
}

@media (max-width: 520px) {
  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions button {
    flex: 1;
  }

  .sheet-actions button {
    flex: 1;
  }

  .sheet-actions .danger-button {
    flex-basis: 100%;
    margin-right: 0;
  }
}


.filter-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.category-filter-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
}

.category-filter-option {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e0d6c5;
  border-radius: 0.9rem;
  background: #fffdf8;
  font-weight: 700;
}

.category-filter-option input {
  width: auto;
  transform: scale(1.15);
}

.category-filter-option span {
  line-height: 1.2;
}


.place-sheet {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}


.filter-sheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 1rem);
}

.place-sheet[hidden],
.sheet-backdrop[hidden] {
  display: none !important;
}


#filterButton[data-active="true"] {
  font-weight: 800;
  outline: 2px solid rgba(42, 37, 32, 0.35);
  outline-offset: 2px;
}
