.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;
}

: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);
}

.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(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
  }

  .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, as Apple's Report a Problem: a centered title, the message first, a small optional screenshot */
.report-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: .5px solid var(--color-panel-outline);
  border-radius: 12px;
  color: var(--color-label);
  background: var(--color-card);
}
.report-dialog::backdrop { background: rgba(0, 0, 0, .25); }
.report-form { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.report-head { text-align: center; }
.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: .5px solid var(--color-panel-outline);
  border-radius: 7px;
  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: 3px solid color-mix(in srgb, var(--color-accent) 40%, transparent); outline-offset: 0; border-color: var(--color-accent); }

.report-attach { display: flex; align-items: center; gap: 12px; }
.report-attach[hidden] { display: none; }
.report-thumb {
  flex: none;
  width: 64px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: .5px solid var(--color-panel-outline);
  border-radius: 5px;
  background: var(--color-background);
  cursor: zoom-in;
}
.report-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.report-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--color-label); cursor: pointer; }
.report-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--color-accent); }

.report-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.report-actions button { min-width: 76px; height: 26px; padding: 0 14px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer; }
.report-cancel { border: .5px solid var(--color-panel-outline); color: var(--color-label); background: var(--color-background); }
.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; }
  .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-check { font-size: 15px; }
  .report-check input { width: 20px; height: 20px; }
  .report-thumb { width: 80px; height: 50px; border-radius: 6px; }

  .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; } }
