/*
 * The panel dock. Colours are the app's design tokens (styles.css), so the
 * dock follows the light and dark themes without a rule of its own.
 */

.dock-layout {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
}

.dock-layout[data-position="bottom"] {
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
}

.dock-layout[data-position="right"] {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
}

.dock-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dock {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  color: var(--text);
}

.dock-layout[data-position="bottom"] .dock {
  border-top: 1px solid var(--line);
}

.dock-layout[data-position="right"] .dock {
  border-left: 1px solid var(--line);
}

.dock[data-collapsed="true"] {
  flex: none;
}

.dock-layout[data-position="right"] .dock[data-collapsed="true"] {
  width: 40px;
}

/* The drag handle sits on the dock's inner edge and is a little wider than it looks. */
.dock-handle {
  position: absolute;
  z-index: 2;
  background: transparent;
  touch-action: none;
}

.dock-layout[data-position="bottom"] .dock-handle {
  left: 0;
  right: 0;
  top: -3px;
  height: 7px;
  cursor: row-resize;
}

.dock-layout[data-position="right"] .dock-handle {
  top: 0;
  bottom: 0;
  left: -3px;
  width: 7px;
  cursor: col-resize;
}

.dock-handle:hover,
.dock-handle:focus-visible {
  background: var(--accent);
  opacity: 0.5;
}

.dock-handle:focus-visible {
  outline: none;
  opacity: 0.8;
}

.dock-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
  min-width: 0;
}

.dock-header[data-rail="true"] {
  flex-direction: column;
  justify-content: flex-start;
  border-bottom: 0;
  height: 100%;
}

.dock-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
}

.dock-header[data-rail="true"] .dock-tabs {
  flex-direction: column;
  overflow: visible;
}

.dock-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}

.dock-header[data-rail="true"] .dock-tab {
  justify-content: center;
  border-bottom: 0;
  border-left: 2px solid transparent;
  padding: 8px 0;
  width: 100%;
}

.dock-tab:hover {
  background: var(--hover);
  color: var(--text);
}

.dock-tab[aria-selected="true"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.dock-header[data-rail="true"] .dock-tab[aria-selected="true"] {
  border-left-color: var(--accent);
  border-bottom-color: transparent;
}

.dock-icon {
  font-size: 14px;
  line-height: 1;
}

.dock-actions {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.dock-header[data-rail="true"] .dock-actions {
  flex-direction: column;
  padding: 4px 0;
}

.dock-action {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.dock-action:hover {
  background: var(--hover);
  color: var(--text);
}

.dock-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

.dock-failed {
  margin: 12px var(--gutter);
  padding: 10px 12px;
  border: 1px solid var(--err-line);
  background: var(--err-bg);
  border-radius: 6px;
  font-size: 13px;
}

/* Shared by panels: a quiet message, and small labelled facts. */
.panel-empty {
  padding: 14px var(--gutter);
  color: var(--muted);
  font-size: 13px;
}

.panel-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0;
  padding: 12px var(--gutter);
  font-size: 13px;
}

.panel-facts dt {
  color: var(--muted);
}

.panel-facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.panel-actions {
  display: flex;
  gap: 8px;
  padding: 0 var(--gutter) 12px;
}

.panel-button {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.panel-button:hover:not(:disabled) {
  background: var(--hover);
}

.panel-button:disabled {
  color: var(--disabled);
  cursor: default;
}
/*
 * The assembly panel. Colours are the app's design tokens (styles.css), so it
 * follows the light and dark themes. The layout is two columns when the dock is
 * wide (bottom dock) and one when it is narrow (side dock).
 */

.asm {
  container-type: inline-size;
  container-name: asm;
  height: 100%;
  min-height: 0;
  font-size: 13px;
  color: var(--text);
}

/* Narrow: one column, the whole panel scrolls. */
.asm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: min-content;
  align-content: start;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

/* Wide: setup on the left, results on the right, each scrolling on its own. */
@container asm (min-width: 820px) {
  .asm-grid {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    overflow: hidden;
  }
  .asm-setup,
  .asm-results {
    overflow: auto;
    min-height: 0;
  }
  .asm-setup {
    border-right: 1px solid var(--line);
  }
}

.asm-setup,
.asm-results {
  padding: 12px var(--gutter) 20px;
  min-width: 0;
}

.asm h3 {
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 650;
}

.asm h3:first-child {
  margin-top: 2px;
}

.asm fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  min-width: 0;
}

.asm legend {
  padding: 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.asm-muted {
  color: var(--muted);
}

.asm-label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.asm select,
.asm input[type="text"] {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  max-width: 100%;
}

.asm select:focus-visible,
.asm input:focus-visible,
.asm summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.asm input[aria-invalid="true"] {
  border-color: var(--err-line);
}

.asm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
  margin: 6px 0;
}

.asm-inline {
  display: block;
  margin: 8px 0 0;
}

.asm-radio,
.asm-checks label {
  display: block;
  margin: 4px 0;
  line-height: 1.35;
}

.asm-radio input,
.asm-checks input {
  margin-right: 4px;
}

.asm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.asm-button {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.asm-button:hover:not(:disabled) {
  background: var(--hover);
}

.asm-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.asm-button:disabled {
  color: var(--disabled);
  cursor: default;
}

.asm-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

:root[data-theme="dark"] .asm-primary {
  color: #0b1220;
}

.asm-primary:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.08);
}

.asm-primary:disabled {
  background: var(--panel);
  border-color: var(--line);
  color: var(--disabled);
}

.asm-link {
  font: inherit;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

.asm-link:hover {
  text-decoration: underline;
}

.asm-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.asm-parts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.asm-parts > li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--panel);
}

.asm-partname {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}

.asm-partsrc {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asm-picker {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.asm-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14em;
}

.asm-files {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 180px;
  overflow: auto;
  display: grid;
  gap: 2px;
}

.asm-files li {
  padding: 2px 2px;
}

.asm-note {
  margin: 6px 0;
  line-height: 1.4;
}

.asm-ok {
  color: var(--text);
}

p.asm-ok,
.asm-banner.asm-ok,
.asm-issue.asm-ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-line);
}

p.asm-warn,
div.asm-warn,
.asm-issue.asm-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-text);
}

p.asm-err,
.asm-banner.asm-err,
.asm-issue.asm-err {
  background: var(--err-bg);
  border: 1px solid var(--err-line);
}

p.asm-ok,
p.asm-warn,
p.asm-err,
div.asm-warn {
  padding: 6px 9px;
  border-radius: 6px;
}

.asm-warn-text {
  color: var(--warn-text);
}

.asm-banner {
  padding: 8px 12px;
  border-radius: 8px;
  margin: 2px 0 8px;
  line-height: 1.45;
}

.asm-issues {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 5px;
}

.asm-issue {
  padding: 6px 9px;
  border-radius: 6px;
  line-height: 1.4;
  border: 1px solid var(--line);
}

.asm-issue.asm-muted {
  background: var(--panel);
  color: var(--muted);
}

.asm-empty {
  max-width: 46em;
  line-height: 1.5;
}

.asm-badge {
  display: inline-block;
  font-size: 11px;
  line-height: 1.5;
  padding: 0 7px;
  border-radius: 10px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.asm-badge.asm-ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
}

.asm-badge.asm-warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-text);
}

.asm-badge.asm-err {
  background: var(--err-bg);
  border-color: var(--err-line);
}

.asm-badge.asm-muted {
  background: var(--panel);
  color: var(--muted);
}

.asm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px;
  font-size: 12.5px;
}

.asm-table caption {
  text-align: left;
  font-weight: 650;
  font-size: 12.5px;
  padding: 4px 0;
}

.asm-table th,
.asm-table td {
  text-align: left;
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.asm-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 11.5px;
}

.asm-table .asm-selected td {
  background: var(--active);
}

.asm-chain {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.asm-detail {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.asm-features {
  margin: 6px 0;
  padding-left: 18px;
  columns: 2 220px;
}

.asm-save {
  margin-top: 12px;
}

.asm code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.asm details > summary {
  cursor: pointer;
  margin: 6px 0;
}

.asm-simulate {
  align-items: center;
}

.asm-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  cursor: pointer;
}

.asm-runlabel {
  margin: 2px 0 6px;
  font-size: 12px;
  line-height: 1.4;
}
.feat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.feat-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.feat-filter {
  font: inherit;
  font-size: 12.5px;
  padding: 4px 8px;
  width: 240px;
  max-width: 50%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.feat-filter:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.feat-count {
  font-size: 12px;
  color: var(--muted);
}

.feat-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.feat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.feat-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0;
  white-space: nowrap;
}

.feat-table th button {
  width: 100%;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 5px 10px;
  cursor: pointer;
}

.feat-table th[aria-sort="ascending"] button,
.feat-table th[aria-sort="descending"] button {
  color: var(--text);
}

.feat-table th button:hover {
  background: var(--hover);
}

.feat-table td {
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.feat-table tbody tr {
  cursor: pointer;
}

.feat-table tbody tr:hover {
  background: var(--hover);
}

.feat-table tbody tr[data-selected="true"] {
  background: var(--active);
}

.feat-name {
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.feat-name:hover {
  text-decoration: underline;
}

.feat-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.feat-muted {
  color: var(--muted);
}

.feat-translation code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.feat-flag {
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.feat-copy {
  margin-left: 6px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 6px;
  cursor: pointer;
}

.feat-copy:hover {
  background: var(--hover);
  color: var(--text);
}
/* The checks panel. Colors come from the app's theme tokens, so light and dark both work. */

.ck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px var(--gutter) 20px; /* the 16 px gutter the title and the view bar start on */
  font-size: 13px;
  line-height: 1.4;
}

.ck-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ck-spacer {
  flex: 1 1 auto;
}

.ck-status {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.ck-status[data-status="pass"] {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--text);
}

.ck-status[data-status="fail"] {
  background: var(--err-bg);
  border-color: var(--err-line);
  color: var(--text);
}

.ck-status[data-status="manual"] {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--text);
}

.ck-summary {
  font-variant-numeric: tabular-nums;
}

.ck-meta,
.ck-muted {
  color: var(--muted);
}

.ck-meta {
  margin: 0;
  font-size: 12px;
}

.ck-meta strong {
  color: var(--text);
  font-weight: 600;
}

.ck-notice,
.ck-alert {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--text);
  font-size: 12px;
}

.ck-alert {
  border-color: var(--err-line);
  background: var(--err-bg);
}

.ck-alert-actions {
  margin-top: 6px;
}

.ck-copy-fallback {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.ck-inputs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ck-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
}

.ck-field input,
.ck-field select {
  font: inherit;
  font-size: 13px;
  padding: 3px 6px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-width: 11em;
}

.ck-field input[aria-invalid="true"] {
  border-color: var(--err-line);
}

.ck-field-error {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  padding-left: 8px;
  border-left: 3px solid var(--err-line);
}

.ck-clear {
  margin: 4px 0;
  color: var(--muted);
}

.ck-group-title {
  margin: 10px 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.ck-count {
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--text);
}

.ck-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ck-finding {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 6px;
  background: var(--bg);
}

.ck-finding[data-severity="fail"] {
  border-left-color: var(--err-line);
}

.ck-finding[data-severity="warn"] {
  border-left-color: var(--warn-line);
}

.ck-finding[data-severity="info"] {
  border-left-color: var(--accent);
}

.ck-finding[aria-current="true"] {
  background: var(--active);
}

.ck-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  padding: 6px 8px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
}

.ck-jump {
  cursor: pointer;
  border-radius: 6px;
}

.ck-jump:hover {
  background: var(--hover);
}

.ck-glyph {
  flex: none;
  width: 1.4em;
  height: 1.4em;
  line-height: 1.4em;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text);
}

.ck-glyph[data-severity="fail"] {
  background: var(--err-bg);
  border-color: var(--err-line);
}

.ck-glyph[data-severity="warn"] {
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.ck-glyph[data-severity="info"] {
  background: var(--hover);
  border-color: var(--accent);
}

.ck-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ck-rule {
  font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
}

.ck-message {
  overflow-wrap: anywhere;
}

.ck-hint {
  margin: 0;
  padding: 0 8px 6px 38px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.ck-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px 6px 38px;
}

.ck-range {
  font: 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 1px 6px;
  color: var(--accent);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.ck-range:hover {
  background: var(--hover);
}

.ck-jump:focus-visible,
.ck-range:focus-visible,
.ck-details summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.ck-details {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

.ck-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}

.ck-notes {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--muted);
}

.ck-table-wrap {
  overflow-x: auto;
  margin-top: 6px;
}

.ck-table {
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ck-table th,
.ck-table td {
  padding: 3px 10px 3px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.ck-table th {
  color: var(--muted);
  font-weight: 600;
}

/* Results for content that has since changed: shown, but plainly not the answer. */
.ck-outdated {
  opacity: 0.55;
}
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f5f5f7;
  --line: #e4e4e9;
  /* Borders of controls (inputs, buttons). Light keeps its one line colour; dark needs a stronger one. */
  --line-strong: #e4e4e9;
  --text: #1d1d1f;
  --muted: #636366;
  --accent: #0066cc;
  --hover: #ececf1;
  /* Under the pointer while it is pressed: one step deeper than hover. */
  --pressed: #e2e2e8;
  --active: #e2edfc;
  --disabled: #9a9aa0;
  --ok-bg: #e8f5ec;
  --ok-line: #9bd0ac;
  --warn-bg: #fff6e0;
  --warn-line: #e6c36a;
  --warn-text: #7a5a00;
  --err-bg: #fdecec;
  --err-line: #e49a9a;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --panel: #1b1c1f;
  --line: #34363b;
  --line-strong: #737a87;
  --text: #e6e8eb;
  --muted: #a7aeb8;
  --accent: #6ea8ff;
  --hover: #26282c;
  --pressed: #32353b;
  --active: #243652;
  --disabled: #6a707a;
  --ok-bg: #12301d;
  --ok-line: #2c6b43;
  --warn-bg: #3a2f10;
  --warn-line: #7a6320;
  --warn-text: #e6c36a;
  --err-bg: #3a1618;
  --err-line: #7c2d31;
}

* {
  box-sizing: border-box;
}

/*
 * Blueprint's global stylesheet (shipped inside OVE) sets its own dark
 * `body { color }`, which only looked right in the light theme by accident.
 * `:root body` outranks it whatever the load order.
 */
:root body {
  color: var(--text);
  background: var(--bg);
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w, 280px) 1fr;
  position: relative;
  height: 100%;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.sidebar h1 {
  color: var(--text); /* Blueprint's global heading colour is dark */
  font-size: 15px;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field select {
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}

select {
  font: inherit;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.crumbs button {
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 4px;
  font: inherit;
  font-size: 13px;
}

.crumbs button + button::before {
  content: "/";
  color: var(--muted);
  margin-right: 6px;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.files button {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 5px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.files button:hover:not(:disabled) {
  background: var(--hover);
}

/* Open in a tab, and the one showing. */
.files button.open {
  box-shadow: inset 3px 0 0 var(--line);
}

.files button.active {
  background: var(--active);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.files button:disabled {
  color: var(--disabled);
  cursor: default;
}

.fmeta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.fname {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.fmark {
  flex: none;
}

.fdot {
  flex: none;
  color: var(--warn-text);
}

/* A name on one line that drops its middle, not its end (names.ts). */
.mid {
  display: flex;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.mid-head {
  min-width: 4ch; /* never down to a lone character */
  overflow: hidden;
  text-overflow: ellipsis;
}

.mid-tail {
  flex: none;
}

.files .empty {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 8px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.status {
  padding: 8px 14px 7px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  min-width: 0;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text); /* Blueprint's global heading colour is dark */
  min-width: 0;
  flex: 0 1 auto;
}

.status-row .chip {
  flex: none;
}

/* Under the name: the facts, the folder (shortened from the left so the part nearest the file stays), the checks. */
.status-sub {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  margin-top: 1px;
  font-size: 12px;
  color: var(--muted);
}

.status-facts {
  flex: none;
  white-space: nowrap;
}

.status-dir {
  flex: 1 1 0;
  min-width: 0;
  direction: rtl;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-checks {
  flex: 0 1 auto;
  margin-left: auto;
  min-width: 0;
  max-width: 55%;
  font: inherit;
  font-size: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-checks[data-level="error"] {
  font-weight: 600;
}

.status .path {
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-weight: 400 !important;
}

.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  color: var(--muted);
}

.chip.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-text);
}

.notices {
  display: flex;
  flex-direction: column;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.notice.ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
}

.notice.warning {
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.notice.error {
  background: var(--err-bg);
  border-color: var(--err-line);
}

.notice button {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  white-space: nowrap;
}

.editor {
  flex: 1;
  min-height: 0;
  position: relative;
}

.editor-host,
.ove-host {
  height: 100%;
  width: 100%;
}

.who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who button {
  font: inherit;
  font-size: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  padding: 2px 8px;
  cursor: pointer;
  color: var(--text);
}

.notice a {
  font-size: 12px;
  white-space: nowrap;
  color: var(--accent);
}

/* The theme toggle. */
.theme {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}

.theme button {
  flex: 1;
  border: 0;
  background: var(--bg);
  color: var(--muted);
  padding: 5px 0;
  cursor: pointer;
  font: inherit;
}

.theme button + button {
  border-left: 1px solid var(--line);
}

.theme button[aria-pressed="true"] {
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* Labelled view controls above the editor. */
.viewbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.viewbar-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.viewbar-field select {
  padding: 3px 6px;
  font-size: 12.5px;
}

/* File browser: filter, sort, recents, preview. */
.filebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filesearch {
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  width: 100%;
}

.filesearch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filesort {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
}

.filesort button {
  flex: 1;
  border: 0;
  background: var(--bg);
  color: var(--muted);
  padding: 3px 0;
  cursor: pointer;
  font: inherit;
}

.filesort button + button {
  border-left: 1px solid var(--line);
}

.filesort button[aria-pressed="true"] {
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}

.recents h2 {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2px 0 4px;
  font-weight: 600;
}

.recents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recents button {
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 3px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  min-width: 0;
}

.recents button:hover {
  background: var(--hover);
}

/* The name has the whole line; only when it truly does not fit does its middle give way. */
.rname {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* The folder is on its own line, shortened from the left so the folder nearest the file stays. */
.rdir {
  display: block;
  font-size: 11px;
  color: var(--muted);
  direction: rtl;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 12.5px;
  min-height: 62px;
}

.preview p {
  margin: 0 0 2px;
}

.pname {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pmuted {
  color: var(--muted);
}

.perror {
  color: var(--warn-text);
}

/* Open files as tabs. */
.tabstrip {
  display: flex;
  overflow-x: auto;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}

.tab {
  display: flex;
  align-items: stretch;
  border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent;
  color: var(--muted);
  flex: none;
  max-width: 260px;
}

.tab[data-active="true"] {
  background: var(--bg);
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-main {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  padding: 7px 4px 7px 12px;
  cursor: pointer;
  min-width: 0;
}

.tab[data-active="true"] .tab-main {
  font-weight: 600;
}

.tab-label {
  display: flex;
  min-width: 0;
}

.tab-dot {
  color: var(--warn-text);
  font-size: 10px;
}

.tab-close {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  padding: 0 8px;
  cursor: pointer;
  border-radius: 4px;
}

.tab-close:hover,
.tab-main:hover {
  background: var(--hover);
}

.sidebar .files {
  min-height: 80px;
}

.viewbar-spacer {
  flex: 1;
}

.viewbar-button {
  font: inherit;
  font-size: 12.5px;
  padding: 3px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.viewbar-button:hover:not(:disabled) {
  background: var(--hover);
}

.viewbar-button:disabled {
  color: var(--disabled);
  cursor: default;
}

.viewbar-button.primary:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

/* Shortcut help overlay. */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  z-index: 1000;
}

.dialog {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px 18px;
  width: min(560px, 100%);
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dialog h2,
.dialog h3 {
  color: var(--text); /* Blueprint's global heading colour is dark */
  margin: 0;
}

.dialog h2 {
  font-size: 16px;
}

.dialog h3 {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
}

.dialog-head button {
  font: inherit;
  font-size: 12.5px;
  padding: 3px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.shortcuts {
  margin: 0;
}

.shortcuts > div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 12px;
  padding: 3px 0;
  font-size: 13px;
}

.shortcuts dt,
.shortcuts dd {
  margin: 0;
}

kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  white-space: nowrap;
}

/* The link that jumps past the sidebar and tabs, visible only when it has focus. */
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 1100;
  background: var(--accent);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.skip:focus {
  top: 8px;
}

/* The one slim bar for notes and warnings. */
.noticebar {
  border-bottom: 1px solid var(--line);
  background: var(--warn-bg);
  color: var(--text);
  font-size: 12.5px;
}

.noticebar[data-level="ok"] {
  background: var(--ok-bg);
}

.noticebar[data-level="error"] {
  background: var(--err-bg);
}

.noticebar-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 14px;
  min-height: 26px;
}

.noticebar-mark {
  flex: none;
  color: var(--warn-text);
}

.noticebar[data-level="error"] .noticebar-mark {
  color: var(--text);
}

.noticebar-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.noticebar-toggle {
  flex: none;
  font: inherit;
  font-size: 12px;
  padding: 1px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.noticebar-list {
  list-style: none;
  margin: 0;
  padding: 2px 14px 6px 36px;
  border-top: 1px solid var(--line);
}

.noticebar-list li {
  padding: 2px 0;
  position: relative;
}

.noticebar-list li .noticebar-mark {
  position: absolute;
  left: -20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Save as. */
.dialog-note {
  margin: 8px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.dialog-note code {
  color: var(--text);
  overflow-wrap: anywhere;
}

.dialog-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.dialog-field input,
.dialog-field select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

.dialog-error {
  margin: 8px 0;
  padding: 6px 10px;
  border: 1px solid var(--err-line);
  background: var(--err-bg);
  border-radius: 6px;
  font-size: 12.5px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.dialog-actions button {
  font: inherit;
  font-size: 13px;
  padding: 5px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.dialog-actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.dialog-actions button:disabled {
  color: var(--disabled);
  cursor: default;
}

/* The design checks' line in the notice bar: a link to the Checks tab that shrinks, or wraps when expanded. */
.noticebar-checks {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 55%;
  font: inherit;
  font-size: 12.5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

span.noticebar-checks {
  color: var(--text);
  text-decoration: none;
  cursor: default;
}

.noticebar-checks-full {
  max-width: none;
  white-space: normal;
  overflow: visible;
}
/*
 * The finish: the layer that gives the interface its type, its surfaces, its controls and its motion.
 *
 * Colours are still the tokens in styles.css (so the contrast tests and both themes keep holding); this file
 * is loaded after styles.css and the panels' own sheets and refines how their components are drawn: one type
 * scale, one radius scale, hairlines instead of boxes, real controls instead of the browser's defaults, tabs
 * that look like tabs, and short, quiet transitions. The editor's own toolbar and tabs are refined the same way
 * in editor/refine.css, which loads with the editor.
 */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-1: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.07);
  --shadow-2: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.16);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 120ms;
  --t: 200ms;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23636366' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  --shadow-1: 0 0 0 0.5px rgba(255, 255, 255, 0.07), 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 16px 40px rgba(0, 0, 0, 0.6);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23a7aeb8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
}

/* -- type ------------------------------------------------------------------------------------------ */

:root body,
button,
input,
select,
textarea {
  font-family: var(--font);
}

:root body {
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2 {
  letter-spacing: -0.015em;
}

::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
}

/* Numbers line up: sizes, lengths, versions, positions. */
.fmeta,
.status-facts,
.feat-num,
.noticebar,
.dock-count {
  font-variant-numeric: tabular-nums;
}

/* Quiet scrollbars that stay out of the way. */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent;
}

/* -- motion ---------------------------------------------------------------------------------------- */

button,
select,
input,
.tab,
.dock-tab,
.files button,
.feat-table tbody tr {
  transition:
    background-color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    opacity var(--t-fast) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* -- controls: real ones, not the browser's defaults ------------------------------------------------ */

select {
  appearance: none;
  -webkit-appearance: none;
  height: 30px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg) var(--chevron) no-repeat right 10px center / 10px 6px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
}

select:hover {
  background-color: var(--hover);
}

.filesearch,
.feat-filter {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

.filesearch::placeholder,
.feat-filter::placeholder {
  color: var(--muted);
}

/* Segmented controls: a track with a raised selected segment. */
.filesort,
.theme {
  padding: 2px;
  gap: 2px;
  border: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--text) 7%, var(--panel));
  overflow: visible;
}

.filesort button,
.theme button {
  border-radius: 7px;
  padding: 4px 0;
  background: none;
  font-weight: 500;
}

.theme button + button {
  border-left: 0;
}

.filesort button:hover:not([aria-pressed="true"]),
.theme button:hover:not([aria-pressed="true"]) {
  color: var(--text);
}

.filesort button[aria-pressed="true"],
.theme button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-1);
}

:root[data-theme="dark"] .filesort button[aria-pressed="true"],
:root[data-theme="dark"] .theme button[aria-pressed="true"] {
  background: var(--active);
}

/* -- the sidebar ----------------------------------------------------------------------------------- */

.sidebar {
  padding: 16px 12px 12px;
  gap: 10px;
  overflow: hidden;
}

.sidebar h1 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 6px 2px;
}

.ui-icon {
  flex: none;
}

/* The drag handle between the sidebar and the editor. */
.sidebar-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--sidebar-w, 280px) - 3px);
  width: 6px;
  z-index: 5;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  border-radius: 2px;
  background: transparent;
  transition: background-color var(--t) var(--ease);
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
body.resizing .sidebar-resizer::after {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}

body.resizing {
  cursor: col-resize;
  user-select: none;
}

/* The source: where the files come from, with its icon. */
.source {
  position: relative;
  display: flex;
  align-items: center;
}

.source .ui-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.source select {
  width: 100%;
  padding-left: 32px;
  font-weight: 550;
  text-overflow: ellipsis;
}

/* The path: Finder's path bar, not a stray link. */
.crumbs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1px;
  margin: 0 -2px;
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
}

/* One line: the first and last parts keep their room, the ones between give way with an ellipsis. */
.crumbs button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 6px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.crumbs button + button::before {
  content: none;
}

.crumbs button:hover {
  background: var(--hover);
  color: var(--text);
}

.crumbs button[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.crumbs .ui-icon-chevron {
  flex: none;
  opacity: 0.6;
}

.crumbs button:first-child {
  flex: none;
}

.crumbs button[aria-current="page"] {
  flex: 0 1 auto;
  min-width: 7ch;
}

.crumbs button:not(:first-child):not([aria-current="page"]) {
  flex: 0 100 auto; /* the middle parts shrink first, but never to a lone character */
  min-width: 7ch;
}

/* The filter: a field with its magnifier, a clear button, and the shortcut as a keycap. */
.searchwrap {
  position: relative;
  display: flex;
  align-items: center;
}

.searchwrap > .ui-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.searchwrap .filesearch {
  padding: 0 52px 0 30px;
  -webkit-appearance: none;
  appearance: none;
}

.searchwrap .filesearch::-webkit-search-cancel-button {
  display: none;
}

.searchkey {
  position: absolute;
  right: 8px;
  padding: 1px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  pointer-events: none;
}

.searchclear {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.searchclear:hover {
  color: var(--text);
}

.filesort {
  font-size: 11.5px;
}

/* Sections: a quiet label, then the rows. */
.recents h2 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 6px 8px 3px;
}

/* Rows, in the file list and in Recent: an icon, then the name over what it is. */
.files button,
.recents button {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 9px;
  border-radius: var(--r-md);
  text-align: left;
}

.files button {
  padding: 5px 10px;
}

.recents button {
  padding: 4px 10px;
}

.files button > .ui-icon,
.recents button > .ui-icon {
  grid-column: 1;
  color: var(--muted);
}

.files button > .ui-icon-chevron {
  grid-column: 3;
  opacity: 0.55;
}

.files button.active > .ui-icon,
.files button.open > .ui-icon,
.recents button:hover > .ui-icon {
  color: var(--accent);
}

.ftext,
.rtext {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.files button:disabled > .ui-icon {
  color: var(--disabled);
}

.files button.open {
  box-shadow: none;
  background: color-mix(in srgb, var(--text) 4%, transparent);
}

.files button.active {
  box-shadow: none;
  font-weight: 500;
}

.fname {
  font-weight: 450;
}

.fmeta {
  font-size: 11px;
}

.files {
  margin: 0 -4px;
  padding: 0 4px;
}

.files .empty {
  padding: 18px 12px;
  text-align: center;
  line-height: 1.5;
}

/* What is under the pointer: a quiet note at the foot, not a block of text. */
.preview {
  border-top: 1px solid var(--line);
  padding: 10px 6px 2px;
  min-height: 58px;
}

.pname {
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 2px;
}

.preview p {
  margin: 0;
}

.theme {
  margin-top: 2px;
}

/* -- tabs: they look like tabs ---------------------------------------------------------------------- */

.tabstrip {
  padding: 6px 8px 0;
  gap: 2px;
  align-items: flex-end;
}

.tab {
  border: 0;
  border-radius: var(--r-md) var(--r-md) 0 0;
  max-width: 240px;
  margin-bottom: -1px;
}

.tab:hover:not([data-active="true"]) {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  color: var(--text);
}

.tab[data-active="true"] {
  background: var(--bg);
  border-bottom: 0;
  box-shadow:
    0 -0.5px 0 var(--line),
    0.5px 0 0 var(--line),
    -0.5px 0 0 var(--line);
}

.tab-main {
  padding: 8px 4px 8px 12px;
  font-weight: 450;
}

.tab[data-active="true"] .tab-main {
  font-weight: 550;
}

.tab-main:hover {
  background: none;
}

.tab-close {
  width: 20px;
  height: 20px;
  margin: auto 6px auto 0;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  opacity: 0;
}

.tab:hover .tab-close,
.tab[data-active="true"] .tab-close,
.tab-close:focus-visible {
  opacity: 1;
}

.tab-close:hover {
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

/* -- the title block and the view bar --------------------------------------------------------------- */

.status {
  padding: 12px 16px 10px;
}

.status-name {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.chip {
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.status-sub {
  margin-top: 3px;
}

.viewbar {
  padding: 8px 16px;
  gap: 14px;
  background: var(--bg);
}

.viewbar-field {
  gap: 6px;
  font-weight: 500;
}

.viewbar-field select {
  height: 28px;
  padding: 0 26px 0 9px;
  font-size: 12.5px;
}

.viewbar-button {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-md);
  font-weight: 500;
  background: var(--bg);
  box-shadow: var(--shadow-1);
}

.viewbar-button:not(.primary) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.viewbar-button:hover:not(:disabled) {
  background: var(--hover);
}

.viewbar-button.primary:not(:disabled) {
  box-shadow: var(--shadow-1);
}

.viewbar-button.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
  border-color: color-mix(in srgb, var(--accent) 88%, var(--text));
}

.viewbar-button.primary:disabled {
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
}

/* -- the dock ---------------------------------------------------------------------------------------- */

.dock-header {
  padding: 0 6px;
}

.dock-tab {
  border: 0;
  border-radius: var(--r-md);
  margin: 4px 1px;
  padding: 5px 10px;
  font-weight: 500;
}

.dock-header[data-rail="true"] .dock-tab {
  margin: 1px 4px;
  width: calc(100% - 8px);
}

.dock-tab[aria-selected="true"] {
  border: 0;
  background: var(--active);
  color: var(--text);
  font-weight: 600;
}

.dock-header[data-rail="true"] .dock-tab[aria-selected="true"] {
  border: 0;
}

.dock-icon {
  display: inline-grid;
  place-items: center;
  font-size: inherit;
}

.dock-tab .panel-icon {
  opacity: 0.8;
}

.dock-tab[aria-selected="true"] .panel-icon {
  opacity: 1;
  color: var(--accent);
}

/* -- tables ------------------------------------------------------------------------------------------ */

.feat-table th button {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.feat-table td {
  padding: 5px 10px;
}

.feat-name {
  font-weight: 500;
}

.feat-bar {
  padding: 8px 12px;
}

/* -- dialogs and overlays ---------------------------------------------------------------------------- */

.dialog {
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-2);
}

.overlay {
  backdrop-filter: blur(6px) saturate(140%);
}

/* -- rhythm: one spacing scale, one gutter, and tighter bands so the work gets the room ----------------------- */
/*
 * Spacing comes from a short scale (4, 8, 12, 16, 24) and the content aligns to one 16 px gutter. The bands above and below the maps are
 * tightened by a few pixels each, which gives the editor about 40 px more height at 900 px; a short window (up to 820 px) is tighter again,
 * automatically, so a laptop keeps its maps. Everything else follows these variables.
 */

:root {
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --gutter: 16px;
  /* What the bands use: comfortable by default. */
  --bar-v: 5px; /* vertical padding of a bar of controls */
  --ctl-h: 26px; /* a control in a bar */
  --tab-v: 7px; /* vertical padding inside a file tab */
  --head-v: 9px; /* vertical padding of the title block */
  --row-v: 4px; /* vertical padding of a row in a list or a table */
}

@media (max-height: 820px) {
  :root {
    --bar-v: 3px;
    --ctl-h: 24px;
    --tab-v: 5px;
    --head-v: 6px;
    --row-v: 3px;
  }
}

.tabstrip {
  padding-top: var(--s-1);
}

.tab-main {
  padding-top: var(--tab-v);
  padding-bottom: var(--tab-v);
}

.status {
  padding: var(--head-v) var(--gutter) calc(var(--head-v) - 2px);
}

.status-name {
  font-size: 18px;
  line-height: 1.2;
}

.status-sub {
  margin-top: 1px;
}

.viewbar {
  padding: var(--bar-v) var(--gutter);
}

.viewbar-field select,
.viewbar-button {
  height: var(--ctl-h);
}

.files button {
  padding-top: var(--row-v);
  padding-bottom: var(--row-v);
}

.recents button {
  padding-top: calc(var(--row-v) - 1px);
  padding-bottom: calc(var(--row-v) - 1px);
}

.dock-tab {
  margin: 3px 1px;
  padding: var(--s-1) 10px;
}

.feat-bar {
  padding: var(--bar-v) var(--gutter);
}

.feat-filter {
  height: var(--ctl-h);
}

.feat-table th button {
  padding: var(--s-1) 10px;
}

.feat-table td {
  padding: var(--row-v) 10px;
}

/* The first column starts on the gutter, like the title above it. */
.feat-table th:first-child button,
.feat-table td:first-child {
  padding-left: var(--gutter);
}

/* -- states: hover, pressed, focus and disabled, one model for everything --------------------------------- */
/*
 * Rest, then hover (--hover), then pressed (--pressed, one step deeper), then selected (--active). A control answers the pointer on the
 * way down as well as on the way in: nothing is the same pressed as hovered. Links change colour, not ground. Keyboard focus is
 * a solid accent ring that follows the control's shape, and sits inside controls that a scrolling or sticky container would clip.
 */

button,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: default;
}

/* Pressed: rows, segments, tabs and the quiet buttons. */
.files button:active:not(:disabled),
.recents button:active,
.crumbs button:active,
.dock-tab:active:not([aria-selected="true"]),
.feat-table tbody tr:active,
.feat-table th button:active,
.feat-copy:active,
.viewbar-button:not(.primary):active:not(:disabled),
select:active:not(:disabled) {
  background-color: var(--pressed);
}

.filesort button:active:not([aria-pressed="true"]),
.theme button:active:not([aria-pressed="true"]) {
  background: color-mix(in srgb, var(--text) 11%, transparent);
  color: var(--text);
}

.tab:active:not([data-active="true"]) {
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.tab-close:active {
  background: color-mix(in srgb, var(--text) 20%, transparent);
}

.searchclear:active {
  color: var(--accent);
}

/* The filled button deepens; its disabled state stays quiet. */
.viewbar-button.primary:active:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 76%, var(--text));
  border-color: transparent;
}

/* Links: a quiet underline at rest, the full one on hover, a deeper colour while pressed. */
.status-checks,
.feat-name {
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.status-checks {
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.status-checks:hover,
.feat-name:hover {
  color: color-mix(in srgb, var(--accent) 86%, var(--text));
  text-decoration-color: currentColor;
}

.status-checks:hover {
  text-decoration-thickness: 1.5px;
}

.status-checks:active,
.feat-name:active {
  color: color-mix(in srgb, var(--accent) 68%, var(--text));
}

/* -- keyboard focus -------------------------------------------------------------------------------- */

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Inside: a ring on the outside of these would be cut off by the list, the strip or the sticky header around them. */
.files button:focus-visible,
.recents button:focus-visible,
.crumbs button:focus-visible,
.filesort button:focus-visible,
.theme button:focus-visible,
.dock-tab:focus-visible,
.feat-table th button:focus-visible {
  outline-offset: -2px;
}

/* A link in a padded cell has room for its ring outside. */
.feat-name:focus-visible {
  outline-offset: 2px;
  border-radius: 3px;
}

.tab-main:focus-visible {
  outline-offset: -2px;
  border-radius: var(--r-md) var(--r-md) 0 0;
}

.filesort button:focus-visible,
.theme button:focus-visible {
  border-radius: 7px;
}

/* -- the panels' kit: one look for the controls every panel draws ----------------------------------------- */
/*
 * Each track built its panel with its own buttons, fields and boxes, so the dock had four kinds of button and several kinds of field.
 * The families below are drawn alike here. The selectors sit under `.dock .dock-body` so they win on weight wherever a panel's own
 * (sometimes lazily loaded) stylesheet arrives, and a panel keeps its layout: only how a control is drawn changes, never where it goes.
 */

/* Buttons: panel-button (Library, Annotate, Primers), qc-button, asm-button, df-button. */
.dock .dock-body :is(.panel-button, .qc-button, .asm-button, .df-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--ctl-h);
  padding: 0 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}

.dock .dock-body :is(.panel-button, .qc-button, .asm-button, .df-button):hover:not(:disabled) {
  background: var(--hover);
}

.dock .dock-body :is(.panel-button, .qc-button, .asm-button, .df-button):active:not(:disabled) {
  background: var(--pressed);
}

.dock .dock-body :is(.panel-button, .qc-button, .asm-button, .df-button):disabled {
  color: var(--disabled);
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
  cursor: default;
}

/* A panel's own modifier keeps its say: the annotation run button is a little heavier than its neighbours. */
.dock .dock-body .panel-button.ann-run-button {
  font-weight: 600;
}

/* The one action of a panel: filled, in the accent. */
.dock .dock-body :is(.panel-button-primary, .qc-primary, .asm-primary, .df-primary):not(:disabled) {
  color: var(--bg);
  font-weight: 600;
  background: var(--accent);
  border-color: var(--accent);
}

.dock .dock-body :is(.panel-button-primary, .qc-primary, .asm-primary, .df-primary):hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
  border-color: color-mix(in srgb, var(--accent) 88%, var(--text));
  filter: none;
}

.dock .dock-body :is(.panel-button-primary, .qc-primary, .asm-primary, .df-primary):active:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 76%, var(--text));
  border-color: transparent;
}

/* Fields: the same height, radius and edge as the sidebar's. */
.dock .dock-body :is(input[type="text"], input[type="number"], input[type="search"], input:not([type]), .pr-tail-input, .df-copybox) {
  height: 28px;
  padding: 0 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

.dock .dock-body textarea {
  padding: 6px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

/* A panel's own stylesheet sets `background` on its selects, which drops the chevron the global rule draws; put it back. */
.dock .dock-body select {
  height: 28px;
  padding: 0 28px 0 10px;
  font-size: 12.5px;
  background: var(--bg) var(--chevron) no-repeat right 10px center / 10px 6px;
  border-color: var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

.dock .dock-body select:hover:not(:disabled) {
  background-color: var(--hover);
}

.dock .dock-body select:disabled {
  color: var(--disabled);
  box-shadow: none;
}

/* A slider is a slider, not a bordered box. */
.dock .dock-body input[type="range"] {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.dock .dock-body :is(input[type="checkbox"], input[type="radio"], input[type="range"]) {
  accent-color: var(--accent);
}

.dock .dock-body :is(input[type="checkbox"], input[type="radio"]) {
  width: 15px;
  height: 15px;
}

/* Boxes: one radius for every callout, alert and card. Their colours and levels stay their own. */
.dock .dock-body :is(.ann-callout, .ann-note, .ck-alert, .lib-alert, .lib-card, .pr-alert, .qc-banner, .asm-banner, .asm-note) {
  border-radius: 10px;
}

/* A row of actions inside a panel that is already padded to the gutter must not pad itself in again. */
.dock .dock-body :is(.ann, .ck, .lib, .pr, .qc) .panel-actions {
  padding-inline: 0;
}

/* The Features panel's bar and first column start on the same gutter as everything else in the dock. */
.dock .dock-body .feat-bar {
  padding-inline: var(--gutter);
}

.dock .dock-body .feat-table th:first-child > button {
  padding-left: var(--gutter);
}

.dock .dock-body .feat-table td:first-child {
  padding-left: var(--gutter);
}
