/* Theme harness. Own colors so a dark pack cannot restyle the controls. */
.theme-harness {
  --th-ink: #1c2430;
  --th-cream: #f6f1e8;
  --th-line: #d9d0c2;
  --th-accent: #0f6e62;
  --th-up: #1f7a4d;
  --th-side: #8a5a12;
  --th-down: #8f2d2d;
  --th-error: #9a3412;
  position: fixed;
  z-index: 10000;
  top: 0;
  left: 0;
  right: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--th-ink);
  pointer-events: none;
}

.theme-harness * {
  box-sizing: border-box;
}

.theme-harness__tab,
.theme-harness__bar {
  pointer-events: auto;
}

.theme-harness__tab {
  position: absolute;
  top: 0;
  left: 12px;
  border: 1px solid var(--th-line);
  border-top: 0;
  background: var(--th-cream);
  color: var(--th-ink);
  border-radius: 0 0 8px 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(28, 36, 48, 0.12);
}

.theme-harness.is-open .theme-harness__tab {
  display: none;
}

.theme-harness__bar {
  user-select: none;
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px;
  padding: 8px 10px;
  background: var(--th-cream);
  border: 1px solid var(--th-line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(28, 36, 48, 0.16);
}

.theme-harness.is-open .theme-harness__bar {
  display: flex;
}

.theme-harness__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 4px;
}

.theme-harness__select,
.theme-harness__btn {
  border: 1px solid var(--th-line);
  background: #fffdf8;
  color: var(--th-ink);
  border-radius: 8px;
  min-height: 32px;
  padding: 4px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.theme-harness__select {
  min-width: 12rem;
  max-width: 18rem;
}

.theme-harness__btn--icon {
  width: 36px;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-harness__btn--icon svg {
  display: block;
}

.theme-harness__btn--down svg {
  transform: rotate(180deg);
}

.theme-harness__btn[aria-pressed="true"] {
  border-color: var(--th-accent);
  background: #e7f4f1;
  font-weight: 700;
}

.theme-harness__btn--up[aria-pressed="true"] { color: var(--th-up); border-color: var(--th-up); }
.theme-harness__btn--side[aria-pressed="true"] { color: var(--th-side); border-color: var(--th-side); }
.theme-harness__btn--down[aria-pressed="true"] { color: var(--th-down); border-color: var(--th-down); }
.theme-harness__btn--error[aria-pressed="true"] { color: var(--th-error); border-color: var(--th-error); background: #fde8e4; }

.theme-harness__group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.theme-harness__status {
  min-width: 4.5rem;
  font-size: 12px;
}

.theme-harness__save:disabled {
  opacity: 0.6;
}

.theme-harness__count {
  font-size: 12px;
  opacity: 0.75;
  min-width: 4.5rem;
}

.theme-harness__hide {
  margin-left: auto;
}

body.theme-harness-open {
  padding-top: 64px;
}

@media (max-width: 720px) {
  .theme-harness__hide { margin-left: 0; }
  body.theme-harness-open { padding-top: 128px; }
}
