/* Opt-in classes: safe to reuse beside the existing app styles. */
.ui-scope { font: 16px/1.5 var(--ui-font); color: var(--ui-text); }
.ui-scope *, .ui-scope *::before, .ui-scope *::after { box-sizing: border-box; }
.ui-scope h1, .ui-scope h2, .ui-scope h3, .ui-scope p { margin: 0; overflow-wrap: anywhere; }
.ui-scope h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.035em; }
.ui-scope h2 { font-size: 20px; line-height: 1.3; letter-spacing: -.02em; }
.ui-scope h3 { font-size: 17px; line-height: 1.3; }
.ui-scope :where(button, input, select, textarea, a):focus-visible { outline: 3px solid var(--ui-link); outline-offset: 3px; }
.ui-muted { color: var(--ui-muted); font-size: 14px; }
.ui-stack { display: grid; gap: var(--ui-space-3); }
.ui-row { display: flex; align-items: center; gap: var(--ui-space-3); }
.ui-row > * { min-width: 0; }
.ui-spread { justify-content: space-between; }
.ui-card { padding: var(--ui-space-4); border-radius: var(--ui-radius-md); background: var(--ui-surface); }
.ui-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ui-touch); min-width: var(--ui-touch); padding: 12px 18px; border: 1px solid transparent; border-radius: var(--ui-radius-sm); background: var(--ui-accent); color: var(--ui-on-accent); font: 600 16px/1.4 var(--ui-font); cursor: pointer; touch-action: manipulation; overflow-wrap: anywhere; transition: opacity var(--ui-motion-press), background-color var(--ui-motion-press); }
.ui-button:active:not(:disabled) { opacity: .8; }
.ui-button:disabled { opacity: .55; cursor: not-allowed; }
.ui-button--secondary { background: var(--ui-soft); color: var(--ui-link); }
.ui-button--ghost { background: transparent; color: var(--ui-link); border-color: var(--ui-line); }
.ui-button--danger { background: var(--ui-danger); color: var(--ui-on-danger); }
.ui-button--full { width: 100%; }
.ui-button[aria-busy="true"]::before { content: ""; width: 16px; height: 16px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-spin .8s linear infinite; }
.ui-button svg, .ui-nav svg { width: 24px; height: 24px; flex: none; }
.ui-field { display: grid; gap: 6px; font-weight: 500; }
.ui-field input, .ui-field select, .ui-field textarea { min-height: var(--ui-touch); width: 100%; min-width: 0; border: 1px solid var(--ui-muted); border-radius: var(--ui-radius-sm); padding: 12px; font: 16px/1.4 var(--ui-font); color: var(--ui-text); background: var(--ui-surface); }
.ui-field [aria-invalid="true"] { border-color: var(--ui-danger); }
.ui-field small { font-weight: 400; font-size: 14px; }
.ui-error { color: var(--ui-danger); }
.ui-choice { display: flex; align-items: center; gap: 12px; min-height: var(--ui-touch); padding: 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); background: var(--ui-surface); cursor: pointer; }
.ui-choice input { accent-color: var(--ui-accent); width: 20px; height: 20px; flex: none; }
.ui-choice:has(input:checked) { border-color: var(--ui-accent); background: var(--ui-soft); }
.ui-choice:has(input:focus-visible) { outline: 3px solid var(--ui-link); outline-offset: 3px; }
.ui-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ui-link); background: var(--ui-soft); padding: 4px 10px; border-radius: 999px; overflow-wrap: anywhere; }
.ui-notice { padding: 14px 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); background: var(--ui-surface); }
.ui-notice--error { color: var(--ui-danger); border-color: var(--ui-danger); }
.ui-progress { width: 100%; height: 6px; accent-color: var(--ui-accent); overflow: hidden; border: none; border-radius: 999px; }
.ui-progress::-webkit-progress-bar { background: var(--ui-line); }
.ui-progress::-webkit-progress-value { background: var(--ui-accent); }
.ui-progress::-moz-progress-bar { background: var(--ui-accent); }
.ui-nav { display: flex; gap: 8px; min-height: var(--ui-nav-height); background: var(--ui-surface); border-top: 1px solid var(--ui-line); padding: 8px calc(8px + var(--ui-safe-right)) calc(8px + var(--ui-safe-bottom)) calc(8px + var(--ui-safe-left)); }
.ui-nav button { flex: 1; min-width: 0; min-height: var(--ui-touch); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: var(--ui-radius-sm); padding: 8px 4px; font: 500 12px/1.2 var(--ui-font); color: var(--ui-muted); background: transparent; cursor: pointer; touch-action: manipulation; overflow-wrap: anywhere; }
.ui-nav button[aria-current="page"] { background: var(--ui-soft); color: var(--ui-link); font-weight: 700; }
.ui-nav button:active { background: var(--ui-soft); }
.ui-divider { border: 0; border-top: 1px solid var(--ui-line); margin: 4px 0; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ui-scope *, .ui-scope *::before, .ui-scope *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
