#app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 0.75rem;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

#app-header h1 {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-name-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.header-icon-btn {
  flex: none;
  border: none;
  background: transparent;
  padding: 0.2em 0.35em;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--color-text-muted);
}

.header-icon-btn:hover {
  background: var(--color-bg);
  color: inherit;
}

.menu-root {
  position: relative;
}

#menu-button {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 6px;
  padding: 0.45em 0.75em;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  padding: 0.4rem;
  z-index: 1000;
}

.menu-dropdown[hidden] {
  display: none;
}

.menu-dropdown li button {
  width: 100%;
  text-align: left;
  padding: 0.55em 0.7em;
  border: none;
  border-radius: 6px;
  background: transparent;
}

.menu-dropdown li button:hover {
  background: var(--color-bg);
}

.menu-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.35rem 0.2rem;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.view-toggle button {
  padding: 0.4em 0.85em;
  background: var(--color-surface);
  border: none;
  font-size: 0.85rem;
}

.view-toggle button.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

/* Sidebar */
#sidebar {
  display: flex;
  flex-direction: column;
}

.address-search {
  position: relative;
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

#address-search-input {
  width: 100%;
  padding: 0.6em 0.75em;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.search-results {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  top: 100%;
  margin-top: 2px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  max-height: 260px;
  overflow-y: auto;
  z-index: 900;
}

.search-results[hidden] {
  display: none;
}

.search-results li button {
  width: 100%;
  text-align: left;
  padding: 0.6em 0.75em;
  background: transparent;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.search-results li:last-child button {
  border-bottom: none;
}

.search-results li button:hover {
  background: var(--color-bg);
}

.pin-list {
  flex: 1;
  overflow-y: auto;
}

.pin-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.pin-row:hover {
  background: var(--color-bg);
}

.pin-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pin-row-main {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.pin-row-street {
  font-weight: 600;
  font-size: 0.9rem;
}

.pin-row-address {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pin-row-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
  border: none;
  font-size: 1rem;
}

.icon-btn:hover {
  background: var(--color-border);
}

.pin-list-empty {
  padding: 1.5rem 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-align: center;
}
