/**
 * TSTP UI structure contract. Colors ONLY via var(--tstp-*). No hardcoded colors.
 * Layout: stacked cards, spacing scale, typography scale.
 */
:root {
  --tstp-radius_card: 14px;
  --tstp-radius_input: 12px;
  --tstp-radius_button: 12px;
  --tstp-space-1: 4px;
  --tstp-space-2: 8px;
  --tstp-space-3: 12px;
  --tstp-space-4: 16px;
  --tstp-space-5: 20px;
  --tstp-space-6: 24px;
  --tstp-font-title: 20px;
  --tstp-font-subtitle: 16px;
  --tstp-font-body: 14px;
  --tstp-font-small: 12px;
  --tstp-line-title: 1.2;
  --tstp-line-body: 1.35;
  --tstp-maxw: 920px;
}

* { box-sizing: border-box; }

.tstp-app {
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--tstp-font-body);
  line-height: var(--tstp-line-body);
  background: var(--tstp-bg);
  color: var(--tstp-text);
  margin: 0;
}

.tstp-container {
  padding: var(--tstp-space-3);
  max-width: var(--tstp-maxw);
  margin: 0 auto;
}

@media (min-width: 641px) {
  .tstp-container { padding: var(--tstp-space-4); }
}

.tstp-header {
  background: var(--tstp-surface);
  border: 1px solid var(--tstp-border);
  border-radius: var(--tstp-radius_card);
  padding: var(--tstp-space-3) var(--tstp-space-4);
  margin-bottom: var(--tstp-space-4);
}

.tstp-stack {
  display: flex;
  flex-direction: column;
  gap: var(--tstp-space-3);
}

.tstp-card {
  background: var(--tstp-surface);
  border: 1px solid var(--tstp-border);
  border-radius: var(--tstp-radius_card);
  padding: var(--tstp-space-3);
  width: 100%;
  box-shadow: 0 1px 3px var(--tstp-shadow);
}

@media (min-width: 641px) {
  .tstp-card { padding: var(--tstp-space-4); }
}

.tstp-card-title {
  font-size: var(--tstp-font-title);
  font-weight: 700;
  line-height: var(--tstp-line-title);
  margin: 0 0 var(--tstp-space-2) 0;
  color: var(--tstp-text);
}

.tstp-card-body {
  font-size: var(--tstp-font-body);
  color: var(--tstp-text);
}

.tstp-btn {
  min-height: 44px;
  padding: 0 var(--tstp-space-4);
  border-radius: var(--tstp-radius_button);
  border: 1px solid transparent;
  font-size: var(--tstp-font-body);
  font-weight: 600;
  cursor: pointer;
  outline-offset: 2px;
}

.tstp-btn:focus-visible {
  outline: 2px solid var(--tstp-focus_ring);
}

.tstp-btn-primary {
  background: var(--tstp-accent);
  color: var(--tstp-surface);
  border-color: var(--tstp-accent);
}

.tstp-btn-secondary {
  background: var(--tstp-surface);
  color: var(--tstp-text);
  border-color: var(--tstp-border);
}

.tstp-input {
  min-height: 44px;
  padding: 0 var(--tstp-space-3);
  border-radius: var(--tstp-radius_input);
  border: 1px solid var(--tstp-border);
  background: var(--tstp-surface);
  color: var(--tstp-text);
  font-size: var(--tstp-font-body);
}

.tstp-input:focus {
  outline: none;
  border-color: var(--tstp-focus_ring);
  box-shadow: 0 0 0 2px var(--tstp-focus_ring);
}

.tstp-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tstp-space-2);
  align-items: center;
}

.tstp-muted {
  color: var(--tstp-text_muted);
  font-size: var(--tstp-font-small);
}

.tstp-link {
  color: var(--tstp-accent);
  text-decoration: none;
}

.tstp-link:hover {
  text-decoration: underline;
}

.tstp-link:focus-visible {
  outline: 2px solid var(--tstp-focus_ring);
  outline-offset: 2px;
}
