/* @group Inner Toolbar */

.toolbar {
  display: flex;
  flex-flow: row nowrap;
  place-content: stretch flex-start;
  align-items: center;
  min-height: 32px;
  margin-block-end: var(--ui-space-4);
  padding-inline-end: var(--ui-space-2);
  padding-inline-start: var(--ui-space-2);
  background-color: var(--color-toolbar);
  border: 1px solid var(--color-toolbar-border);
}

/* A view switch: the glyph is the link's only box; its name is a
   block_visually_hidden span, the same words as its title (RULES §6). */
.toolbar .switch_view .option {
  position: relative;
  display: flex;
  flex-flow: row nowrap;
  place-content: stretch center;
  align-items: center;
  width: 32px;
  height: 32px;
}

.toolbar .switch_view .option::before {
  color: var(--color-text);
  font: var(--ui-icon-weight) 18px var(--ui-icon-font-family);
}

.toolbar .switch_view .option.icon::before {
  content: var(--ui-icon-table-cells-large);
}

.toolbar .switch_view .option.list::before {
  content: var(--ui-icon-list);
}

.toolbar .switch_view {
  display: flex;
  flex-flow: row nowrap;
  place-content: stretch flex-start;
  align-items: center;
}

/* The toolbar's status text (how many websites of the plan are in use) is
   sentence case, as the same count reads on the other tabs. */
.toolbar .status {
  flex: 1 0 auto;
  align-self: auto;
  order: 0;
  padding-inline-end: var(--ui-space-2);
  padding-inline-start: var(--ui-space-2);
  color: var(--color-text);
}

.toolbar .status.right {
  text-align: end;
}

/* @end */

/* @group Toolbar */

#toolbar {
  width: 100%;
  min-height: 28px;
  background-color: var(--color-toolbar);
  border-block-end: 1px solid var(--color-toolbar-border);
}

#custom_menu_item {
  z-index: var(--ui-layer-overhang);
  margin-inline-end: var(--ui-space-1);
}

/* The heart (layouts/shared/_custom_menu_item). An outline heart adds the
   screen to the custom menu. DPG's filled red heart shows that the screen is
   in the menu, and removes it. */
#custom_menu_item .custom_menu_toggle {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: var(--ui-toolbar-control);
  height: var(--ui-toolbar-control);
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--ui-radius-control);
  cursor: pointer;
  appearance: none;
}

#custom_menu_item .custom_menu_toggle::before {
  position: absolute;
  inset: 0;
  display: grid;
  color: var(--color-text-secondary);
  font: var(--ui-toolbar-symbol-weight) var(--ui-icon-size)/1 var(--ui-icon-font-family);
  transition: transform var(--ui-duration-feedback) var(--ui-ease-feedback);
  content: var(--ui-icon-heart) var(--ui-icon-alt,);
  place-items: center;
}

/* Only a pointer that hovers: on touch the hover would stay after a tap. */
@media (hover: hover) {
  #custom_menu_item .custom_menu_toggle:hover {
    background-color: var(--color-toolbar-hover);
  }

  #custom_menu_item .custom_menu_toggle:not(.in_menu):hover::before {
    color: var(--color-text);
  }
}

#custom_menu_item .custom_menu_toggle.in_menu::before {
  color: var(--color-negative);
  font-weight: 900;
}

/* A change briefly enlarges the heart. With reduced motion it does not. */
@media (prefers-reduced-motion: no-preference) {
  #custom_menu_item .custom_menu_toggle.changed::before {
    transform: scale(1.25);
  }
}

/* While the request runs, the heart cannot be pressed again. */
#custom_menu_item .custom_menu_toggle[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

#custom_menu_item .custom_menu_toggle:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: -2px;
}

@media (any-pointer: coarse) {
  #custom_menu_item .custom_menu_toggle {
    width: var(--ui-touch-target);
    height: var(--ui-touch-target);
  }
}

/* In a narrow window the sidebar is a drawer. Its collapse and expand
   controls belong in the drawer's header (user_interface/panels/panel_drawer
   moves them there). The toolbar never shows them, from its first frame. */
@media (width <= 768px) {
  #controls > :is(#collapse_all, #expand_all) {
    display: none;
  }
}

/* Toolbar symbols are DPG's small boxed squares; hovering inverts them. */
#collapse_all,
#expand_all,
#hide_panels {
  position: relative;
  z-index: var(--ui-layer-raised);
  display: block;
  box-sizing: border-box;
  width: var(--ui-toolbar-control);
  height: var(--ui-toolbar-control);
  margin: calc(var(--ui-space-unit) / 2) var(--ui-space-1);
  padding: 0;
  color: var(--color-text-secondary);
  background-color: transparent;
  border: 1px solid var(--color-control-border);
  border-radius: var(--ui-radius-control);
  cursor: pointer;
}

#collapse_all:hover,
#expand_all:hover,
#hide_panels:hover {
  color: var(--color-text-inverse);
  background-color: var(--color-text);
  border-color: var(--color-text);
}

#collapse_all {
  --ui-toolbar-icon: var(--ui-icon-minus);
}

#expand_all {
  --ui-toolbar-icon: var(--ui-icon-plus);
}

/* DPG's panels control is the three-bar symbol. */
#hide_panels {
  --ui-toolbar-icon: var(--ui-icon-bars);
}

/* A screen without panels keeps the controls' places empty
   (layouts/shared/_controls): the boxes are there for the layout, not seen. */
#controls .invisible {
  visibility: hidden;
}

/* @end */

/* @group Breadcrumbs */

#breadcrumbs {
  z-index: var(--ui-layer-raised);
  -webkit-user-select: none;
  user-select: none;
}

#breadcrumbs div {
  height: 24px;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--ui-font-size-small);
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

#breadcrumbs div a {
  color: var(--color-text-muted);
}

/* The trail block's separator, at the toolbar's smaller type. */
#breadcrumbs .block_trail {
  --block-trail-gap: var(--ui-space-1);
}

.breadcrumb_full_path.ui-popover:is(:popover-open, [data-popover-open]) {
  max-width: min(60ch, calc(var(--ui-popover-viewport-width) - 2 * var(--ui-space-3)));
  padding: var(--ui-space-2) var(--ui-space-3);
  color: var(--color-text);
  font-size: var(--ui-font-size-small);
  line-height: var(--ui-line-height-body);
  white-space: normal;
  overflow-wrap: anywhere;
  background: var(--color-toolbar);
  -webkit-user-select: text;
  user-select: text;
}

.breadcrumb_full_path a {
  color: var(--color-link);
}

.breadcrumb_full_path a:is(:hover, :focus-visible) {
  text-decoration: none;
  background: var(--color-toolbar-hover);
}

/* @end */

/* @group Options Bar */

#options_bar {
  position: relative;
  z-index: var(--ui-layer-raised);
  display: flex;
  flex-flow: row wrap;
  place-content: stretch flex-start;
  align-items: center;
  color: var(--color-text-muted);
  -webkit-user-select: none;
  user-select: none;
}

/* Toolbar selects, in the bar and in its menus, read as DPG's compact grey text
   with a chevron. Only the search menu's fields keep form sizing. */
#options_bar :is(p, div:where(.ui_field)):not(.menu :is(p, div:where(.ui_field))),
#custom_menu_item :is(p, div:where(.ui_field)) {
  margin: 0;
}

#options_bar select:not(#search_box select) {
  height: var(--ui-toolbar-control);
  min-height: 0;
  margin: 0;
  padding-block-start: 0;
  padding-block-end: 0;
  padding-inline-start: 0;
  color: var(--color-text-muted);
  font-size: var(--ui-font-size-small);
  background-color: var(--color-toolbar);
  background-image: var(--select-icon-muted);
  background-position: right 7px center;
  background-repeat: no-repeat;
  background-size: 9px 9px;
  border-style: none;
}

/* Plain toolbar links and buttons read muted. Shared buttons (.button) keep
   their own colours, so a toolbar's Save stays legible. A select's own value
   button (see input.css) and a rating's stars (blocks/rating.css) are drawn
   by their own blocks. :where keeps these rules' weight, so the toolbar
   icons' own hover still wins. */
#options_bar button:where(:not(.button, select > button, .block_rating > button)):hover {
  background-color: var(--color-toolbar-hover);
}

#options_bar button:where(:not(.button, select > button, .block_rating > button)) {
  color: var(--color-text-muted);
  background-color: var(--color-toolbar);
  border: 1px solid var(--color-control-border);
}

#options_bar a:where(:not(.button)) {
  color: var(--color-text-muted);
}

#options_bar input[type='submit'] {
  width: 24px;
  height: 18px;
  margin: 0;
  padding: 0;
  font-size: var(--ui-font-size-caption);
  background-color: var(--color-toolbar);
  border-style: none;
}

.options_bar_item {
  display: flex;
  flex-flow: row wrap;
  place-content: stretch flex-start;
  align-items: center;
  padding-inline-end: var(--ui-space-2);
  font-size: var(--ui-font-size-caption);
}

/* Groups are 8px apart: a boxed tool's 2px margin plus this. A tool's menu
   (popover) may sit between them in the markup. */
:is(.options_bar_icon, #options_bar .menu) + .options_bar_item {
  margin-inline-start: var(--ui-space-2);
}

.options_bar_item:last-child {
  padding-inline-end: 0;
}

.options_bar_item .total {
  font-variant-numeric: tabular-nums;
}

.options_bar_item input {
  margin: 0;
}

.options_bar_item input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin-block-start: var(--ui-space-1);
  margin-inline-end: var(--ui-space-1);
  margin-block-end: var(--ui-space-1);
  padding: 0;
  background-color: var(--color-toolbar);
}

.options_bar_item input[type='checkbox']:checked {
  background-image: url("/assets/forms/check_mark_9b9b9b-f345a458.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 8px;
}

#options_bar .menu {
  color: var(--color-text-muted);
  font-size: var(--ui-font-size-label);
  background-color: var(--color-toolbar);
}

/* Settings menus use shared label/control columns. The grid owns the space between controls. */
#options_bar .menu.ui-popover:is(:popover-open, [data-popover-open]) {
  inset-inline-start: clamp(calc(var(--ui-popover-viewport-left) + var(--ui-space-3)), calc(var(--ui-popover-anchor-left) - 10px), calc(var(--ui-popover-viewport-right) - var(--ui-space-3) - var(--ui-popover-width)));
  display: grid;
  align-items: center;
  grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1fr) auto;
  column-gap: var(--ui-space-2);
  /* Wide enough that a control keeps its width whichever choice it shows,
     and the size slider keeps 24px between its stops. The control columns
     share any room beyond the labels. */
  min-width: min(calc(var(--ui-space-12) * 6), var(--ui-popover-viewport-width) - 2 * var(--ui-space-3));
  padding: var(--ui-space-3) var(--ui-space-4) var(--ui-space-4);
  border-block-start: 0;
  border-radius: 0 0 var(--ui-radius-surface) var(--ui-radius-surface);
  box-shadow: var(--shadow-menu);
}

#options_bar .menu.ui-popover:has(> .section > form + form, > .section > form.block_form .ui_field + .ui_field) {
  width: min(calc(var(--ui-space-12) * 10), var(--ui-popover-viewport-width) - 2 * var(--ui-space-3));
}

#options_bar .menu > * {
  grid-column: 1 / -1;
}

/* A settings row joins the grid: its forms give up their boxes, so each
   label and control is a cell. */
#options_bar .menu > .section:has(> form > select, > label) {
  display: grid;
  grid-template-columns: subgrid;
  column-gap: var(--ui-space-2);
  min-width: 0;
  margin-block-end: var(--ui-space-2);
}

#options_bar .menu > .section:has(> form > select, > label):last-child {
  margin-block-end: 0;
}

#options_bar .menu > .section:has(> form > select, > label) > form {
  display: contents;
}

#options_bar .menu > .section:has(> form > select, > label) > label,
#options_bar .menu > .section:has(> form > select, > label) > form > label {
  grid-column: 1;
  min-width: 0;
  padding-inline-end: var(--ui-space-2);
}

/* A form builder form (dpg_form: View options' Arrange) is a settings row
   too. Its wrappers give up their boxes, so its label, its controls and its
   save are cells in the same columns as an older row's. They take the menu's
   own type and colour (a hidden label is out of the flow). */
#options_bar .menu > .section:has(> form.block_form) {
  display: grid;
  grid-template-columns: subgrid;
  column-gap: var(--ui-space-2);
  min-width: 0;
  margin-block-end: var(--ui-space-2);
}

#options_bar .menu > .section > form.block_form,
#options_bar .menu > .section > form.block_form :is(.block_fields, .ui_field, .block_form_actions, .block_actions) {
  display: contents;
}

#options_bar .menu > .section > form.block_form .ui_field > label:first-child {
  grid-column: 1;
  min-width: 0;
  padding-inline-end: var(--ui-space-2);
  color: inherit;
  font-weight: inherit;
}

/* Controls flow on through the columns (the form block puts each in its own
   column 2). */
#options_bar .menu > .section > form.block_form .ui_field > select {
  grid-column: auto;
  width: 100%;
  max-width: none;
}

/* A form builder row without an action lines up as an older row does. One
   choice takes every control column. A second choice (a direction) takes the
   last two. */
#options_bar .menu > .section > form.block_form:not(:has(.block_actions)) .ui_field:only-child > select {
  grid-column: 2 / -1;
}

#options_bar .menu > .section > form.block_form:not(:has(.block_actions)) .ui_field + .ui_field:last-child > select {
  grid-column: 3 / -1;
}

/* A failed save's notice (user_interface/feedback) spans the row under it. */
#options_bar .menu > .section > form.block_form > :not(.block_fields, .block_form_actions, input) {
  grid-column: 1 / -1;
  margin-block-start: var(--ui-space-2);
}

#options_bar .menu > .section > form.block_form .ui_field + .ui_field > select:not(#search_box select),
#options_bar .menu > .section > form.block_form .block_actions > .button {
  margin-inline-start: 0;
}

/* The grid owns gaps between controls. */
#options_bar .menu > .section > form + form > select:not(#search_box select),
#options_bar .menu > .section > form > select + select:not(#search_box select),
#options_bar .menu > .section > form > select ~ input[type='submit']:not(#search_box input) {
  margin-inline-start: 0;
}

/* A row with one control gives it every control column, so single controls
   line up with the widest row. */
#options_bar .menu > .section > form:only-child > select:only-of-type,
#options_bar .menu > .section > .image_size_control {
  grid-column: 2 / -1;
}

/* A two-control row fills the space used by the action in an action row. */
#options_bar .menu > .section > form + form:last-child > select,
#options_bar .menu > .section > form > select + select:last-child {
  grid-column: 3 / -1;
}

#options_bar .menu > .section > form.block_form .block_actions > .button {
  height: var(--ui-control-height-compact);
  min-height: var(--ui-control-height-compact);
  padding-block: 0;
}

/* The size slider fills its cell like the controls above it. */
#options_bar .menu > .section > .image_size_control {
  width: auto;
  min-width: 0;
}

#options_bar .menu.ui-popover:is(:popover-open, [data-popover-open]):not([data-placement='above']) {
  inset-block-start: calc(var(--ui-popover-anchor-bottom) + 2px);
}

/* Without room below, a menu opens above its button as a normal surface. */
#options_bar .menu.ui-popover:is(:popover-open, [data-popover-open])[data-placement='above'] {
  border-block-start: 1px solid var(--color-toolbar-border);
  border-radius: var(--ui-radius-surface);
}

#options_bar .menu:not([popover]) {
  display: none;
}

/* A toolbar menu's heading (h2.menu_heading), in sentence case as its words are written (RULES §3.2). */
#options_bar .menu .menu_heading {
  margin: 0 0 var(--ui-space-3);
  padding-block-end: var(--ui-space-2);
  color: var(--color-toolbar-menu-heading);
  font-size: var(--ui-font-size-caption);
  font-weight: var(--ui-weight-medium);
  border-block-end: 1px dashed var(--color-toolbar-border);
}

/* A later heading starts a new group. */
#options_bar .menu > * + .menu_heading {
  margin-block-start: var(--ui-space-6);
}

#options_bar .menu .section {
  display: flex;
  clear: inline-start;
  flex-flow: row nowrap;
  align-items: center;
  width: 100%;
  min-width: 220px;
  min-height: 20px;
  /* No side margins: a percentage from the general .section rule resolves
     after a shrink-to-fit menu is sized, and would overflow it. */
  margin-inline: 0;
  margin-block-end: var(--ui-space-1);
  place-content: flex-start flex-start;
}

#options_bar .menu .section form {
  display: flex;
  flex-flow: row nowrap;
  place-content: flex-start flex-start;
  align-items: center;
  padding-block-start: var(--ui-space-1);
  padding-block-end: var(--ui-space-1);
}

/* Controls in a menu are the shared field chrome at the compact height, not
   the toolbar row's quiet text selects. The menu is a small form, and its
   lists open from them as from any field. */
#options_bar .menu select:not(#search_box select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--ui-control-height-compact);
  min-height: 0;
  margin: 0;
  padding: 0 var(--ui-space-6) 0 var(--ui-space-2);
  color: var(--color-input-text);
  font-size: var(--ui-font-size-control);
  background-color: var(--color-input-background);
  background-image: var(--select-icon-default);
  background-position: right var(--ui-space-2) center;
  border: 1px solid var(--color-control-border);
  border-radius: var(--ui-radius-control);
}

#options_bar .menu input[type="submit"] {
  box-sizing: border-box;
  width: auto;
  height: var(--ui-control-height-compact);
  margin: 0;
  padding: 0 var(--ui-space-3);
  color: var(--color-text-muted);
  font-family: var(--ui-font-family);
  font-size: var(--ui-font-size-label);
  font-weight: var(--ui-weight-medium);
  line-height: 1;
  text-align: center;
  background-color: var(--color-toolbar);
  border: 1px solid var(--color-input-border);
  border-radius: var(--ui-radius-control);
  cursor: pointer;
  transition: background-color var(--ui-duration-feedback) var(--ui-ease-feedback), color var(--ui-duration-feedback) var(--ui-ease-feedback);
}

#options_bar .menu input[type="submit"]:hover {
  color: var(--color-text);
  background-color: var(--color-input-border);
}

#options_bar label {
  display: inline-block;
  min-width: 48px;
}

/* The image size sliders move in stops, one per column count. A notch marks
   each stop, and the stop under the thumb is marked as current. The track and
   thumb are drawn here so the notches line up with the thumb's centre. */
#options_bar .image_size_control {
  --image-size-thumb: var(--ui-space-4);
  --image-size-track: 2px;

  position: relative;
  display: inline-block;
  /* Room for every stop: about 24px or more between notches. */
  width: max(70%, 176px);
  vertical-align: middle;
}

#options_bar .image_size_control input[type='range'] {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: var(--ui-toolbar-control);
  margin: 0;
  background: transparent;
  appearance: none;
}

/* The input's own track spans its whole width, half a thumb past each end
   stop, so it only carries the thumb. The line is drawn under it from the
   first stop to the last (.image_size_notches::before). */
#options_bar .image_size_control input[type='range']::-webkit-slider-runnable-track {
  height: var(--image-size-track);
  background: transparent;
}

#options_bar .image_size_control input[type='range']::-moz-range-track {
  height: var(--image-size-track);
  background: transparent;
}

#options_bar .image_size_control input[type='range']::-webkit-slider-thumb {
  width: var(--image-size-thumb);
  height: var(--image-size-thumb);
  margin-block-start: calc((var(--image-size-track) - var(--image-size-thumb)) / 2);
  background: var(--color-text);
  border: 0;
  border-radius: var(--ui-radius-control);
  appearance: none;
}

#options_bar .image_size_control input[type='range']::-moz-range-thumb {
  width: var(--image-size-thumb);
  height: var(--image-size-thumb);
  background: var(--color-text);
  border: 0;
  border-radius: var(--ui-radius-control);
}

#options_bar .image_size_control input[type='range']:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

#options_bar .image_size_notches {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* The line: from the first stop's centre to the last's, where the thumb's
   centre travels, and no further. */
#options_bar .image_size_notches::before {
  position: absolute;
  inset-block-start: calc(50% - var(--image-size-track) / 2);
  inset-inline: calc(var(--image-size-thumb) / 2);
  height: var(--image-size-track);
  background: var(--color-control-border);
  content: '';
}

/* --at is the stop's position along the range, 0 to 1. */
#options_bar .image_size_notches > span {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: calc(var(--image-size-thumb) / 2 + (100% - var(--image-size-thumb)) * var(--at));
  width: var(--image-size-track);
  height: var(--ui-space-3);
  background: var(--color-control-border);
  translate: -50% -50%;
}

#options_bar .image_size_notches > [data-current] {
  height: var(--ui-space-6);
  background: var(--color-text);
}

#open_image_information {
  --ui-toolbar-icon: var(--ui-icon-circle-info);
}

#open_image_debug_information {
  --ui-toolbar-icon: var(--ui-icon-bug);
}

#open_image_statistics {
  --ui-toolbar-icon: var(--ui-icon-chart-line);
}

#edit_in_pixlr {
  --ui-toolbar-icon: var(--ui-icon-pen-to-square);
}

#open_all_metadata {
  --ui-toolbar-icon: var(--ui-icon-file-lines);
}

#open_exif_statistics {
  --ui-toolbar-icon: var(--ui-icon-chart-column);
}

#open_storage {
  --ui-toolbar-icon: var(--ui-icon-database);
}

#open_timeline {
  --ui-toolbar-icon: var(--ui-icon-timeline);
}

#open_map {
  --ui-toolbar-icon: var(--ui-icon-map);
}

#show_view_options {
  --ui-toolbar-icon: var(--ui-icon-sliders);
}

#view_keywords {
  --ui-toolbar-icon: var(--ui-icon-tags);
}

#show_search {
  --ui-toolbar-icon: var(--ui-icon-magnifying-glass);
}

#diff {
  --ui-toolbar-icon: var(--ui-icon-code-compare);
}

#view_options.keyword_view_options.menu select {
  min-width: 60px;
}

#view_options.keyword_view_options.menu label {
  min-width: 130px;
}

#show_image_list_data {
  --ui-toolbar-icon: var(--ui-icon-file-export);
}

.csv_file {
  height: 16px;
  padding-inline-start: var(--ui-space-4);
  line-height: 16px;
  background: url("/assets/file_types/csv_file-ce202375.svg") no-repeat;
}

.txt_file {
  height: 16px;
  padding-inline-start: var(--ui-space-4);
  line-height: 16px;
  background: url("/assets/file_types/txt_file-344f02d1.svg") no-repeat;
}

.md5_file {
  height: 16px;
  padding-inline-start: var(--ui-space-4);
  line-height: 16px;
  background: url("/assets/file_types/md5_file-344f02d1.svg") no-repeat;
}

.pdf_file {
  height: 16px;
  padding-inline-start: var(--ui-space-4);
  line-height: 16px;
  background: url("/assets/file_types/pdf_file-ac9c21e4.svg") no-repeat;
}

@media (width >= 0) and (width <= 768px) {
  #account_user_settings_profile_image_review_image_scale {
    max-width: 40px;
  }
}

#review_image_version_select {
  max-width: 70px;
}

/* @group Options Bar Icon */

.options_bar_icon {
  box-sizing: border-box;
  width: var(--ui-toolbar-control);
  height: var(--ui-toolbar-control);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-control-border);
  border-radius: var(--ui-radius-control);
  cursor: pointer;
}

/* Hover inverts every toolbar tool, link or button, over the generic
   #options_bar link and button colours. */
.options_bar_icon:hover,
#options_bar .options_bar_icon:hover {
  color: var(--color-text-inverse);
  background-color: var(--color-text);
  border-color: var(--color-text);
}

/* The icon's name is visually hidden, not display: none, so it names the
   icon for assistive technology (RULES §2.9). Out of the flow, the symbol
   stays the control's only item. As .block_visually_hidden. */
.options_bar_icon span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip-path: inset(50%);
}

/* @end */

/* @end */

/* Panels are open most of the time on wide screens. The open state keeps
   the same box as its neighbours and only strengthens the symbol. Not while
   hovered: the hover's inverted colours stay, or the symbol matches its fill. */
#hide_panels[aria-expanded='true']:not(:hover) {
  color: var(--color-text);
}

#controls button:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: -2px;
}

/* Shared toolbar symbols: one font, weight and size across every screen. */
#collapse_all,
#expand_all,
#hide_panels,
.options_bar_icon {
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  align-items: center;
  gap: var(--ui-space-2);
  background-image: none;
}

#collapse_all::before,
#expand_all::before,
#hide_panels::before,
.options_bar_icon::before {
  font: var(--ui-toolbar-icon-weight) var(--ui-toolbar-icon-size)/1 var(--ui-icon-font-family);
  content: var(--ui-toolbar-icon) var(--ui-icon-alt,);
}

.options_bar_icon:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: -2px;
}

/* A tool whose box loads before it opens (RULES §24.8) shows at once that it
   is working. It looks pressed, with a small spinner in its symbol's place
   (user_interface/floating_boxes). */
.options_bar_icon[aria-busy='true'],
#options_bar .options_bar_icon[aria-busy='true'] {
  color: var(--color-text-inverse);
  background-color: var(--color-text);
  border-color: var(--color-text);
  cursor: progress;
}

.options_bar_icon[aria-busy='true']:has(> .dpg-spinner)::before {
  content: none;
}

.options_bar_icon > .dpg-spinner {
  color: currentcolor;
  border-color: transparent;
  border-block-start-color: currentcolor;
  border-inline-end-color: currentcolor;
}

/* The search menu's fields are form rows (images/_search_controls); the menu
   is their container, so they stack, label above field, as in a narrow surface. */
#options_bar #search_box .section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ui-field-gap);
  width: min(24rem, calc(var(--ui-popover-viewport-width) - 2 * var(--ui-space-3) - 2 * var(--ui-space-4) - 2px));
  min-width: 0;
  container-type: inline-size;
}

#options_bar #search_box :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--ui-control-height-compact);
  min-height: 0;
  margin: 0;
  padding: 0 var(--ui-space-2);
  color: var(--color-input-text);
  font-size: var(--ui-font-size-field);
  background-color: var(--color-input-background);
  border: 1px solid var(--color-input-border);
}

#options_bar #search_box select {
  padding-inline-end: var(--ui-space-6);
}

/* Labels in every toolbar menu are the menu's quieter ink, so the values
   lead. */
#options_bar #search_box .block_fields .ui_field > label:first-child {
  color: inherit;
}

#options_bar button.options_bar_icon {
  padding: 0;
  border-color: var(--color-control-border);
}

#options_bar .options_bar_icon:is([aria-expanded='true'], [aria-current='true']) {
  color: var(--color-text-inverse);
  background-color: var(--color-text);
  border-color: var(--color-text);
}

/* The design tool's Undo and Redo: hooked arrows (the circular arrow is
   Reset). Unavailable, they stay focusable, so their tooltip says why, but
   do not invert on hover. */
.options_bar_icon[data-icon='undo'] {
  --ui-toolbar-icon: var(--ui-icon-arrow-turn-left);
}

.options_bar_icon[data-icon='redo'] {
  --ui-toolbar-icon: var(--ui-icon-arrow-turn-right);
}

#options_bar .options_bar_icon[aria-disabled='true'] {
  color: var(--color-text-secondary);
  background-color: transparent;
  border-color: var(--color-control-border);
  opacity: var(--ui-opacity-dimmed);
  cursor: default;
}

/* Preview devices (the website design tool): one tool each, the current one
   pressed. */
.options_bar_icon[data-icon='desktop'] {
  --ui-toolbar-icon: var(--ui-icon-desktop);
}

.options_bar_icon[data-icon='tablet'] {
  --ui-toolbar-icon: var(--ui-icon-tablet);
}

.options_bar_icon[data-icon='mobile'] {
  --ui-toolbar-icon: var(--ui-icon-mobile);
}

.options_bar_icon[data-icon='custom'] {
  --ui-toolbar-icon: var(--ui-icon-ruler-combined);
}

/* A list's views (a blog's posts as cards or a list), the current one pressed. */
.options_bar_icon[data-icon='cards'] {
  --ui-toolbar-icon: var(--ui-icon-table-cells-large);
}

.options_bar_icon[data-icon='list'] {
  --ui-toolbar-icon: var(--ui-icon-list);
}

/* A screen's task actions (the website design tool's Cancel and Save) and
   text tools (.options_bar_button, its Visit). They are the shared buttons at
   the toolbar's tool height, with a quiet status beside the actions. */
.options_bar_actions {
  gap: var(--ui-action-gap);
}

.options_bar_actions .button,
.options_bar_actions .button + .button,
.options_bar_button {
  height: var(--ui-toolbar-control);
  margin: 0;
  padding: 0 var(--ui-space-3);
  font-size: var(--ui-font-size-small);
}

.options_bar_status {
  color: var(--color-text-secondary);
  font-size: var(--ui-font-size-small);
  white-space: nowrap;
}

/* The Help (?) menu (layouts/shared/_help_menu) is left of the background
   actions. It takes the space that pushes the right-hand group to the end.
   Its trigger is a toolbar symbol. */
#toolbar_help {
  order: 3;
  margin-inline-start: auto;
}

#toolbar_help + #transactions {
  margin-inline-start: 0;
}

#toolbar_help .block_menu_trigger {
  --block-menu-trigger-size: var(--ui-toolbar-control);

  margin-inline-end: var(--ui-space-1);
  border-radius: var(--ui-radius-control);
}

#toolbar_help .block_menu_trigger::before {
  font-weight: var(--ui-toolbar-symbol-weight);
}

@media (any-pointer: coarse) {
  #toolbar_help .block_menu_trigger {
    --block-menu-trigger-size: var(--ui-touch-target);
  }
}
