/* Shared interactive controls. Layout, document styles and native values stay module-owned. */
@media screen {
  :root {
    --rh-control-surface: #fff;
    --rh-control-hover: #edf5f4;
    --rh-control-ink: #203c44;
    --rh-control-muted: #53666d;
    --rh-control-line: #a8bec3;
    --rh-control-accent: #145c63;
    --rh-control-selected: #e1f0ed;
    --rh-control-on-selected: #124c52;
    --rh-control-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2353666d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  }
  html[data-theme=dark] {
    --rh-control-surface: #23363b;
    --rh-control-hover: #2b4147;
    --rh-control-ink: #eef1f4;
    --rh-control-muted: #b1c5c8;
    --rh-control-line: #67858a;
    --rh-control-accent: #96d5d0;
    --rh-control-selected: #29494b;
    --rh-control-on-selected: #d6f4f3;
    --rh-control-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b1c5c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  }
  :is(button, select, input, textarea, option) {
    font-family: "Nunito", ui-rounded, system-ui, sans-serif;
  }
  :is(button, a):is(.primary,.primary-action,.secondary,.ghost,.danger-btn):not(.rh-doc-button),
  .touch-select-trigger {
    border-radius: 9px;
    line-height: 1.3;
  }
  :is(button, a, select, input, textarea):focus-visible {
    outline: 2px solid var(--rh-control-accent);
    outline-offset: 2px;
  }
  :is(button,select,input):disabled { cursor: not-allowed; }
  html[data-theme=dark] :is(button,a):is(.secondary,.ghost):not(.rh-doc-button) {
    background-color: var(--rh-control-surface);
    color: var(--rh-control-ink);
    border-color: var(--rh-control-line);
  }
  html[data-theme=dark] :is(button,a):is(.secondary,.ghost):not(.rh-doc-button):hover:not(:disabled) {
    background-color: var(--rh-control-hover);
  }
  html[data-theme=dark] :is(button,a).rh-doc-signed {
    color: #b4ead0 !important;
    background: #193b32 !important;
    border-color: #4a8870 !important;
  }
  html[data-theme=dark] :is(button,a).rh-doc-excel {
    color: #bfead0 !important;
    background: #203c30 !important;
    border-color: #4a8870 !important;
  }
  select:not([multiple]):not([size]) {
    appearance: none;
    min-height: 44px;
    padding-inline: 12px 38px !important;
    text-align: left !important;
    text-align-last: left !important;
    border-radius: 9px;
    color: var(--rh-control-ink) !important;
    border-color: var(--rh-control-line) !important;
    background-color: var(--rh-control-surface) !important;
    background-image: var(--rh-control-chevron) !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
  }
  select:not([multiple]):not([size]):hover:not(:disabled) {
    background-color: var(--rh-control-hover) !important;
  }
  .select-shell select:not([multiple]):not([size]) { background-image: none !important; }
  select option {
    color: var(--rh-control-ink) !important;
    background: var(--rh-control-surface) !important;
    text-align: left;
    justify-content: flex-start;
  }
  select option:is(:checked,:focus,:hover) {
    color: var(--rh-control-on-selected) !important;
    background: var(--rh-control-selected) !important;
  }
  select option:disabled { color: var(--rh-control-muted) !important; }
  @supports (appearance: base-select) {
    select:not([multiple]):not([size]):not(.touch-select-source), ::picker(select) {
      appearance: base-select !important;
    }
    select:not([multiple]):not([size]) {
      background-image: none !important;
      position: relative;
      align-items: center;
      justify-content: flex-start !important;
    }
    select:not([multiple]):not([size])::picker-icon {
      position: absolute;
      inset-inline-end: 12px;
      top: 50%;
      margin: 0;
      transform: translateY(-50%);
      color: var(--rh-control-muted);
    }
    .select-shell select::picker-icon { display: none; }
    ::picker(select) {
      color: var(--rh-control-ink) !important;
      background: var(--rh-control-surface) !important;
      border: 1px solid var(--rh-control-line) !important;
      border-radius: 10px;
      padding: 4px;
      font-family: "Nunito", ui-rounded, system-ui, sans-serif;
    }
    select:not([multiple]):not([size]) option { min-height: 38px; padding: 8px 12px; }
  }
  input::file-selector-button {
    font-family: "Nunito", ui-rounded, system-ui, sans-serif;
    color: var(--rh-control-ink) !important;
    background: var(--rh-control-surface) !important;
    border-color: var(--rh-control-line) !important;
    border-radius: 7px;
  }
  input::file-selector-button:hover { background: var(--rh-control-hover) !important; }
  :is(.touch-select-menu, .catalog-suggestions, #omObraPanel, #omMonthPanel,
      .movement-calendar, .movement-calendar-popup, .rh-birthday-picker) {
    background: var(--rh-control-surface) !important;
    color: var(--rh-control-ink) !important;
    border-color: var(--rh-control-line) !important;
  }
  :is(.touch-select-option, .catalog-suggestions [role=option],
      #omObraPanel [role=option], #omMonthPanel button, .movement-calendar button,
      .movement-calendar-popup button, .rh-birthday-picker button) {
    color: var(--rh-control-ink) !important;
    border-radius: 7px;
    background-color: var(--rh-control-surface) !important;
  }
  :is(.touch-select-option, .catalog-suggestions [role=option],
      #omObraPanel [role=option], #omMonthPanel button, .movement-calendar button,
      .movement-calendar-popup button, .rh-birthday-picker button):hover:not(:disabled) {
    background-color: var(--rh-control-hover) !important;
  }
  :is(.touch-select-option, .catalog-suggestions [role=option],
      #omObraPanel [role=option], #omMonthPanel button, .movement-calendar button,
      .movement-calendar-popup button, .rh-birthday-picker button):is(
      [aria-pressed=true], [aria-selected=true], .is-selected, .selected, .active) {
    color: var(--rh-control-on-selected) !important;
    background-color: var(--rh-control-selected) !important;
    box-shadow: inset 0 0 0 1px var(--rh-control-accent);
  }
}
