* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
button:active:not(:disabled),
.button:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(1px);
  filter: brightness(0.95);
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 4px;
}
h1:focus {
  outline: none;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
}
h2 {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}
h3 {
  font-size: 1rem;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
small,
.small {
  font-size: 0.78rem;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--surface);
  padding: 1rem;
  z-index: 30;
}
.skip:focus {
  top: 1rem;
}

/* Shared component defaults. Historical demo overrides stay in styles.css. */
.muted {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.78rem;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.brand img {
  width: 220px;
  height: auto;
  display: block;
}
.logo-dark {
  display: none;
}
html[data-theme="dark"] .logo-dark {
  display: block;
}
html[data-theme="dark"] .logo-light {
  display: none;
}
.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 11px 18px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition:
    background 120ms,
    transform 120ms;
}
.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
html[data-theme="dark"]
  .button:not(.secondary):not(.danger):not(.success):not(.contextual) {
  color: #0b1020;
}
.button.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}
.button.success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}
.textlink {
  color: var(--brand);
  font-size: 0.85rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 20px;
}
.eyebrow {
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--accent-bg);
  color: var(--brand);
  white-space: nowrap;
}
.status:before {
  content: "";
  height: 5px;
  width: 5px;
  background: currentColor;
  border-radius: 50%;
}
.status.waiting {
  background: var(--warning-bg);
  color: var(--warning);
}
.status.done {
  background: var(--success-bg);
  color: var(--success);
}
.status.failed {
  background: var(--danger-bg);
  color: var(--danger);
}
.input,
select.input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 11px 12px;
  min-height: 44px;
  font-size: 0.8rem;
  max-width: 100%;
}
.stack {
  display: grid;
  gap: 20px;
}
.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 24px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.panel-head h2 {
  font-size: 1rem;
}
.error {
  color: var(--danger);
  font-size: 0.78rem;
  margin-top: 10px;
}
.result {
  color: var(--feedback-color);
  background: var(--feedback-bg);
  border: 1px solid var(--feedback-color);
  padding: 24px;
  border-radius: 10px;
}
.result h2 {
  margin-bottom: 10px;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feedback-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.result p {
  font-size: 0.875rem;
}
.result .button {
  margin-top: 20px;
}
/* Shared control boundaries and numerical alignment. */
.input,
select.input,
.preferences select {
  border: var(--control-border-width) solid var(--control-border);
  border-radius: var(--control-radius);
}
/* Long, explicit states remain readable in the mobile table. */
.status.validating {
  white-space: normal;
  max-width: 140px;
}
.status:before {
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .button:active {
    transform: none !important;
  }
}

/* Standalone defaults follow the approved control and feedback specimens.
   The demo retains its historical overrides after this file. */
.input,
select.input {
  font-size: 0.875rem;
}
textarea.input {
  resize: vertical;
}
.input:disabled {
  opacity: 1;
  background: var(--subtle);
  color: var(--muted);
  cursor: not-allowed;
}
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}
@media (max-width: 800px) {
  .input,
  select.input {
    font-size: 1rem;
  }
}
