/* Opt-in pilot only. Existing routes do not load this module in increment 1. */
[data-gl-theme] {
  color: var(--gl-foreground);
  background-color: var(--gl-background);
  font-family: var(--gl-font-sans);
  font-size: 16px;
  line-height: 1.5;
}
[data-gl-theme] :where(.gl-button, .gl-input, .gl-card, .gl-dialog) { box-sizing: border-box; }
[data-gl-theme] .gl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gl-space-2);
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: var(--gl-space-2) var(--gl-space-4);
  border: 1px solid transparent;
  border-radius: var(--gl-radius-control);
  background-color: var(--gl-primary);
  color: var(--gl-primary-foreground);
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--gl-motion-feedback), color var(--gl-motion-feedback);
}
[data-gl-theme] .gl-button--secondary {
  color: var(--gl-secondary-foreground);
  background-color: var(--gl-secondary);
  border-color: var(--gl-input);
}
[data-gl-theme] .gl-button--danger {
  color: var(--gl-destructive-foreground);
  background-color: var(--gl-destructive);
}
[data-gl-theme] .gl-button:disabled {
  color: var(--gl-muted-foreground);
  background-color: var(--gl-muted);
  border-color: var(--gl-input);
  cursor: not-allowed;
  opacity: 1;
}
[data-gl-theme] .gl-button:not(:disabled):hover { text-decoration: underline; text-underline-offset: .2em; }
[data-gl-theme] :where(.gl-button, .gl-input, .gl-link):focus-visible,
[data-gl-theme] .gl-dialog:focus-visible {
  outline: 3px solid var(--gl-ring);
  outline-offset: 3px;
}
[data-gl-theme] .gl-field { display: grid; gap: var(--gl-space-2); min-inline-size: 0; }
[data-gl-theme] .gl-label { font-weight: 600; }
[data-gl-theme] .gl-input {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: var(--gl-space-2) var(--gl-space-3);
  border: 1px solid var(--gl-input);
  border-radius: var(--gl-radius-control);
  background-color: var(--gl-card);
  color: var(--gl-card-foreground);
  font: inherit;
}
[data-gl-theme] .gl-input::placeholder { color: var(--gl-muted-foreground); opacity: 1; }
[data-gl-theme] .gl-input[aria-invalid="true"] { border-color: var(--gl-destructive); }
[data-gl-theme] .gl-help { color: var(--gl-muted-foreground); font-size: .875rem; }
[data-gl-theme] .gl-error { color: var(--gl-destructive); font-size: .875rem; }
[data-gl-theme] .gl-link { color: var(--gl-primary); text-decoration: underline; text-underline-offset: .2em; }
[data-gl-theme] .gl-card {
  min-inline-size: 0;
  padding: var(--gl-space-6);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius-card);
  color: var(--gl-card-foreground);
  background-color: var(--gl-card);
}
[data-gl-theme] .gl-heading { font-family: var(--gl-font-serif); line-height: 1.2; font-weight: 500; }
[data-gl-theme] .gl-number { font-variant-numeric: tabular-nums; }
[data-gl-theme] .gl-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--gl-space-1);
  padding: var(--gl-space-1) var(--gl-space-2);
  border-radius: var(--gl-radius-control);
  color: var(--gl-accent-foreground);
  background-color: var(--gl-accent);
  font-size: .875rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
[data-gl-theme] .gl-dialog {
  inline-size: calc(100% - 32px);
  max-inline-size: 42rem;
  max-block-size: calc(100dvh - 32px);
  overflow: auto;
  padding: var(--gl-space-6);
  border: 1px solid var(--gl-input);
  border-radius: var(--gl-radius-dialog);
  color: var(--gl-popover-foreground);
  background-color: var(--gl-popover);
}
[data-gl-theme] .gl-dialog::backdrop { background: rgb(0 0 0 / .65); }
@media (max-width: 480px) {
  [data-gl-theme] :where(.gl-card, .gl-dialog) { padding: var(--gl-space-4); }
}
@media (prefers-reduced-motion: reduce) {
  [data-gl-theme] .gl-button { transition: none; }
}
@media (forced-colors: active) {
  [data-gl-theme] :where(.gl-button, .gl-input, .gl-dialog) { border-color: ButtonText; }
  [data-gl-theme] :where(.gl-button, .gl-input, .gl-link):focus-visible { outline-color: Highlight; }
}
