*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

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

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-primary);
  color: var(--sv-on-primary, #fff);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-base);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--sv-shadow-sm);
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--color-primary-hover); text-decoration: none; }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-surface-raised);
  color: var(--color-text);
  border: 1px solid var(--sv-border-2, var(--color-border));
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-base);
  text-decoration: none;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--sv-surface-2, var(--color-surface)); text-decoration: none; }

.btn-text {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  background: none;
  color: var(--color-text-secondary);
  border: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
}
.btn-text:hover { color: var(--color-text); }

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-sm { font-size: var(--font-size-sm); }
.text-center { text-align: center; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* App bar — full-width cream top bar with a serif wordmark. */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  padding: 0 28px;
  height: 62px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.page-header h1 {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

.page-header-actions { display: flex; gap: 10px; align-items: center; }

/* Wordmark is now the brand mark itself — editorial serif, ink-colored. */
.logo {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1;
}
.logo:hover { text-decoration: none; }

@media (max-width: 640px) {
  .page-header { padding: 0 16px; height: 56px; }
  .container { padding: 0 var(--spacing-sm); }
}
