/* Shared F/47 application controls. Artwork colours are controlled separately. */
:root {
  color-scheme: light;
  --f47-page: #f7f7f4;
  --f47-surface: #fff;
  --f47-text: #111111;
  --f47-muted: #445451;
  --f47-border: #aab9b4;
  --f47-control-border: #aab9b4;
  --f47-highlight: #e7f1ed;
  --f47-selection: #007f85;
  --f47-focus: #007f85;
  --f47-danger: #a42c24;
  --f47-primary: #d7ff00;
  --f47-primary-hover: #c5ec00;
  --f47-control-height: 44px;
  --f47-control-radius: 8px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --f47-page: #121819;
  --f47-surface: #1a2324;
  --f47-text: #f2f5f2;
  --f47-muted: #afc0ba;
  --f47-border: #394b48;
  --f47-control-border: #647a74;
  --f47-highlight: #293d38;
  --f47-selection: #77d6cf;
  --f47-focus: #77d6cf;
  --f47-danger: #ffb9af;
}
:is(.app-header,.studio-header) {
  --f47-surface: #111111;
  --f47-text: #d7ff00;
  --f47-control-border: #647a74;
  --f47-highlight: #263431;
  --f47-focus: #d7ff00;
}

html body :is(
  :is(.app-shell,.detail-shell) .button,:is(.app-shell,.detail-shell) .icon-button,:is(.app-shell,.detail-shell) .studio-entry,:is(.app-shell,.detail-shell) .app-back,
  .studio-shell .action,.studio-shell .panel-toggle,.studio-shell .sheet-close,
  .studio-shell .mobile-controls button,.studio-shell .float-toolbar button,.studio-shell #studioBack
) {
  min-height: var(--f47-control-height);
  border: 1px solid var(--f47-control-border);
  border-radius: var(--f47-control-radius);
  background: var(--f47-surface);
  color: var(--f47-text);
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
}
html body :is(:is(.app-shell,.detail-shell) .button,:is(.app-shell,.detail-shell) .icon-button,:is(.app-shell,.detail-shell) .studio-entry,:is(.app-shell,.detail-shell) .app-back,
  .studio-shell .action,.studio-shell .panel-toggle,.studio-shell .sheet-close,
  .studio-shell .mobile-controls button,.studio-shell .float-toolbar button,.studio-shell #studioBack
):hover {
  background: var(--f47-highlight);
  color: var(--f47-text);
}
html body :is(:is(.app-shell,.detail-shell) .button.primary,.studio-shell .action.primary,.studio-shell #mobileExport) {
  background: var(--f47-primary);
  border-color: var(--f47-primary);
  color: #111;
}
html body :is(:is(.app-shell,.detail-shell) .button.primary,.studio-shell .action.primary,.studio-shell #mobileExport):hover {
  background: var(--f47-primary-hover);
  border-color: var(--f47-primary-hover);
  color: #111;
}
html body :is(.app-shell,.detail-shell,.studio-shell) :is(button,a,input,select,textarea,summary):focus-visible {
  outline: 2px solid var(--f47-focus);
  outline-offset: 3px;
}
html body :is(.app-shell,.detail-shell,.studio-shell) button:disabled { opacity: .55; cursor: default; }

html body :is(.app-shell,.detail-shell,.studio-shell) :is(select,input:not([type]),input[type="text"],input[type="search"],input[type="date"],input[type="number"],textarea) {
  border-color: var(--f47-control-border);
  border-radius: var(--f47-control-radius);
  background-color: var(--f47-surface);
  color: var(--f47-text);
}
html body :is(.app-shell,.detail-shell,.studio-shell) :is(select,input:not([type]),input[type="text"],input[type="search"],input[type="date"],input[type="number"]) {
  min-height: var(--f47-control-height);
}
html body :is(.app-shell,.detail-shell,.studio-shell) :is(.gym-set-row input[type="checkbox"],.clock-wheel select) {
  min-height: 0;
}

/* Destructive workout actions keep a distinct treatment in either theme. */
html body .detail-shell .button.delete {
  background: var(--f47-surface);
  border-color: var(--f47-danger);
  color: var(--f47-danger);
}
html body .detail-shell .button.delete:hover { background: var(--f47-highlight); }
