* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text-dark);
  background: var(--surface-bg);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--safe-top);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.01em;
}

p {
  margin: 0;
  line-height: 1.55;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: var(--fs-sm);
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  background: var(--surface-bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.app-main {
  flex: 1;
  padding: 0 var(--space-4) calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--space-5));
}

.page-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-4);
  color: var(--warm-white);
}

.section-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-md);
  margin: var(--space-5) 0 var(--space-3);
  color: var(--warm-white);
}

/* Heading used as the first element *inside* a white .card — needs dark
   text, unlike .section-title which sits directly on the dark app
   background between cards. */
.card-heading {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-md);
  margin: 0 0 var(--space-3);
  color: var(--text-dark);
}

/* Wider viewport (tablet/desktop preview of the parent app) */
@media (min-width: 640px) {
  .app-shell {
    margin-top: var(--space-5);
    min-height: calc(100% - var(--space-5) * 2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
  }
}
