@layer base {
  .layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-family-base);
  }

  .header {
    flex-shrink: 0;
    position: relative;
    z-index: var(--z-nav);
  }

  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: var(--z-content);
  }

  /* Ensure proper spacing and layout */
  .main > * {
    flex-shrink: 0;
  }

  /* Allow the last child in main to grow if needed */
  .main > *:last-child {
    flex-grow: 1;
  }

  /* Responsive adjustments */
  @media (max-width: 768px) {
    .layout {
      min-height: 100vh;
    }
  }

  /* Ensure proper stacking context */
  .layout {
    position: relative;
    isolation: isolate;
  }

  /* Handle potential overflow issues */
  .main {
    overflow-x: hidden;
    width: 100%;
  }

  /* Dark mode support - inherits from global styles */
  :global(.dark) .layout {
    background-color: var(--background);
    color: var(--foreground);
  }
}