.toolbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: var(--bar-height);
  padding: 0 var(--edge) 0 10px;
  background: var(--color-chrome);
  border-bottom: .5px solid var(--color-separator);
}

.toolbar-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  margin-left: 2px;
}

.toolbar-title {
  margin: 0;
  font: 700 15px/1.2 var(--font-display);
  letter-spacing: -.01em;
}

.toolbar-subtitle {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--color-label-secondary);
}

.tool-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--color-label-secondary);
}

.tool-button:hover {
  background: var(--color-hover);
  color: var(--color-label);
}

.tool-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.5;
}

.nav-buttons {
  display: flex;
  flex: none;
}

.nav-buttons[hidden] {
  display: none;
}

.nav-button svg {
  stroke-width: 1.8;
}

/* nowhere to go: the chevron dims and takes no hover, as Finder's does */
.nav-button:disabled {
  opacity: .3;
  pointer-events: none;
}

:root[data-theme="dark"] .theme-icon-sun,
:root:not([data-theme="dark"]) .theme-icon-moon {
  display: none;
}

.search-field {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  width: 200px;
  height: var(--control-height);
  padding: 0 8px;
  border-radius: var(--radius-field);
  background: var(--color-fill);
  color: var(--color-label-secondary);
}

.search-field:focus-within {
  box-shadow: 0 0 0 3px var(--color-accent-tint), 0 0 0 1px var(--color-accent);
}

.search-field svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: none;
  background: none;
  color: var(--color-label);
  -webkit-appearance: none;
  appearance: none;
}

.search-field input::placeholder {
  color: var(--color-label-secondary);
}

.search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.release-picker {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  height: var(--control-height);
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
}

.release-picker:hover {
  background: var(--color-hover);
}

/* no ring after a click, as a macOS pop-up button; the keyboard still sees where it is by the fill */
.release-picker:focus { outline: none; }
.release-picker:focus-visible { background: var(--color-hover); }

.release-picker-label {
  color: var(--color-label-secondary);
}

.release-picker-value {
  font-weight: 500;
}

@media (max-width: 900px) {
  .search-field {
    width: 140px;
  }

  .release-picker-label {
    display: none;
  }
}

.view-picker,
.search-cancel {
  display: none;
}

/* the phone toolbar, as an iPhone navigation bar: the sidebar button, the title, then icons a finger can hit */
@media (max-width: 899px) {
  .toolbar {
    gap: 2px;
    height: auto;
    min-height: calc(var(--bar-height) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(var(--edge), env(safe-area-inset-right)) 0 max(var(--edge), env(safe-area-inset-left));  /* the buttons start and end where the content does */
  }

  .toolbar .tool-button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--color-accent);
  }

  .toolbar .tool-button svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
  }

  .toolbar .sidebar-toggle svg {
    width: 24px;
    height: 24px;
  }

  .toolbar-titles {
    flex: 1 1 0;
    margin-left: 4px;
  }

  .toolbar-title {
    font-size: 17px;
    font-weight: 600;
  }

  .toolbar-title,
  .toolbar-subtitle {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .toolbar-subtitle {
    font-size: 12px;
  }

  .toolbar > .spacer {
    display: none;
  }

  /* the appearance lives in the slide-over; the release and suite share one capsule */
  #release-picker,
  #suite-picker,
  .toolbar .theme-toggle {
    display: none;
  }

  /* one picker for the release and the suite, as a small capsule */
  .view-picker {
    display: inline-flex;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 50%;
    height: 32px;
    margin: 0 4px;
    padding: 0 10px 0 12px;
    border-radius: 999px;
    background: var(--color-fill);
    font-size: 14px;
  }

  .view-picker .release-picker-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* closed, the search is a magnifying glass in the bar */
  .search-field {
    flex: none;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    background: none;
    color: var(--color-accent);
  }

  .search-field svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.9;
  }

  .search-field input {
    width: 0;
    padding: 0;
    font-size: 17px;
  }

  .search-field:focus-within {
    box-shadow: none;
  }

  /* open, it fills the bar: a rounded field and Cancel, nothing else */
  :root[data-search="open"] .toolbar > :not(.search-field):not(.search-cancel) {
    display: none;
  }

  :root[data-search="open"] .search-field {
    flex: 1;
    justify-content: flex-start;
    gap: 6px;
    height: 36px;
    margin-left: 10px;
    padding: 0 8px;
    background: var(--color-fill);
    color: var(--color-label-secondary);
  }

  :root[data-search="open"] .search-field svg {
    width: 16px;
    height: 16px;
  }

  :root[data-search="open"] .search-field input {
    width: 100%;
  }

  :root[data-search="open"] .search-cancel {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 10px;
    border: 0;
    background: none;
    font-size: 17px;
    color: var(--color-accent);
  }
}

/* the report sheet, on the same surface as the site's menus and Test Conditions: frosted, a hairline edge, the menu
   corner; the title and its line at the leading edge, an outlined field, the toolbar's buttons */
.report-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-menu);
  color: var(--color-label);
  background: var(--color-menu);
  box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
}
.report-dialog::backdrop { background: rgba(0, 0, 0, .25); }
.report-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.report-head { text-align: left; }
.report-form h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.report-hint { margin: 3px 0 0; font-size: 12px; line-height: 1.4; color: var(--color-label-secondary); }

.report-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 104px;
  padding: 8px 10px;
  border: 1px solid var(--color-panel-outline);
  border-radius: var(--radius-field);
  font: inherit;
  font-size: 13px;
  color: var(--color-label);
  background: var(--color-background);
  resize: vertical;
}
.report-form textarea::placeholder { color: var(--color-label-tertiary); }
.report-form textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-tint); }  /* the search field's focus */

.report-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.report-actions button { min-width: 76px; height: var(--control-height); padding: 0 14px; border-radius: var(--radius-control); font: inherit; font-size: 13px; cursor: pointer; }
.report-cancel { border: 0; color: var(--color-label); background: var(--color-fill); }
.report-cancel:hover { background: var(--color-fill-secondary); }
.report-send { border: 0; color: #fff; background: var(--color-accent); font-weight: 500; }
.report-send:hover { filter: brightness(1.06); }

.report-status { margin: -4px 0 0; min-height: 16px; font-size: 12px; color: var(--color-label-secondary); }
.report-status a { color: var(--color-accent); text-decoration: none; }
.report-send:disabled { opacity: .6; cursor: default; }
.report-status:empty { display: none; }

/* on a phone the report is an iOS sheet: it rises from the bottom, Cancel and Send in its header, the text field first */
@media (max-width: 899px) {
  .report-dialog {
    width: 100%;
    max-width: 100%;
    height: calc(100% - max(12px, env(safe-area-inset-top)));
    max-height: none;
    margin: auto 0 0;
    border-width: .5px 0 0;
    border-radius: 14px 14px 0 0;
    animation: report-sheet .4s cubic-bezier(.32, .72, 0, 1);
  }

  .report-dialog::backdrop { background: rgba(0, 0, 0, .4); }

  .report-form {
    position: relative;
    height: 100%;
    gap: 16px;
    padding: 12px var(--edge) calc(16px + env(safe-area-inset-bottom));
  }

  .report-head { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 0 76px; text-align: center; }  /* an iOS sheet centres its title between Cancel and Send */
  .report-form h2 { font-size: 17px; }
  .report-hint { margin: 16px -76px 0; font-size: 13px; }

  .report-form textarea {
    min-height: 160px;
    padding: 12px;
    border-radius: 10px;
    font-size: 17px;
    resize: none;
  }


  .report-actions {
    position: absolute;
    top: 12px;
    right: 6px;
    left: 6px;
    justify-content: space-between;
    margin: 0;
    pointer-events: none;
  }

  .report-actions button {
    min-width: 0;
    height: 44px;
    padding: 0 10px;
    border: 0;
    font-size: 17px;
    color: var(--color-accent);
    background: none;
    pointer-events: auto;
  }

  .report-send { font-weight: 600; }
  .report-send:disabled { color: var(--color-label-tertiary); }
}

@keyframes report-sheet {
  from { transform: translateY(100%); }
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .report-dialog { animation: none; }
}

/* phones: no report flag in the top bar */
@media (max-width: 899px) { #report-button { display: none; } }
@media (max-width: 899px) { #view-picker { display: none; } }

/* the release is the page's most important choice: a prominent pop-up button, the system blue with white text,
   as Apple draws the one control on a screen it wants found first; it names the run, Latest or its day */
.release-picker.is-prominent {
  padding: 0 8px 0 10px;
  background: var(--color-accent);
}
.release-picker.is-prominent:hover,
.release-picker.is-prominent[aria-expanded="true"] { background: color-mix(in srgb, var(--color-accent) 88%, #fff); }
.release-picker.is-prominent .release-picker-label { display: none; }  /* the date alone; the button is named for screen readers */
.release-picker.is-prominent .release-picker-value { font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; }
.release-picker.is-prominent .popup-chevron { stroke: rgba(255, 255, 255, .85); }

/* the toolbar's trailing group: the theme button first, then search (the ⌘K button) and Log In, then the run picker */
.toolbar > .theme-toggle { order: 1; }
.toolbar > .search-field { order: 2; }
.toolbar > .search-cancel { order: 3; }
.toolbar > .toolbar-search { order: 3; }
.toolbar > .toolbar-login { order: 3; }
.toolbar > .release-picker, .toolbar > .view-picker { order: 4; }  /* the run last, at the trailing edge */

/* Log in after the search: the toolbar's one prominent button, filled solid black in light mode and white in dark, so it
   stands out in both, its word in the other */
.toolbar-login { flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 12px; font: inherit; font-size: 13px; font-weight: 500; color: #fff; background: #1d1d1f; cursor: pointer; }
:root[data-theme="dark"] .toolbar-login { color: #1d1d1f; background: #f5f5f7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toolbar-login { color: #1d1d1f; background: #f5f5f7; } }
.toolbar-login:hover { opacity: .85; }
.toolbar-login:active { opacity: .7; }
.toolbar-login:focus:not(:focus-visible) { outline: none; }
/* search is the ⌘K palette: the field stays hidden, holding the words a page is filtered for */
.search-field[hidden], .search-cancel[hidden] { display: none !important; }
/* the palette's button, as a toolbar's search item reads when collapsed: the glass and the shortcut, or the filter */
.toolbar-search { display: inline-flex; flex: none; align-items: center; gap: 6px; height: 28px; max-width: 200px; padding: 0 10px; border: 0; border-radius: var(--radius-field); font: inherit; font-size: 13px; color: var(--color-label-secondary); background: var(--color-fill); cursor: pointer; }
.toolbar-search:hover { background: var(--color-fill-secondary); }
.toolbar-search svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.toolbar-search kbd { font: inherit; letter-spacing: .02em; }
.toolbar-search-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-search.is-filtered { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 14%, transparent); }  /* a page filtered: its words in the accent */
.toolbar-search:focus:not(:focus-visible) { outline: none; }
/* a phone has no ⌘K: the search button is its glass alone, its words shown only while a page is filtered */
@media (max-width: 899px) {
  .toolbar-search:not(.is-filtered) .toolbar-search-text { display: none; }
  .toolbar-search { padding: 0 9px; }
}
.tool-button:focus:not(:focus-visible) { outline: none; }  /* no ring after a click, only for the keyboard */
@media (max-width: 899px) { .toolbar > .toolbar-login { margin-left: 6px; } }  /* the bar's 2px gap, plus room to tell search from Log in */
/* phones: Log in and search as chunky as the drawer's rows, 44px tall with their 10px corner and 17px type */
@media (max-width: 899px) {
  .toolbar-login { height: 44px; padding: 0 18px; border-radius: 10px; font-size: 17px; }
  .toolbar-search { height: 44px; min-width: 44px; justify-content: center; border-radius: 10px; }
  .toolbar-search svg { width: 18px; height: 18px; }
}
/* phones, as iOS sets its navigation bar: a frosted bar over the page, its buttons round glass-grey circles and capsules
   44px high, Log in a solid capsule; the title in iOS's 17pt semibold */
@media (max-width: 899px) {
  .toolbar { background: color-mix(in srgb, var(--color-background) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
  .toolbar .sidebar-toggle, .toolbar-search { width: 44px; height: 44px; min-width: 44px; padding: 0; justify-content: center; border-radius: 999px; background: var(--color-fill); }
  .toolbar .sidebar-toggle svg { width: 20px; height: 20px; }
  .toolbar-login { border-radius: 999px; padding: 0 20px; font-weight: 600; }
}

/* Auto: pause while the setups turn, play while they rest */
.auto-toggle[hidden] { display: none; }
.auto-toggle[aria-pressed="true"] .auto-icon-play, .auto-toggle[aria-pressed="false"] .auto-icon-pause { display: none; }
.auto-toggle .auto-icon-pause { stroke-width: 2; }  /* SF Symbols' pause: two round-capped strokes, as heavy as the play triangle reads */

.toolbar-login[hidden] { display: none; }
