prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  A lone `Static` results in a `TooManyMatches` error when using `query_one`
  I've not dived into this beyond knocking up this example to isolate what I saw (about to head out of the door but wanted to record this as a reminder). With 0.27.0 (perhaps before too, just noting the version here for the record), this code:
  
  ```python
  from textual.app     import App, ComposeResult
  from textual.widgets import Static
  
  class OneStatic( App[ None ] ):
  
      def compose( self ) -> ComposeResult:
          yield Static()
  
      def on_mount( self ) -> None:
          self.query_one( Static ).update( "Hello, World!" )
  
  if __name__ == "__main__":
      OneStatic().run()
  ```
  
  results in a `TooManyMatches` error being raised from the `query_one`. With very early testing this only seems to be the case with `Static` (at least, I tested with `Label` and `Button` and they're fine).
  
  I think most people would rightly find this surprising.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/textual/widgets/_tooltip.py`
  Content:
  ```
  1 from __future__ import annotations
  2 
  3 from textual.widgets import Static
  4 
  5 
  6 class Tooltip(Static):
  7     DEFAULT_CSS = """
  8     Tooltip {
  9         layer: _tooltips;
  10         margin: 1 2;
  11         padding: 1 2;
  12         background: $panel;
  13         width: auto;
  14         height: auto;
  15         constrain: inflect;
  16         max-width: 40;
  17         display: none;
  18     }
  19     """
  20
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/textual/widgets/_tooltip.py b/src/textual/widgets/_tooltip.py
  --- a/src/textual/widgets/_tooltip.py
  +++ b/src/textual/widgets/_tooltip.py
  @@ -3,7 +3,7 @@
   from textual.widgets import Static
   
   
  -class Tooltip(Static):
  +class Tooltip(Static, inherit_css=False):
       DEFAULT_CSS = """
       Tooltip {
           layer: _tooltips;
  
verification_info: {"golden_diff": "diff --git a/src/textual/widgets/_tooltip.py b/src/textual/widgets/_tooltip.py\n--- a/src/textual/widgets/_tooltip.py\n+++ b/src/textual/widgets/_tooltip.py\n@@ -3,7 +3,7 @@\n from textual.widgets import Static\n \n \n-class Tooltip(Static):\n+class Tooltip(Static, inherit_css=False):\n     DEFAULT_CSS = \"\"\"\n     Tooltip {\n         layer: _tooltips;\n", "issue": "A lone `Static` results in a `TooManyMatches` error when using `query_one`\nI've not dived into this beyond knocking up this example to isolate what I saw (about to head out of the door but wanted to record this as a reminder). With 0.27.0 (perhaps before too, just noting the version here for the record), this code:\r\n\r\n```python\r\nfrom textual.app     import App, ComposeResult\r\nfrom textual.widgets import Static\r\n\r\nclass OneStatic( App[ None ] ):\r\n\r\n    def compose( self ) -> ComposeResult:\r\n        yield Static()\r\n\r\n    def on_mount( self ) -> None:\r\n        self.query_one( Static ).update( \"Hello, World!\" )\r\n\r\nif __name__ == \"__main__\":\r\n    OneStatic().run()\r\n```\r\n\r\nresults in a `TooManyMatches` error being raised from the `query_one`. With very early testing this only seems to be the case with `Static` (at least, I tested with `Label` and `Button` and they're fine).\r\n\r\nI think most people would rightly find this surprising.\n", "before_files": [{"content": "from __future__ import annotations\n\nfrom textual.widgets import Static\n\n\nclass Tooltip(Static):\n    DEFAULT_CSS = \"\"\"\n    Tooltip {\n        layer: _tooltips;\n        margin: 1 2;\n        padding: 1 2;\n        background: $panel;\n        width: auto;\n        height: auto;\n        constrain: inflect;\n        max-width: 40;\n        display: none;\n    }\n    \"\"\"\n", "path": "src/textual/widgets/_tooltip.py"}], "after_files": [{"content": "from __future__ import annotations\n\nfrom textual.widgets import Static\n\n\nclass Tooltip(Static, inherit_css=False):\n    DEFAULT_CSS = \"\"\"\n    Tooltip {\n        layer: _tooltips;\n        margin: 1 2;\n        padding: 1 2;\n        background: $panel;\n        width: auto;\n        height: auto;\n        constrain: inflect;\n        max-width: 40;\n        display: none;\n    }\n    \"\"\"\n", "path": "src/textual/widgets/_tooltip.py"}]}