/*
 * presenter.css — the presenter panel of this demo (assets/presenter.js, from the master-builder barber run).
 * ?praesentieren shows it: dark ground, terracotta (accent) and olive (second colour) with live contrast.
 * The dark ground and the picks override the tokens of style.css, the panel reads its own aliases.
 */

/* Dark ground: olive night, sage links, the terracotta button as it is, a lighter terracotta where it is text.
   Pairs (contrast.mjs): ink 14.3 on paper, 12.9 on cream, 11.8 on card · muted 8.1, 7.3, 6.7 ·
   olive-text 10.6, 9.6, 8.7 · olive-500 7.0, 6.3, 5.8 · terra-text 6.3, 5.7, 5.2 · on-dark 10.3 on the band. */
:root[data-theme='dark'] {
  --paper: #1b1d17;
  --cream: #23261e;
  --card: #2a2d24;
  --olive-900: #121410;
  --olive-800: #333a2a;
  --olive-500: #a3a98e;
  --olive-150: #333a2a;
  --ink: #efebe2;
  --muted: #b8b3a5;
  --line: #3a3d31;
  --olive-text: #c9cfb4;
  --terra-text: #d98a6c;
}

/* The presenter's picks (presenter.js computes them). After the dark block, so a pick wins on either ground. */
:root[data-pick-accent] {
  --terra: var(--pick-accent);
  --terra-dark: var(--pick-accent-hover);
  --on-terra: var(--pick-accent-ink);
  --terra-text: var(--pick-accent-text);
}
:root[data-pick-secondary] {
  --olive-500: var(--pick-secondary);
  --olive-text: var(--pick-secondary-strong);
}

/* The panel: same rules as on the Astro demos, on aliases of this site's tokens. */
.tpanel {
  --color-bg: var(--paper);
  --color-surface: var(--cream);
  --color-text: var(--ink);
  --color-text-muted: var(--muted);
  --color-heading: var(--ink);
  --color-line: var(--line);
  --color-focus: var(--terra);
  --panel-rule: var(--terra);
  --panel-label: var(--olive-500);
  --border-width: 1px;
  --focus-width: 2px;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-l: 0 18px 40px -20px rgb(0 0 0 / 0.35);
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --text-sm: 0.9rem;
  --text-xs: 0.78rem;
  --weight-strong: 600;
  font-family: var(--sans);
  line-height: 1.45;
}
.tpanel .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tpanel p { margin: 0; }
.tpanel {
  position: fixed;
  inset-inline-start: var(--space-s);
  inset-block-end: var(--space-s);
  z-index: var(--z-panel, 70);
  width: min(19rem, calc(100vw - 2 * var(--space-s)));
  max-height: calc(100vh - 2 * var(--space-s));
  overflow-y: auto;
  padding: var(--space-xs) var(--space-s) var(--space-s);
  background: var(--color-surface);
  color: var(--color-text);
  border: var(--border-width) solid var(--color-line);
  border-block-start: var(--border-width) solid var(--panel-rule, var(--color-text-muted));
  border-radius: 0 0 var(--radius-m) var(--radius-m);
  box-shadow: var(--shadow-l);
  font-size: var(--text-sm);
}
.tpanel[hidden],
.tpanel__body[hidden] {
  display: none;
}
.tpanel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
}
.tpanel__toggle,
.tpanel__link {
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tpanel__toggle {
  color: var(--color-heading);
  font-weight: var(--weight-strong);
  font-stretch: var(--panel-title-stretch, 100%);
}
.tpanel__link {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.tpanel__body {
  display: grid;
  gap: var(--space-s);
  margin-block-start: var(--space-2xs);
}
.tpanel__group {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  border: 0;
}
.tpanel__group legend {
  margin-block-end: var(--space-2xs);
  padding: 0;
  color: var(--panel-label, var(--color-text-muted));
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

/* Dunkel | Hell: two radio buttons, the checked one filled. */
.tpanel__seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: var(--border-width) solid var(--color-line);
  border-radius: var(--radius-s);
}
.tpanel__seg label {
  display: grid;
  place-items: center;
  min-height: 2.25rem;
  cursor: pointer;
}
.tpanel__seg input,
.tpanel__pick input[type='radio'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tpanel__seg label:has(input:checked) {
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: var(--weight-strong);
}

.tpanel__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}
.tpanel__pick {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: var(--radius-s);
  cursor: pointer;
}
.tpanel__pick--original {
  padding-inline: var(--space-2xs);
  border: var(--border-width) solid var(--color-line);
  font-size: var(--text-xs);
}
.tpanel__chip {
  width: 2rem;
  height: 2rem;
  border: var(--border-width) solid var(--color-line);
  border-radius: var(--radius-s);
  background: var(--swatch);
}
.tpanel__pick--custom input {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: var(--border-width) dashed var(--color-text-muted);
  border-radius: var(--radius-s);
  background: none;
  cursor: pointer;
}
.tpanel__pick:has(input:checked),
.tpanel__pick--custom.is-active {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}
.tpanel__seg label:has(input:focus-visible),
.tpanel__pick:has(input:focus-visible) {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: 2px;
}
.tpanel__readout {
  min-height: 2lh;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  white-space: pre-line;
}

.tpanel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}
.tpanel__btn {
  min-height: 2.25rem;
  padding: 0 var(--space-s);
  border: var(--border-width) solid var(--color-line);
  border-radius: var(--radius-s);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}
.tpanel__btn:hover {
  border-color: var(--color-text-muted);
}
.tpanel__note {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}
