/* Product interface contract. Shared by Manager and Wallet; no page-specific paint. */
:focus-visible { outline:3px solid var(--focus-ring); outline-offset:3px; }
input, select, textarea, button { font:inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color:transparent; }
button:disabled { cursor:not-allowed; }

.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--sh-1); }

.ui-form { display:grid; gap:var(--space-5); width:100%; min-width:0; margin:0 0 var(--space-5); }
.ui-form.card { padding:var(--space-5); }
.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap:var(--space-4); }
.ce-form-group, .ui-form > label:not(.consent-row) { display:grid; gap:var(--space-2); min-width:0; margin:0; }
.ce-form-group > label, .ui-form label, .wizard-shell label { font-size:.9rem; font-weight:600; color:var(--fg-strong); }
.field-hint { margin:0; font-size:.82rem; line-height:1.5; color:var(--fg-muted); font-weight:400; }
.ui-form :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=submit]):not([type=button]), select, textarea),
.wizard-shell :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=submit]):not([type=button]), select, textarea),
.ce-form-group :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  display:block; width:100%; min-width:0; min-height:var(--control-height);
  padding:10px 12px; border:1px solid var(--line-strong); border-radius:var(--r-sm);
  background:var(--surface); color:var(--fg-strong); font:inherit; font-weight:400;
  transition:border-color var(--t-fast), box-shadow var(--t-fast);
}
.ui-form textarea, .wizard-shell textarea { min-height:112px; resize:vertical; }
.ui-form :is(input,select,textarea):focus-visible, .wizard-shell :is(input,select,textarea):focus-visible {
  outline:2px solid var(--focus-ring); outline-offset:2px; border-color:var(--brand-primary-hover);
}
.ui-form :is(input,select,textarea):disabled, .wizard-shell :is(input,select,textarea):disabled {
  background:var(--slate-50); color:var(--fg-muted); cursor:not-allowed;
}
input:is([type=checkbox],[type=radio]) { width:18px; height:18px; flex:0 0 auto; accent-color:var(--brand-primary-hover); }
.ui-form label:has(> input:is([type=checkbox],[type=radio])),
.wizard-shell label:has(> input:is([type=checkbox],[type=radio])) { display:flex; flex-direction:row; align-items:center; gap:var(--space-2); font-weight:500; }
input[type=file]::file-selector-button {
  margin-right:var(--space-3); padding:8px 12px; border:1px solid var(--line-strong);
  border-radius:var(--r-sm); background:var(--slate-50); color:var(--fg-strong); font:inherit; cursor:pointer;
}
.validation-message { color:var(--red-text); font-size:.85rem; margin-top:var(--space-1); }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:var(--space-2);
  min-height:var(--control-height); padding:10px 20px; border:1px solid transparent; border-radius:var(--r-full);
  background:var(--cta); color:var(--cta-fg); font:inherit; font-size:.9rem; font-weight:650;
  line-height:1.25; text-decoration:none; cursor:pointer; box-shadow:var(--sh-brand);
  transition:background var(--t-fast), box-shadow var(--t-fast); }
.btn:hover { background:var(--cta-hover); color:var(--brand-on-primary-hover); }
.btn:disabled, .btn[aria-disabled=true] { opacity:.55; cursor:not-allowed; box-shadow:none; }
.btn.primary { background:var(--cta); color:var(--cta-fg); }
.btn.primary:hover { background:var(--cta-hover); color:var(--brand-on-primary-hover); }
.btn.ghost, .btn.secondary { background:var(--surface); color:var(--fg-strong); border-color:var(--line-strong); box-shadow:none; }
.btn.ghost:hover, .btn.secondary:hover { background:var(--slate-50); color:var(--fg-strong); }
.btn.sm { min-height:36px; padding:7px 14px; font-size:.85rem; }
.btn.danger, .btn.reject { background:var(--surface); color:var(--red-text); border-color:var(--red); box-shadow:none; }
.btn.danger:hover, .btn.reject:hover { background:var(--red-bg); color:var(--red-text); }
.btn.approve { background:var(--green-bg); color:var(--fg-strong); box-shadow:none; }
.btn.approve:hover { background:var(--green-bg); color:var(--fg-strong); }
.btn.amber { background:var(--amber-bg); color:var(--fg-strong); box-shadow:none; }
.btn.amber:hover { background:var(--amber-bg); color:var(--fg-strong); }
.wizard-shell.embedded { min-height:0; border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; box-shadow:var(--sh-1); }
.wizard-shell.embedded .focus-body { padding:var(--space-5); }
.wizard-shell .focus-inner { min-width:0; }
.wizard-shell .focus-top { flex-wrap:wrap; }
.wizard-shell .focus-top .title { min-width:0; overflow-wrap:anywhere; }
.wizard-shell .focus-top .header-extra { margin-left:auto; }
.wizard-shell .pbar span { background:var(--brand-primary); }
.wizard-shell .ce-form-group + .ce-form-group { margin-top:var(--space-4); }
@media (max-width:600px) {
  .ui-form.card { padding:var(--space-4); }
  .ce-form-actions > .btn { flex:1 1 auto; min-height:44px; }
  .btn.sm { min-height:44px; }
  .wizard-shell .focus-top { gap:var(--space-3); padding:var(--space-4); }
  .wizard-shell .focus-top .title { flex:1 1 50%; }
  .wizard-shell .focus-top .header-extra { margin:0; flex-basis:100%; }
  .wizard-shell .foot-actions { flex-wrap:wrap; }
  .wizard-shell .foot-actions .hint { display:none; }
  .wizard-shell.embedded .focus-body { padding:var(--space-4); }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* Shared variants used by tenant selection, queues and compact administration. */
.btn.block { width:100%; }
.btn.tenant-option { width:100%; justify-content:flex-start; background:var(--surface); color:var(--fg-strong); border-color:var(--line-strong); box-shadow:none; }
.btn.tenant-option:hover { background:var(--slate-50); }
.btn.tenant-option .tenant-role { color:var(--fg-muted); font-weight:500; margin-left:var(--space-1); }
.btn.queue-cta.escalate { background:var(--surface); color:var(--fg-strong); border-color:var(--line-strong); box-shadow:none; }
.btn.queue-cta.escalate:hover { background:var(--slate-50); }
.btn.claim-btn { white-space:nowrap; box-shadow:none; }
.ui-control { min-height:44px; max-width:100%; padding:10px 12px; font:inherit; border:1px solid var(--line-strong); border-radius:var(--r-sm); color:var(--fg-strong); background:var(--surface); }
.form-choice { display:flex; align-items:center; gap:var(--space-2); font-size:.9rem; font-weight:500; }
.empty-state { padding:var(--space-5); color:var(--fg-muted); text-align:center; }

/* Consent choices retain their horizontal label/switch anatomy. */
.ui-form > label.consent-row { display:flex; align-items:center; gap:var(--space-3); }
.consent-sheet.ui-form { gap:var(--space-3); margin:0; }
/* Administration tables become labelled cards on narrow screens. */
@media (max-width:760px) {
  table.responsive-table { display:block; width:100%; border:0; background:transparent; }
  table.responsive-table thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  table.responsive-table tbody { display:grid; gap:var(--space-3); }
  table.responsive-table tr { display:block; padding:var(--space-3); border:1px solid var(--line); border-radius:var(--r-md); background:var(--surface); }
  table.responsive-table td { display:grid; grid-template-columns:minmax(5rem,1fr) minmax(0,2fr); gap:var(--space-3); padding:var(--space-2); border:0; overflow-wrap:anywhere; }
  table.responsive-table td::before { content:attr(data-label); color:var(--fg-muted); font-weight:600; }
  table.responsive-table td > * { min-width:0; max-width:100%; }
}
.wizard-shell .focus-top .back, .wizard-shell .escape-hatch { min-height:44px; }
@media (max-width:760px) {
  .phone-row-action { min-height:44px; display:inline-flex; align-items:center; }
}
/* Shared progressive disclosure for long forms and configuration editors. */
.disclosure-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--space-3); align-items:start; }
.disclosure-section { min-width:0; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); }
.disclosure-section > summary { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2); min-height:52px; padding:var(--space-3) var(--space-4); cursor:pointer; list-style:none; }
.disclosure-section > summary::-webkit-details-marker { display:none; }
.disclosure-section > summary::before { content:'›'; font-size:1.25rem; line-height:1; width:12px; }
.disclosure-section[open] > summary::before { transform:rotate(90deg); }
.disclosure-title { font-weight:650; overflow-wrap:anywhere; }
.disclosure-summary { margin-left:auto; color:var(--fg-muted); font-size:.8rem; }
.disclosure-body { padding:0 var(--space-4) var(--space-4); }
.disclosure-section .perm-grid { grid-template-columns:1fr; }
@media (max-width:760px) { .disclosure-grid { grid-template-columns:1fr; } }
