turbo-frame,
turbo-frame[busy],
turbo-frame[complete],
form[data-turbo="true"] {
  display: contents;
}

/* Custom styles for the ReMark BRMS application */
:root {
  --select-option-selected-background-color: rgba(var(--color-balanced-300), 1);
  --select-option-focused-background-color: rgba(var(--color-balanced-300), 1);
  --table-tbody-tr-coloredRow-background: rgba(var(--color-light), 1);
  --table-tbody-tr-coloredRow-border-left: none;
}

.hidden,
:not(:defined) {
  display: none;
}

.invisible {
  visibility: hidden;
}

.widget-wrapper {
  margin: 0 auto;
  padding: 0 36px;
  width: 100%;
}

.widget-wrapper rmv-widget {
  max-width: 760px;
}

.widget-read-only rmv-widget::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 10;
}

/* Debugger sidebar is 480px (360px until xxl screens) */
#debugger-sidebar {
  height: calc(100vh - 121px);
  display: flex;
  position: sticky;
  top: 121px;
}

.session-debugger #debugger-sidebar {
  height: calc(100vh - 167px);
}

@media (max-width: 1440px) {
  rmv-column#debugger-sidebar {
    width: 360px;
  }
}

.session-debugger,
#debugger-sidebar.session-debugger {
  height: calc(100vh - 167px);
}

/* app/views/layouts/application.html.erb */
:root:has(rmv-styles[appearance="dark"]) .header {
  --row-background-color: rgb(var(--color-base-brave-200));
}

:root:has(rmv-styles[appearance="dark"]) .header rmv-action-trigger,
:root:has(rmv-styles[appearance="dark"]) .header rmv-action-trigger:hover {
  --button-color: rgb(var(--color-base-dark));
  --icon-color: rgb(var(--color-base-dark));
  --content-color: rgb(var(--color-base-dark));
}

:root:has(rmv-styles[appearance="dark"])
  .header
  rmv-divider[variant="solid"]:not([height="1"]) {
  --divider-border-left: 1px solid rgb(var(--color-base-brave-100));
  --divider-opacity: 1;
}

:root:has(rmv-styles[appearance="dark"])
  .header
  rmv-button[show-in="menu"]:not([disabled]) {
  --button-background-color: transparent;
  --icon-color: rgb(var(--color-base-dark));
  --content-color: rgb(var(--color-base-dark));
}

.header {
  --row-z-index: 2;
  --row-position: sticky;
  --row-box-shadow: var(--elevation-md);
  top: 0;
}

.header-divider {
  --divider-opacity: 0.2;
}

brms-explorer brms-input-search .brms-input .rm-input {
  --simple-height: 40px;
}

.rulesets {
  --color-base-brave-100: var(--color-base-royal-100);
  --color-base-brave-500: var(--color-base-royal-500);
  --color-base-brave-700: var(--color-base-royal-900);
  --color-base-energized-500: var(--color-base-royal-900);
}

.rulesets:hover {
  --icon-color: var(--color-base-royal-500);
}

.subsets {
  --color-base-brave-100: var(--color-base-fair-100);
  --color-base-brave-500: var(--color-base-fair-500);
  --color-base-brave-700: var(--color-base-fair-900);
  --color-base-energized-500: var(--color-base-fair-900);
}

.subsets:hover {
  --icon-color: var(--color-base-fair-500);
}

.rules {
  --color-base-brave-100: var(--color-base-fluent-100);
  --color-base-brave-500: var(--color-base-fluent-500);
  --color-base-brave-700: var(--color-base-fluent-900);
  --color-base-energized-500: var(--color-base-fluent-900);
}

.rules:hover {
  --icon-color: var(--color-base-fluent-500);
}

.sidebar {
  --column-width: 230px;
  --column-z-index: 1;
  --column-position: fixed;
  --column-height: 100%;
  border-right: 1px solid rgb(var(--color-grey-stable-500));
}

.sidebar + rmv-column {
  margin-left: 230px;
}

.sidebar.collapsed + rmv-column {
  margin-left: 62px;
}

.sidebar.collapsed rmv-button rmv-content {
  --host-display: none;
}

.sidebar.collapsed rmv-tooltip rmv-button {
  min-width: 61px;
}

.sidebar-inner {
  --column-position: sticky;
}

.sidebar.collapsed {
  --column-width: 62px;
}

.sidebar.collapsed rmv-row[grow="false"] {
  --row-opacity: 0;
}

.sidebar.collapsed rmv-row[grow="false"]:first-of-type {
  --row-height: 0;
}

.sidebar.collapsed rmv-row[grow="false"]:not(:first-of-type) {
  --row-padding: 0;
}

.sidebar.collapsed rmv-content[size="meta"] {
  --content-line-height: 1;
}

.sidebar-toggle {
  --button-background-color: rgb(var(--color-base-light));
  --button-padding: 7px 8px 7px 6px;
  --button-border-width: 1px;
  --button-border-style: solid;
  --button-border-color: rgb(var(--color-grey-stable-500));
  --button-box-shadow: var(--elevation-sm);
  --button-border-top-left-radius: var(--radius-lg);
  --button-border-top-right-radius: var(--radius-lg);
  --button-border-bottom-left-radius: var(--radius-lg);
  --button-border-bottom-right-radius: var(--radius-lg);
  --button-z-index: 3;
  position: absolute;
  right: -12px;
  top: 24px;
}

.sidebar.collapsed .sidebar-toggle {
  --icon-transform: rotate(180deg);
  --button-padding: 7px 6px 7px 8px;
}

/* Subsets: Needed for the specific 'Folders' accordion styling on the Subsets overview page */
rmv-accordion:not([open]).folders-accordion {
  --accordion-summary-padding: 24px 20px;
  --accordion-summary-margin: -24px -20px 0;
  --accordion-summary-background-color: rgb(var(--color-stable-100));
}

/* Subsets: Needed for the specific 'Folders' accordion to hide/show the grid/list view trigger */
rmv-accordion:not([open]).folders-accordion + turbo-frame .view-dropdown {
  display: none;
}

.view-dropdown {
  position: absolute;
  top: 0;
  right: 0;
  margin: 16px 28px;
  z-index: 2;
}

/* Subsets: Needed for the specific 'Folders' card styling on the Subsets overview page */
.folder-card {
  --card-max-width: 213px;
  --card-border-color: transparent;
}

.folder-card:hover {
  --card-background-color: rgb(var(--color-energized-100));
}

/* Sortable styling needed for dragging */
.grabbing * {
  cursor: grabbing;
}

.grabbing *:not(rmv-row.sortable-chosen) {
  --row-background-color: transparent;
}

.grabbing .handle,
.handle:active {
  cursor: grabbing;
}

.handle,
.handle:focus,
.handle:active {
  cursor: grabbing;
}

.handle:hover {
  cursor: grab;
}

rmv-row.sortable-chosen.sortable-ghost {
  opacity: 0;
}

/* Preview: Styling for the toolbar buttons */
rmv-button.preview-menu-item[variant="tertiary"] {
  --button-background-color: rgb(var(--color-light));
  --button-border: transparent;
  --button-box-shadow: none;
  --button-disabled-background-color: transparent;
  --button-border-top-left-radius: var(--radius-sm);
  --button-border-top-right-radius: var(--radius-sm);
  --button-border-bottom-left-radius: var(--radius-sm);
  --button-border-bottom-right-radius: var(--radius-sm);
}
rmv-button.preview-menu-item[variant="tertiary"] rmv-icon {
  --icon-color: rgb(var(--color-brave-500));
}
rmv-button.preview-menu-item[variant="tertiary"]:hover {
  --button-background-color: rgb(var(--color-brave-100));
  --button-border: transparent;
  --button-box-shadow: none;
}
rmv-button.preview-menu-item[variant="tertiary"]:active {
  --button-background-color: rgb(var(--color-brave-100));
  --button-border: transparent;
  --button-box-shadow: none;
}
rmv-button.preview-menu-item[variant="tertiary"][selected] {
  --button-background-color: rgb(var(--color-brave-100));
  --button-background-image: none;
  --button-border: transparent;
  --button-box-shadow: none;
}
rmv-button.preview-menu-item[variant="tertiary"][selected]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background-color: rgb(var(--color-energized-500));
}
rmv-button.preview-menu-item[variant="tertiary"][selected]:hover::after {
  background-color: rgb(var(--color-energized-500));
}
rmv-button.preview-menu-item[variant="tertiary"][selected]:active::after {
  content: none;
}
rmv-button.preview-menu-item[disabled] {
  --button-disabled-background-color: transparent;
  --button-outline-border-color: none;
  --button-box-shadow: none;
}
rmv-button.preview-menu-item[disabled] rmv-icon {
  --icon-color: rgb(var(--color-stable-800));
}
rmv-button.preview-menu-item[disabled]:hover,
rmv-button.preview-menu-item[disabled]:active {
  --button-background-color: var(--button-disabled-background-color);
}
rmv-button.preview-menu-item[icon] {
  --button-padding: 8px;
}

.badge-notch {
  position: absolute;
  top: 0;
  right: 20px;
  --badge-border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  --badge-border-width: 0 1px 1px;
}

.badge-notch-sidebar {
  position: absolute;
  top: 0;
  right: 28px;
  --badge-border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  --badge-border-width: 0 1px 1px;
}

.explorer-search-preview {
  --input-host-width: 330px;
}

.explorer-search {
  --input-height: 40px;
  --input-width: 400px;
  --input-color: rgba(var(--color-light));
  --input-background-color: rgba(var(--color-light), 0.2);
  --input-placeholder-color: rgb(var(--color-light));
  --input-border-width: 0;
  --input-padding: 10px 16px;
}
.explorer-search rmv-icon {
  --icon-color: rgb(var(--color-light));
}
.explorer-search rmv-button[variant="tertiary"]:hover rmv-icon {
  --icon-color: rgb(var(--color-energized-700));
}
.explorer-search:hover {
  --input-background-color: rgba(var(--color-light), 0.28);
}
.explorer-search:active,
.explorer-search:focus-within,
.explorer-search[value]:not([value=""]) {
  --input-color: rgba(var(--color-dark));
  --input-background-color: rgba(var(--color-light), 1);
}
.explorer-search:active rmv-icon,
.explorer-search:focus-within rmv-icon,
.explorer-search[value]:not([value=""]) rmv-icon {
  --color-base-royal-500: var(--color-stable-900);
  --icon-color: rgb(var(--color-stable-900));
}

.explorer-card {
  --card-position: absolute;
  --card-overflow: hidden;
  --card-width: 680px;
  --card-min-width: 250px;
  --card-margin: 13px 0 0 0;
  --card-z-index: 1;
}

.explorer-button {
  --button-height: 44px;
  --button-background-color: rgb(var(--color-light));
  --button-border: none;
  --button-box-shadow: none;
  --button-border-radius: 0;
  --explorer-icon-background-color: rgba(var(--color-balanced-500), 0.1);
}
.explorer-button:hover {
  --button-background-color: rgb(var(--color-balanced-100));
}
.explorer-button:hover rmv-content {
  --color-base-brave-500: rgba(var(--color-energized-700), 1);
}
.explorer-button:hover .hidden-arrow {
  display: flex;
}
.explorer-button .explorer-icon {
  /* Custom styling for the backdrop of the icon (no need to add
			the possibility to overrule */
  margin-left: 20px;
  z-index: 1;
}
.explorer-button .explorer-icon:before {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 4px;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  position: absolute;
  background-color: var(--explorer-icon-background-color);
  z-index: -1;
}
.explorer-button .explorer-icon[color="stable-900"]:before {
  --explorer-icon-background-color: rgba(var(--color-stable-100), 1);
}
.explorer-button .explorer-icon[color="royal-500"]:before {
  --explorer-icon-background-color: rgba(var(--color-royal-100), 1);
}
.explorer-button .explorer-icon[color="fluent-500"]:before {
  --explorer-icon-background-color: rgba(var(--color-fluent-100), 1);
}
.explorer-button .explorer-icon[color="fair-500"]:before {
  --explorer-icon-background-color: rgba(var(--color-fair-100), 1);
}
.explorer-button .explorer-icon[color="brave-500"]:before {
  --explorer-icon-background-color: rgba(var(--color-brave-100), 1);
}

.explorer-button-nested {
  --button-height: 36px;
}

.badge-notch {
  position: absolute;
  right: 20px;
  --badge-border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  --badge-border-width: 0 1px 1px;
}

.explorer-response,
.explorer-response > div {
  width: 100%;
}
.explorer-response rmv-code-editor,
.explorer-response > div rmv-code-editor {
  --input-border-width: 0;
  --input-border-top-left-radius: 0;
  --input-border-top-right-radius: 0;
  --input-border-bottom-left-radius: 0;
  --input-border-bottom-right-radius: 0;
}
.explorer-response rmv-code-editor:hover,
.explorer-response rmv-code-editor:focus-within,
.explorer-response > div rmv-code-editor:hover,
.explorer-response > div rmv-code-editor:focus-within {
  --input-border-width: 1px;
  --input-border-color: transparent;
}
.explorer-response rmv-code-editor .ace-github .ace_gutter,
.explorer-response > div rmv-code-editor .ace-github .ace_gutter {
  border-top-left-radius: 0;
}

.pointer-events-none {
  pointer-events: none;
}

.modal-full-height {
  height: calc(100vh - 40px);
}

rmv-code-editor.code-editor-borderless {
  --input-border-width: 0;
  --input-border-top-left-radius: 0;
  --input-border-top-right-radius: 0;
  --input-border-bottom-left-radius: 0;
  --input-border-bottom-right-radius: 0;
  --input-padding: 1px 1px 0;
}
rmv-code-editor.code-editor-borderless:hover,
rmv-code-editor.code-editor-borderless:focus-within {
  --input-border-width: 0;
  --input-border-color: transparent;
}

.divider-with-color {
  --divider-border-color: rgba(var(--color-light));
}

.active-avatar {
  --avatar-background-color: rgb(var(--color-stable-500));
  --content-color: rgb(var(--color-dark));
  --avatar-border-width: 0;
}

.popover-corner {
  position: absolute;
  top: 0;
  right: 0;
  padding: 14px 20px;
}

/* Subset rule (variable assignments & activations): Styling needed for collapsible which have popovers, this can be reused in other features. Apply on the wrapper around the accordion (rmv-card i.e.) */
.collapsible-with-popover rmv-accordion[open] + rmv-column,
.collapsible-with-sortable .handle:has(+ rmv-accordion[open]) {
  border-bottom: 1px solid rgb(var(--color-grey-stable-500));
}

.collapsible-with-popover rmv-accordion[open] > rmv-column {
  --column-width: calc(100% + 60px);
}

.collapsible-with-sortable rmv-accordion > rmv-column {
  margin-left: -40px;
  --column-width: calc(100% + 40px);
}
.collapsible-with-sortable.collapsible-with-popover rmv-accordion > rmv-column {
  --column-width: calc(100% + 100px);
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.table-default > rmv-row,
.table-default > * > rmv-row {
  min-height: 32px;
}

.table-meta > rmv-row,
.table-meta > * > rmv-row {
  min-height: 36px;
}

.table-no-hover-effect rmv-row[is="table-row"]:hover {
  --row-background-color: currentcolor;
}

rmv-snackbar.alerts-and-notices {
  --card-margin: 50px 0 0 0;
  --card-width: max-content;
}

.no-shrink {
  --row-flex-shrink: 0;
  /* Disable shrinking for row */
}

.modal-snackbar {
  position: fixed;
  top: 75px;
  width: 100%;
  right: 0;
  z-index: 2;
}

.table-scrollable rmv-table > rmv-row:first-child {
  --row-position: sticky;
  --row-z-index: 4;
  top: 0;
  --row-background-color: rgb(var(--color-grey-stable-100));
}
.table-scrollable
  rmv-table
  rmv-row
  > rmv-column
  > rmv-row
  > rmv-column:first-child {
  left: 0;
  --column-position: sticky;
  --column-z-index: 3;
  transition: all 1s;
}
.table-scrollable rmv-table > rmv-row:first-child > rmv-column:first-child {
  left: 0;
  --column-position: sticky;
  --column-z-index: 1;
  transition: all 1s;
}

.table-scrollable-scrolled rmv-table rmv-row > rmv-column:first-child {
  box-shadow: 5px 0px 7px -5px rgba(0, 0, 0, 0.08);
}

rmv-accordion.accordion-ellipsis {
  --accordion-width: 100%;
}

rmv-accordion[open].debugger-accordion {
  flex-grow: 1;
  align-items: flex-start;
  --accordion-background-color: rgb(var(--color-light));
}

rmv-timeline rmv-icon.timeline-item-icon {
  --timeline-item-icon-outline: 4px solid rgb(var(--color-grey-stable-100));
}

.resizable-handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  cursor: ns-resize;
  z-index: 10;
}

rmv-accordion.accordion-ellipsis {
  --accordion-width: 100%;
}

/* Hide invisible button in table row */
.table-hover-button {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4px;
  --button-border-bottom-left-radius: 50%;
  --button-border-bottom-right-radius: 50%;
  --button-border-top-left-radius: 50%;
  --button-border-top-right-radius: 50%;
  --button-height: 20px;
  --button-width: 20px;
}

.hide-button-opacity {
  opacity: 0;
}

.show-button-opacity {
  opacity: 1;
}

.search-in-answers-table[disabled] {
  --input-border-width: 0px;
  --input-padding: 0px 16px;
}

.select-wide-dropdown {
  --select-choices-list-dropdown-width: 360px;
}

.diagram-modal-scrollbar {
  --scrollable-max-height: calc(100vh - 283px);
  overflow: auto;
  --scrollable-scrollbar-width-enum: thin;
  --scrollable-scrollbar-gutter: stable;
  --scrollable-scrollbar-color: rgb(var(--color-grey-stable-500));
}

.diagram-modal-search {
  --input-background-color: rgba(var(--color-light), 1);
}

.diagram-modal-activation-button rmv-content {
  --content-font-size: var(--font-size-meta);
  --content-font-weight: 500;
}

rmv-row#preview-toolbar {
  position: sticky;
  top: 60px;
  z-index: 99;
}

.subset-rules-fields {
  --column-width: calc(100% - 20px);
  max-width: 759px;
}

.subset-rules-variables {
  --column-width: calc(100% - 40px);
  max-width: 759px;
}

/* This selector targets rmv-spinner elements within .search-with-spinner elements that either have no value or an empty value. */
.search-with-spinner:is(:not([value]), [value=""]) rmv-spinner[slot="suffix"] {
  --host-display: inline-flex;
}

/* This selector hides the last rmv-divider in the ruleset outcomes edit table */
#bulk_ruleset_outcomes_form rmv-table rmv-row:last-of-type rmv-divider {
  display: none;
}

#bulk_ruleset_outcomes_form rmv-row.sortable-drag rmv-divider {
  display: none;
}

.test-cases-notice-button rmv-content {
  --content-font-size: var(--font-size-meta);
}

.filter-select[open] {
  --select-host-position: fixed;
}

.sidebar + rmv-divider + rmv-column .table-popover {
  bottom: 20px;
  position: fixed;
  --card-inset: auto auto calc(100% + 8px) calc(50% + 100px);
}

.sidebar.collapsed + rmv-divider + rmv-column .table-popover {
  --card-inset: auto auto calc(100% + 8px) calc(50% + 30px);
}

rmv-action-trigger.filter-component-action-trigger[size="small"] {
  --button-width: auto;
  --button-padding: 8px 12px 8px 12px;
  --button-height: 44px;
  --host-max-width: 100%;
  --row-flex-shrink: 1;
}

rmv-action-trigger.filter-component-action-trigger[size="medium"] {
  --button-padding: 12px 16px;
  --row-flex-shrink: 1;
  --host-max-width: 100%;
}
