* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  font-size: 16px;
  line-height: 1.4;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

input {
  font: inherit;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: calc(var(--safe-top) + 12px) 16px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.app-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}

.app-meta {
  font-size: 12px;
  color: var(--fg-dim);
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.loading-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--fg-dim);
}

/* hide header in detail and customer modes */
#app[data-view="detail"] .app-header,
body[data-mode="customer"] .app-header {
  display: none;
}
