﻿* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-main);
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.shell {
  width: min(100%, var(--container-max));
  margin: 0 auto;
  padding: var(--space-3);
  overflow-x: clip;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.brand {
  font-size: var(--font-size-h2);
  font-weight: 600;
  color: var(--text-primary);
}

.app-frame {
  min-height: calc(100vh - 106px);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  padding: var(--space-5);
  overflow-x: clip;
}

#app-root {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

@media (max-width: 639px) {
  html,
  body,
  * {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  *::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .shell {
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
  }

  .app-frame {
    min-height: calc(100vh - 88px);
    padding: 12px;
  }

  #app-root {
    gap: var(--space-3);
  }
}
