.app-shell {
  min-height: 100vh;
}

.top-bar {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.top-bar__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.top-bar__brand {
  font-size: var(--font-size-3);
  font-weight: 700;
}

.top-bar__controls {
  display: grid;
  gap: var(--space-2);
}

.top-bar__search {
  position: relative;
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.top-bar__search-input {
  min-width: 0;
}

.top-bar__suggestions {
  position: absolute;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  z-index: 20;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  background: var(--color-surface);
  box-shadow: var(--shadow-2);
  max-height: 18rem;
  overflow-y: auto;
}

.top-bar__suggestions-list {
  list-style: none;
  margin: 0;
  padding: var(--space-1);
}

.top-bar__suggestion-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-1);
  padding: var(--space-2);
}

.top-bar__suggestion-link:hover,
.top-bar__suggestion-link:focus-visible {
  background: var(--color-surface-muted);
}

.top-bar__suggestion-title {
  margin: 0;
  font-weight: 600;
}

.top-bar__suggestion-meta {
  margin: var(--space-1) 0 0;
  color: var(--color-muted);
  font-size: var(--font-size-1);
}

.top-bar__actions {
  display: flex;
  gap: var(--space-2);
}

.top-bar__email {
  color: var(--color-muted);
  font-size: var(--font-size-1);
}

.app-shell__main {
  width: min(100%, 52rem);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}

.app-shell__flash {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-1);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.app-shell__flash--alert {
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-color: color-mix(in srgb, var(--color-warning-text) 18%, var(--color-border));
}

.page-header {
  margin-bottom: var(--space-5);
}

.page-header__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.page-header__title {
  font-size: var(--font-size-4);
}

.page-header__subtitle {
  margin-top: var(--space-2);
  color: var(--color-muted);
}

@media (min-width: 48rem) {
  .top-bar {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .top-bar__controls {
    justify-self: end;
    width: min(100%, 30rem);
  }

  .page-header__row {
    flex-direction: row;
    align-items: start;
    justify-content: space-between;
  }
}
