:root {
  --rs-control-accent: var(--app-blue, var(--admin-blue, var(--blue, #0c29ab)));
  --rs-control-ink: var(--app-ink, var(--admin-ink, var(--ink, var(--app-navy, #263750))));
  --rs-control-muted: var(--app-muted, var(--admin-muted, var(--muted, #6b7890)));
  --rs-control-line: var(--app-line, var(--admin-line, var(--line, #d5deea)));
  --rs-control-surface: #fff;
  --rs-control-surface-hover: #fcfdff;
  --rs-control-line-hover: #9eafc5;
  --rs-control-focus: rgba(12, 41, 171, .16);
  --rs-control-error: #b5473a;
  --rs-control-error-hover: #98382e;
  --rs-control-error-focus: rgba(181, 71, 58, .16);
  --rs-control-disabled-surface: #f1f4f7;
  --rs-control-readonly-surface: #f7f9fc;
  --rs-control-placeholder: #8793a5;
  --rs-control-radius: 9px;
  --rs-control-min-block-size: 42px;
  --rs-select-trigger-icon-space: 36px;
  --rs-control-toolbar-gap: 16px;
  --rs-control-toolbar-primary-min-inline-size: 16rem;
  --rs-select-field-min-inline-size: 12rem;
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
) {
  box-sizing: border-box;
  min-height: var(--rs-control-min-block-size);
  border: 1px solid var(--rs-control-line);
  border-radius: var(--rs-control-radius);
  background-color: var(--rs-control-surface);
  color: var(--rs-control-ink);
  font: 500 13px/1.45 Inter, sans-serif;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
):hover:not(:disabled):not([readonly]):not(:focus-visible) {
  border-color: var(--rs-control-line-hover);
  background-color: var(--rs-control-surface-hover);
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
):focus-visible {
  border-color: var(--rs-control-accent);
  outline: 3px solid var(--rs-control-focus);
  outline-offset: 0;
  box-shadow: none;
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
):disabled {
  cursor: not-allowed;
  background-color: var(--rs-control-disabled-surface);
  color: var(--rs-control-muted);
  opacity: .72;
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
)[readonly] {
  cursor: default;
  background-color: var(--rs-control-readonly-surface);
  color: var(--rs-control-muted);
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
)::placeholder {
  color: var(--rs-control-placeholder);
  opacity: 1;
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
):is([aria-invalid="true"], :user-invalid):not(:disabled) {
  border-color: var(--rs-control-error);
  background-color: #fffafa;
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
):is([aria-invalid="true"], :user-invalid):not(:disabled):hover:not(:focus-visible) {
  border-color: var(--rs-control-error-hover);
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
  [data-rs-select-scope] textarea
):is([aria-invalid="true"], :user-invalid):not(:disabled):focus-visible {
  border-color: var(--rs-control-error);
  outline-color: var(--rs-control-error-focus);
}

:is(.rs-input, [data-rs-select-scope] input).rs-input--compact {
  min-height: 36px;
  font-size: 11px;
}

:is(
  .rs-input,
  .rs-textarea,
  [data-rs-select-scope] input:not([type]),
  [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"]),
  [data-rs-select-scope] textarea
):-webkit-autofill {
  -webkit-text-fill-color: var(--rs-control-ink);
  caret-color: var(--rs-control-ink);
  box-shadow: 0 0 0 1000px #f8faff inset;
}

/* Prefixes, suffixes and inline actions sometimes need one visual field surface. */
.rs-input-shell {
  box-sizing: border-box;
  min-height: var(--rs-control-min-block-size);
  border: 1px solid var(--rs-control-line);
  border-radius: var(--rs-control-radius);
  background-color: var(--rs-control-surface);
  color: var(--rs-control-ink);
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}

.rs-input-shell:hover:not(:focus-within):not(:has(> .rs-input-shell__control:disabled)) {
  border-color: var(--rs-control-line-hover);
  background-color: var(--rs-control-surface-hover);
}

.rs-input-shell:focus-within {
  border-color: var(--rs-control-accent);
  outline: 3px solid var(--rs-control-focus);
  outline-offset: 0;
}

.rs-input-shell:has(> .rs-input-shell__control:is([aria-invalid="true"], :user-invalid):not(:disabled)) {
  border-color: var(--rs-control-error);
  background-color: #fffafa;
}

.rs-input-shell:has(> .rs-input-shell__control:is([aria-invalid="true"], :user-invalid):not(:disabled)):hover:not(:focus-within) {
  border-color: var(--rs-control-error-hover);
}

.rs-input-shell:has(> .rs-input-shell__control:is([aria-invalid="true"], :user-invalid):not(:disabled)):focus-within {
  border-color: var(--rs-control-error);
  outline-color: var(--rs-control-error-focus);
}

.rs-input-shell:has(> .rs-input-shell__control:disabled) {
  cursor: not-allowed;
  background-color: var(--rs-control-disabled-surface);
  color: var(--rs-control-muted);
  opacity: .72;
}

.rs-input-shell:has(> .rs-input-shell__control[readonly]) {
  background-color: var(--rs-control-readonly-surface);
  color: var(--rs-control-muted);
}

.rs-input-shell > :is(input, textarea).rs-input-shell__control,
.rs-input-shell > :is(input, textarea).rs-input-shell__control:hover,
.rs-input-shell > :is(input, textarea).rs-input-shell__control:focus,
.rs-input-shell > :is(input, textarea).rs-input-shell__control:focus-visible,
.rs-input-shell > :is(input, textarea).rs-input-shell__control:is([aria-invalid="true"], :user-invalid) {
  border: 0;
  border-radius: inherit;
  background-color: transparent;
  outline: 0;
  box-shadow: none;
}

:is(.rs-select, [data-rs-select-scope] select):not([multiple]) {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--rs-control-line);
  border-radius: var(--rs-control-radius);
  appearance: none;
  background-color: var(--rs-control-surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--rs-control-accent) 50%), linear-gradient(135deg, var(--rs-control-accent) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  overflow: hidden;
  padding: 0 var(--rs-select-trigger-icon-space) 0 11px;
  color: var(--rs-control-ink);
  font: 500 13px Inter, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color .16s, box-shadow .16s, background-color .16s;
}

:is(.rs-select, [data-rs-select-scope] select):not([multiple]):hover:not(:disabled):not(:focus-visible) {
  border-color: var(--rs-control-line-hover);
  background-color: var(--rs-control-surface-hover);
}

:is(.rs-select, [data-rs-select-scope] select):not([multiple]):focus-visible {
  border-color: var(--rs-control-accent);
  outline: 3px solid var(--rs-control-focus);
  outline-offset: 0;
  box-shadow: none;
}

:is(.rs-select, [data-rs-select-scope] select):not([multiple]):disabled {
  cursor: not-allowed;
  background-color: var(--rs-control-disabled-surface);
  color: var(--rs-control-muted);
  opacity: .68;
}

:is(.rs-select, [data-rs-select-scope] select):not([multiple])[aria-invalid="true"]:not(:disabled),
:is(.rs-select, [data-rs-select-scope] select):not([multiple]):user-invalid:not(:disabled) {
  border-color: var(--rs-control-error);
  background-color: #fffafa;
}

:is(.rs-select, [data-rs-select-scope] select):not([multiple]):is([aria-invalid="true"], :user-invalid):not(:disabled):hover:not(:focus-visible) {
  border-color: var(--rs-control-error-hover);
}

:is(.rs-select, [data-rs-select-scope] select):not([multiple]):is([aria-invalid="true"], :user-invalid):not(:disabled):focus-visible {
  border-color: var(--rs-control-error);
  outline-color: var(--rs-control-error-focus);
}

:is(.rs-select.rs-select--compact, [data-rs-select-scope] select.rs-select--compact):not([multiple]) {
  min-height: 36px;
  font-size: 11px;
}

:where(.rs-control-toolbar) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--rs-control-toolbar-gap);
}

:where(.rs-control-toolbar__primary) {
  flex: 1 1 var(--rs-control-toolbar-primary-min-inline-size);
  min-inline-size: min(100%, var(--rs-control-toolbar-primary-min-inline-size));
}

:where(.rs-select-field) {
  flex: 0 1 var(--rs-select-field-min-inline-size);
  min-inline-size: min(100%, var(--rs-select-field-min-inline-size));
  max-inline-size: 100%;
  white-space: normal;
}

:where(.rs-select-field--wide) {
  --rs-select-field-min-inline-size: 16rem;
}

:where(.rs-select-field) > select {
  max-inline-size: 100%;
}

[data-rs-menu] {
  position: relative;
}

[data-rs-menu-panel][hidden] {
  display: none !important;
}

[data-rs-menu-panel] {
  box-sizing: border-box;
  display: grid;
  gap: 3px;
  min-width: 190px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--rs-control-line);
  border-radius: 12px;
  background: #fff;
  padding: 7px;
  box-shadow: 0 18px 42px rgba(15, 33, 72, .18);
}

[data-rs-menu-panel] [role="menuitem"] {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background-color: #fff;
  color: var(--rs-control-ink);
  cursor: pointer;
  font-family: Inter, sans-serif;
  text-align: left;
}

[data-rs-menu-panel] [role="menuitem"]:hover,
[data-rs-menu-panel] [role="menuitem"]:focus-visible,
[data-rs-menu-panel] [role="menuitem"][aria-current="true"],
[data-rs-menu-panel] [role="menuitem"][aria-checked="true"] {
  background-color: #f2f5ff;
  color: var(--rs-control-accent);
}

[data-rs-menu-panel] [role="menuitem"][data-rs-menu-item-danger] {
  color: #9b3e34;
}

[data-rs-menu-panel] [role="menuitem"]:disabled,
[data-rs-menu-panel] [role="menuitem"][aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
}

[data-rs-menu-panel] [role="menuitem"]:focus-visible {
  outline: 3px solid var(--rs-control-focus);
  outline-offset: -1px;
}

@media (prefers-reduced-motion: reduce) {
  :is(
    .rs-input,
    .rs-textarea,
    [data-rs-select-scope] input:not([type]),
    [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
    [data-rs-select-scope] textarea
  ),
  .rs-input-shell,
  :is(.rs-select, [data-rs-select-scope] select):not([multiple]),
  [data-rs-menu-trigger] {
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .rs-input-shell:has(> .rs-input-shell__control:is([aria-invalid="true"], :user-invalid):not(:disabled)),
  :is(
    .rs-input,
    .rs-textarea,
    [data-rs-select-scope] input:not([type]),
    [data-rs-select-scope] input:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="week"], [type="datetime-local"]),
    [data-rs-select-scope] textarea
  ):is([aria-invalid="true"], :user-invalid):not(:disabled),
  :is(.rs-select, [data-rs-select-scope] select):not([multiple]):is([aria-invalid="true"], :user-invalid):not(:disabled) {
    border-color: Mark;
  }

  :is(.rs-select, [data-rs-select-scope] select):not([multiple]) {
    appearance: auto;
    background-image: none;
    padding-right: 11px;
  }

  [data-rs-menu-panel] {
    border: 1px solid CanvasText;
  }
}
