/* KRYONOM CAPITAL FARM — Time Machine.
   The Capital Farm demonstrator's visual language (palette, type, bar, panels, chips, buttons and truth bar), carried
   into the farm's dimension of time. Desktop: the world beside one column of panels, all in one screen. Phone: the world
   first, the panels below in a page that scrolls, the transport docked at the thumb. */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/Archivo-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: block;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/JetBrainsMono-Variable.ttf') format('truetype-variations');
  font-weight: 100 800;
  font-display: block;
}

:root {
  --c-bg: #1b0718;
  --c-plum: #35132f;
  --c-raised: #4a2143;
  --c-ivory: #f4f0e4;
  --c-lime: #c8f542;
  --c-gold: #e2b45e;
  --c-deep-gold: #b38b45;
  --c-rose: #c9727e;
  --c-cyan: #39d3f2;
  --c-panel: #21091e;
  --c-panel-hi: #2a0e26;
  --c-line: #35132f;
  --c-line-hi: #5b2b53;
  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-ui: 'Archivo', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --side-w: 392px;
  --target: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-ivory);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(ellipse 80% 70% at 50% 42%, rgba(74, 33, 67, 0.34), rgba(27, 7, 24, 0) 70%),
    linear-gradient(rgba(244, 240, 228, 0.028) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(244, 240, 228, 0.028) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--c-bg);
  min-height: 100%;
}

button {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 1.5px solid var(--c-lime);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.t-display {
  font-family: var(--font-display);
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.t-caption {
  font-family: var(--font-display);
  font-stretch: 125%;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 600;
  font-size: 9.5px;
  color: rgba(244, 240, 228, 0.5);
}
.t-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.font-warm {
  position: absolute;
  left: -9999px;
  top: 0;
  visibility: hidden;
}
.font-warm .w1 {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
}
.font-warm .w2 {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ------------------------------------------------------------------------------------------------ shell */
.tm {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* the top bar of the Capital Farm */
.tm-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 58px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(33, 9, 30, 0.97), rgba(27, 7, 24, 0.97));
  border-bottom: 1px solid var(--c-line-hi);
  position: relative;
  z-index: 5;
}
.tm-bar::after {
  content: '';
  position: absolute;
  left: 22px;
  bottom: -1px;
  width: 64px;
  height: 2px;
  background: var(--c-lime);
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
  text-decoration: none;
}
.wordmark .wm-cf {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.09em;
  color: var(--c-ivory);
}
.wordmark .wm-by {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(244, 240, 228, 0.72);
}
.wordmark .wm-k {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--c-ivory);
}
.tm-nav {
  display: flex;
  gap: 26px;
  margin-left: 18px;
  height: 100%;
  /* a narrow window scrolls the navigation instead of pushing the bar off the screen */
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.tm-nav::-webkit-scrollbar {
  display: none;
}
/* scrolled: the tabs before it fade out at the edge */
.tm-nav[data-scrolled='1'] {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32px);
  mask-image: linear-gradient(90deg, transparent 0, #000 32px);
}
.wordmark,
.tm-bar-right {
  flex: none;
}
.tm-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(244, 240, 228, 0.55);
  border-bottom: 3px solid transparent;
  padding-top: 3px;
  white-space: nowrap;
  transition: color 0.15s;
}
.tm-nav a:hover {
  color: rgba(244, 240, 228, 0.85);
}
.tm-nav a[aria-current='page'] {
  color: var(--c-ivory);
  border-bottom-color: var(--c-lime);
}
.tm-nav a .ext {
  font-size: 9px;
  opacity: 0.6;
  letter-spacing: 0;
}
.tm-bar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.tm-clock {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--c-ivory);
  min-width: 82px;
  text-align: right;
}
.tm-clock[data-alt='1'] {
  color: var(--c-cyan);
}

/* chips (the demonstrator's) */
.chip {
  --tone: 244, 240, 228;
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: rgb(var(--tone));
  border: 1px solid rgba(var(--tone), 0.55);
  background: rgba(var(--tone), 0.08);
  border-radius: 2px;
}
.chip[data-tone='lime'] {
  --tone: 200, 245, 66;
}
.chip[data-tone='gold'] {
  --tone: 226, 180, 94;
}
.chip[data-tone='rose'] {
  --tone: 201, 114, 126;
}
.chip[data-tone='cyan'] {
  --tone: 57, 211, 242;
}
.chip[data-tone='dim'] {
  opacity: 0.55;
}

/* ------------------------------------------------------------------------------------------------ main */
/* desktop: the experience is one screen; the column of panels scrolls on its own */
@media (min-width: 900px) and (min-height: 600px) {
  .tm {
    height: 100vh;
    height: 100dvh;
  }
}
.tm-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  min-height: 0;
}
.tm-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line-hi) transparent;
  padding-bottom: 2px;
}

/* panels (the demonstrator's chrome: plum gradient, line, corner brackets in the accent) */
.panel {
  --acc: var(--c-lime);
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(46, 15, 41, 0.94), rgba(31, 9, 29, 0.94));
  border: 1px solid var(--c-line-hi);
  min-width: 0;
  flex: 0 0 auto;
  transition:
    border-color 0.25s,
    box-shadow 0.35s;
}
.panel[data-accent='gold'] {
  --acc: var(--c-gold);
}
.panel[data-accent='cyan'] {
  --acc: var(--c-cyan);
}
.panel[data-accent='rose'] {
  --acc: var(--c-rose);
}
.panel .cb {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--acc);
  opacity: 0.55;
  pointer-events: none;
}
.panel .cb.tl {
  left: -1px;
  top: -1px;
  border-left: 1.5px solid;
  border-top: 1.5px solid;
}
.panel .cb.tr {
  right: -1px;
  top: -1px;
  border-right: 1.5px solid;
  border-top: 1.5px solid;
}
.panel .cb.bl {
  left: -1px;
  bottom: -1px;
  border-left: 1.5px solid;
  border-bottom: 1.5px solid;
}
.panel .cb.br {
  right: -1px;
  bottom: -1px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
}
.panel[data-state='active'] {
  border-color: rgba(57, 211, 242, 0.55);
  box-shadow: 0 0 22px rgba(57, 211, 242, 0.12);
}
.panel[data-state='active'] .cb {
  opacity: 1;
}
.panel-h {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 10px 0 12px;
  background: rgba(74, 33, 67, 0.38);
  border-bottom: 1px solid var(--c-line);
}
.panel-h .acc {
  width: 6px;
  height: 6px;
  background: var(--acc);
  flex: 0 0 6px;
}
.panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244, 240, 228, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-code {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(244, 240, 228, 0.5);
  white-space: nowrap;
}
.panel-b {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.panel-note {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(244, 240, 228, 0.66);
  margin: 0;
}

/* the world's panel */
.tm-world {
  min-height: 0;
  height: 100%;
}
.tm-world .panel-b {
  padding: 0;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}
.tm-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.tm-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.tm-caption {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  pointer-events: none;
  max-width: 46%;
}
.tm-caption > * {
  pointer-events: auto;
}
.tm-caption .cap-t {
  font-size: 10px;
  color: rgba(244, 240, 228, 0.55);
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.tm-caption .cap-hint {
  color: rgba(200, 245, 66, 0.7);
}
.tm-legend {
  position: absolute;
  z-index: 2;
  right: 14px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 9.5px;
  color: rgba(244, 240, 228, 0.5);
  text-align: right;
  pointer-events: none;
  font-family: var(--font-mono);
}
.tm-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 7px;
  transform: rotate(45deg);
  vertical-align: middle;
}
.tm-legend .l-lime {
  background: var(--c-lime);
}
.tm-legend .l-rose {
  background: var(--c-rose);
}
.tm-legend .l-gold {
  background: var(--c-gold);
  transform: none;
  height: 3px;
  width: 14px;
}
.tm-legend .l-cyan {
  background: var(--c-cyan);
  border-radius: 50%;
  transform: none;
}
.tm-hint {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  text-align: right;
  font-size: 10.5px;
  color: rgba(244, 240, 228, 0.45);
  pointer-events: none;
  font-family: var(--font-mono);
}
.tm-legend .lg-point {
  display: none;
  margin-top: 3px;
  color: rgba(200, 245, 66, 0.7);
}
@media (hover: hover) and (pointer: fine) {
  .tm-legend .lg-point {
    display: inline;
  }
}
.tm-tip {
  position: absolute;
  z-index: 3;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  background: rgba(33, 9, 30, 0.96);
  border: 1px solid var(--c-line-hi);
  border-left: 2px solid var(--c-lime);
  box-shadow: 0 10px 28px rgba(10, 2, 9, 0.55);
  pointer-events: none;
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(244, 240, 228, 0.82);
}
.tm-tip[data-tone='rose'] {
  border-left-color: var(--c-rose);
}
.tm-tip[data-tone='gold'] {
  border-left-color: var(--c-gold);
}
.tm-tip b {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ivory);
}
.tm-tip span:first-of-type {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(244, 240, 228, 0.6);
}
.tm-tip i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: rgba(200, 245, 66, 0.75);
}
.tm-boot {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.tm-boot[hidden] {
  display: none;
}
.tm-boot .t-caption {
  color: rgba(244, 240, 228, 0.6);
}

/* buttons (the demonstrator's) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 240, 228, 0.88);
  background: rgba(74, 33, 67, 0.45);
  border: 1px solid var(--c-line-hi);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
  position: relative;
}
.btn:hover {
  border-color: rgba(244, 240, 228, 0.45);
  color: var(--c-ivory);
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.btn.is-on,
.btn[aria-pressed='true'] {
  border-color: var(--c-lime);
  color: var(--c-lime);
  background: rgba(200, 245, 66, 0.08);
}
.btn-primary {
  border-color: rgba(200, 245, 66, 0.7);
  color: var(--c-lime);
}
.btn-primary.is-on {
  background: var(--c-lime);
  color: var(--c-bg);
}
.btn-what {
  border-color: rgba(57, 211, 242, 0.35);
}
.btn-what:hover {
  border-color: var(--c-cyan);
  color: var(--c-cyan);
}
.btn-what[aria-pressed='true'] {
  border-color: var(--c-cyan);
  color: var(--c-cyan);
  background: rgba(57, 211, 242, 0.1);
}
.btn-cyan {
  border-color: rgba(57, 211, 242, 0.75);
  color: var(--c-cyan);
}
.btn-cyan:not(:disabled):hover {
  background: rgba(57, 211, 242, 0.12);
  color: var(--c-cyan);
  border-color: var(--c-cyan);
}
.btn-speed {
  padding: 0 10px;
  font-family: var(--font-mono);
  font-stretch: 100%;
  letter-spacing: 0;
  font-size: 11px;
  text-transform: none;
}
.btn-icon {
  padding: 0 10px;
  min-width: 34px;
}
.btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
/* every control keeps a 44 px hit area even when it is drawn smaller */
.btn::after {
  content: '';
  position: absolute;
  inset: -7px -2px;
}

/* the transport under the world */
.tm-transport {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--c-line);
  background: rgba(33, 9, 30, 0.88);
  flex-wrap: wrap;
}
.tm-transport .sep {
  width: 1px;
  height: 20px;
  background: var(--c-line-hi);
  margin: 0 4px;
}
.tm-transport .grow {
  flex: 1 1 auto;
}
.tm-speeds {
  display: flex;
  gap: 4px;
}
.tm-now {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244, 240, 228, 0.6);
  white-space: nowrap;
}
.tm-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: rgba(244, 240, 228, 0.6);
  font-family: var(--font-mono);
}
.tm-volume[hidden] {
  display: none;
}
input[type='range'].tm-range {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 22px;
  background: transparent;
  margin: 0;
}
input[type='range'].tm-range::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(244, 240, 228, 0.16);
}
input[type='range'].tm-range::-moz-range-track {
  height: 3px;
  background: rgba(244, 240, 228, 0.16);
}
input[type='range'].tm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--acc-thumb, var(--c-lime));
  border: 2px solid var(--c-bg);
}
input[type='range'].tm-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--acc-thumb, var(--c-lime));
  border: 2px solid var(--c-bg);
}
.tm-time-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* key / value rows */
.kv-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.kv {
  display: grid;
  grid-template-columns: minmax(84px, auto) 1fr;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.kv-l {
  white-space: nowrap;
}
.kv-v {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(244, 240, 228, 0.88);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kv[data-tone='up'] .kv-v {
  color: var(--c-lime);
}
.kv[data-tone='down'] .kv-v {
  color: var(--c-rose);
}
.kv[data-tone='cyan'] .kv-v {
  color: var(--c-cyan);
}

/* the farm's capital */
.fm-big {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.05;
  color: var(--c-ivory);
  letter-spacing: -0.01em;
}
.fm-big[data-alt='1'] {
  color: var(--c-cyan);
}
.fm-delta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244, 240, 228, 0.6);
}
.fm-delta[data-tone='up'] {
  color: var(--c-lime);
}
.fm-delta[data-tone='down'] {
  color: var(--c-rose);
}
.fd-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fd-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
  padding: 3px 6px;
  border-left: 2px solid rgba(244, 240, 228, 0.2);
  color: rgba(244, 240, 228, 0.8);
}
.fd-row b {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  text-align: right;
}
.fd-row[data-tone='lime'] {
  border-left-color: var(--c-lime);
}
.fd-row[data-tone='lime'] b {
  color: var(--c-lime);
}
.fd-row[data-tone='rose'] {
  border-left-color: var(--c-rose);
}
.fd-row[data-tone='rose'] b {
  color: var(--c-rose);
}
.fd-row[data-tone='gold'] {
  border-left-color: var(--c-gold);
}
.fd-row[data-tone='gold'] b {
  color: var(--c-gold);
}

/* organisms */
.org-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.org-row {
  display: grid;
  grid-template-columns: 10px 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-left: 2px solid rgba(244, 240, 228, 0.12);
  background: rgba(244, 240, 228, 0.015);
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  position: relative;
}
.org-row::after {
  content: '';
  position: absolute;
  inset: -3px 0;
}
.org-row:hover {
  background: rgba(244, 240, 228, 0.045);
  border-color: rgba(244, 240, 228, 0.12);
}
.org-row .sq {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: var(--tone, var(--c-cyan));
}
.org-row .nm {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.1em;
}
.org-row .full {
  font-size: 11.5px;
  color: rgba(244, 240, 228, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-row .st {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--tone, var(--c-cyan));
  white-space: nowrap;
}

/* the decision's story: the eight organs as check rows */
.dc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.dc-when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244, 240, 228, 0.6);
}
.dc-reason {
  font-size: 13px;
  line-height: 1.45;
  color: var(--c-ivory);
  margin: 0;
}
.chain {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ck {
  display: grid;
  grid-template-columns: 10px 112px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: baseline;
  padding: 4px 6px;
  font-size: 11.5px;
  border-left: 2px solid transparent;
  min-height: 24px;
  width: 100%;
  text-align: left;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  cursor: pointer;
  color: inherit;
}
.ck:hover {
  background: rgba(244, 240, 228, 0.035);
}
.ck[aria-current='true'] {
  background: rgba(244, 240, 228, 0.06);
}
.ck-mark {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(244, 240, 228, 0.3);
  transform: rotate(45deg) translateY(1px);
  align-self: center;
}
.ck-l {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 240, 228, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ck-v {
  color: rgba(244, 240, 228, 0.86);
  line-height: 1.35;
  min-width: 0;
}
.ck-t {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(244, 240, 228, 0.42);
  text-align: right;
}
.ck[data-state='DONE'] .ck-mark {
  background: var(--c-lime);
  border-color: var(--c-lime);
}
.ck[data-state='DONE'] .ck-l {
  color: var(--c-lime);
}
.ck[data-state='ACTIVE'],
.ck[data-state='WAITING'] {
  background: rgba(226, 180, 94, 0.07);
  border-left-color: var(--c-gold);
}
.ck[data-state='ACTIVE'] .ck-mark,
.ck[data-state='WAITING'] .ck-mark {
  border-color: var(--c-gold);
  background: rgba(226, 180, 94, 0.5);
  animation: tm-heart 0.9s infinite;
}
.ck[data-state='ACTIVE'] .ck-l,
.ck[data-state='WAITING'] .ck-l {
  color: var(--c-gold);
}
.ck[data-state='HALTED'] {
  background: rgba(201, 114, 126, 0.1);
  border-left-color: var(--c-rose);
}
.ck[data-state='HALTED'] .ck-mark {
  background: var(--c-rose);
  border-color: var(--c-rose);
}
.ck[data-state='HALTED'] .ck-l,
.ck[data-state='HALTED'] .ck-v {
  color: var(--c-rose);
}
.ck[data-state='NOT_REACHED'] {
  opacity: 0.38;
}
.ck[data-state='IDLE'] .ck-v {
  color: rgba(244, 240, 228, 0.45);
}
@keyframes tm-heart {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
/* a button in a panel wraps its words rather than run past the panel's edge (a narrow phone, a wider font) */
.tm-side .panel-b .btn {
  height: auto;
  min-height: 30px;
  padding-top: 6px;
  padding-bottom: 6px;
  line-height: 1.25;
  white-space: normal;
  text-align: center;
}
.row-actions .btn {
  flex: 1 1 auto;
}
.dc-actions .btn {
  flex: 1 1 40%;
}
.dc-actions .btn-primary {
  flex-basis: 100%;
}

/* what if… */
.wf-link {
  width: 100%;
  height: auto;
  min-height: 30px;
  margin-top: 8px;
  padding: 6px 12px;
  white-space: normal;
  line-height: 1.35;
  text-align: center;
}
#tm-whatif {
  scroll-margin-top: 12px;
}
.wf-controls {
  display: grid;
  gap: 10px;
}
.wf-families {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
}
.wf-families .btn {
  justify-content: flex-start;
  height: auto;
  min-height: 30px;
  padding: 5px 10px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
}
.wf-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.wf-targets .btn {
  padding: 0 9px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
}
.wf-field {
  display: grid;
  gap: 5px;
}
.wf-field .wf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wf-field .wf-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-cyan);
}
.wf-field input[type='range'].tm-range {
  width: 100%;
  --acc-thumb: var(--c-cyan);
}
.wf-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: rgba(244, 240, 228, 0.4);
}
.wf-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.wf-choices .btn {
  padding: 0 9px;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.wf-help {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(244, 240, 228, 0.66);
  margin: 0;
}
.wf-error {
  font-size: 12px;
  color: var(--c-rose);
  margin: 0;
}
.wf-error:empty {
  display: none;
}
.wf-go {
  height: 38px;
}

/* the alternative future */
.af-title {
  font-size: 13.5px;
  color: var(--c-cyan);
  margin: 0;
  line-height: 1.4;
}
.af-progress {
  height: 3px;
  background: rgba(57, 211, 242, 0.12);
  position: relative;
  overflow: hidden;
}
.af-progress i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--c-cyan);
  transition: width 0.25s;
}
.af-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.af-cell {
  border: 1px solid rgba(91, 43, 83, 0.7);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(244, 240, 228, 0.015);
}
.af-cell b {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}
.af-cell[data-side='alt'] {
  border-color: rgba(57, 211, 242, 0.45);
}
.af-cell[data-side='alt'] b {
  color: var(--c-cyan);
}
.af-diff {
  font-family: var(--font-mono);
  font-size: 12px;
}
.af-diff[data-tone='up'] {
  color: var(--c-lime);
}
.af-diff[data-tone='down'] {
  color: var(--c-rose);
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.seg .btn {
  border-radius: 0;
}
.seg .btn + .btn {
  border-left: 0;
}
.seg .btn[aria-pressed='true'].alt {
  border-color: var(--c-cyan);
  color: var(--c-cyan);
  background: rgba(57, 211, 242, 0.1);
}
.af-orgs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

/* identity */
.id-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.id-sigil {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
.id-name {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.id-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(244, 240, 228, 0.55);
}

/* the truth bar */
.tm-truth {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 34px;
  padding: 0 18px;
  background: rgba(24, 6, 21, 0.97);
  border-top: 1px solid var(--c-line-hi);
  font-size: 11px;
}
.bb-disc {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(244, 240, 228, 0.78);
  font-weight: 500;
  white-space: nowrap;
}
.bb-sq {
  width: 7px;
  height: 7px;
  background: var(--c-gold);
  display: inline-block;
  flex: 0 0 7px;
}
.bb-back {
  margin: 0 auto;
  color: rgba(244, 240, 228, 0.6);
  text-decoration: none;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bb-back:hover {
  color: var(--c-lime);
}
.bb-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(244, 240, 228, 0.7);
  white-space: nowrap;
}
.bb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-lime);
  box-shadow: 0 0 8px rgba(200, 245, 66, 0.8);
  animation: tm-heart 1.1s ease-in-out infinite;
  flex: 0 0 7px;
}

.tm-error {
  color: var(--c-rose);
  padding: 24px;
  font-family: var(--font-mono);
  white-space: pre-wrap;
}

/* ------------------------------------------------------------------------------------------------ narrower desktops */
@media (max-width: 1280px) {
  .tm-nav {
    gap: 16px;
    margin-left: 4px;
  }
  .tm-bar {
    gap: 18px;
  }
  :root {
    --side-w: 360px;
  }
}
@media (max-width: 1180px) {
  /* the truth bar says it too */
  .tm-bar-right .chip {
    display: none;
  }
  .tm-nav {
    gap: 14px;
  }
  .tm-nav a {
    font-size: 9.5px;
  }
  .tm-truth {
    flex-wrap: wrap;
    gap: 4px 18px;
    padding: 7px 18px;
  }
  .tm-nav a {
    letter-spacing: 0.1em;
  }
}
@media (max-width: 1080px) {
  .tm-nav a .ext,
  .tm-nav .nav-film {
    display: none;
  }
  .tm-legend {
    display: none;
  }
}

/* ------------------------------------------------------------------------------------------------ phones and small windows:
   the world first, the panels below in a page that scrolls, the transport docked at the thumb */
@media (max-width: 899px), (max-height: 599px) and (max-width: 1100px) {
  .tm {
    display: block;
  }
  .tm-bar {
    flex-wrap: wrap;
    height: auto;
    gap: 0 10px;
    padding: 12px 14px 0;
    background: #1f081c;
  }
  .tm-bar::after {
    left: 14px;
  }
  .wordmark {
    gap: 5px;
  }
  .wordmark .wm-cf {
    font-size: 15px;
  }
  .wordmark .wm-by {
    font-size: 10px;
  }
  .wordmark .wm-k {
    font-size: 10px;
    letter-spacing: 0.13em;
  }
  .tm-bar-right {
    gap: 8px;
  }
  .tm-bar-right .chip {
    height: 18px;
    font-size: 8.5px;
    padding: 0 5px;
  }
  .tm-clock {
    font-size: 13px;
    min-width: 0;
  }
  .tm-nav {
    order: 3;
    flex: 0 0 calc(100% + 28px);
    margin: 6px -14px 0;
    padding: 0 14px;
    height: 44px;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .tm-nav::-webkit-scrollbar {
    display: none;
  }
  .tm-nav a {
    font-size: 10.5px;
    flex: 0 0 auto;
  }
  .tm-nav .nav-film {
    display: flex;
  }
  .tm-main {
    display: flex;
    flex-direction: column;
    padding: 10px 10px calc(76px + var(--safe-b));
  }
  .tm-world .panel-b {
    flex: none;
  }
  .tm-stage {
    flex: none;
    height: min(calc(100vw - 22px), 560px);
  }
  .tm-side {
    overflow: visible;
  }
  .tm-legend,
  .tm-hint {
    display: none;
  }
  .tm-caption {
    max-width: 70%;
    left: 8px;
    top: 8px;
  }
  .tm-caption > .btn {
    display: none;
  }
  .tm-world > .panel-h .head-back {
    display: inline-flex;
    flex: none;
    margin: 4px 0 4px 10px;
  }
  .tm-caption .cap-t {
    display: none;
  }
  /* the transport docks at the bottom of the screen */
  .tm-transport {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    gap: 6px;
    padding: 8px 10px calc(8px + var(--safe-b));
    background: #180615;
    border-top: 1px solid var(--c-line-hi);
    box-shadow: 0 -10px 24px rgba(10, 2, 9, 0.6);
    flex-wrap: nowrap;
  }
  .tm-transport .btn {
    min-height: 48px;
    height: auto;
    flex: 1 1 0;
    padding: 0 6px;
    font-size: 10px;
  }
  .tm-transport .tm-speeds,
  .tm-transport .sep,
  .tm-transport .tm-now {
    display: none;
  }
  .tm-transport .btn-speed-cycle {
    display: inline-flex;
  }
  /* with sound on, the volume is a row of the dock above its buttons: it never covers the page */
  .tm-transport {
    flex-wrap: wrap;
  }
  .tm-volume {
    order: -1;
    flex: 1 1 100%;
    gap: 12px;
    padding: 0 4px 2px;
  }
  .tm-volume input[type='range'].tm-range {
    flex: 1 1 auto;
    width: auto;
    height: 30px;
  }
  .tm:has(.tm-volume:not([hidden])) .tm-truth {
    padding-bottom: calc(84px + 36px + var(--safe-b));
  }
  .btn,
  .btn-s {
    min-height: 44px;
    height: auto;
    font-size: 10.5px;
  }
  .wf-families .btn,
  .wf-targets .btn,
  .wf-choices .btn {
    min-height: 44px;
  }
  .org-row {
    min-height: 44px;
  }
  .ck {
    grid-template-columns: 10px 96px minmax(0, 1fr) 38px;
    min-height: 34px;
  }
  .tm-truth {
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 12px 14px calc(84px + var(--safe-b));
  }
  .bb-disc,
  .bb-mode {
    white-space: normal;
    font-size: 10.5px;
    line-height: 1.5;
  }
  .bb-back {
    order: 3;
    margin: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
.btn-speed-cycle {
  display: none;
}
.head-back,
.vol-btn {
  display: none;
}

/* narrow phones: the world's panel keeps its title */
@media (max-width: 430px) {
  .tm-world > .panel-h .panel-code {
    display: none;
  }
  .tm-world > .panel-h .head-back {
    margin-left: auto;
  }
}

/* landscape phones: one slim bar, the world (with its transport) held beside the panels that scroll */
@media (max-height: 599px) and (min-width: 600px) and (orientation: landscape) {
  .tm-bar {
    flex-wrap: nowrap;
    height: 44px;
    padding: 0 12px;
    gap: 14px;
  }
  .tm-bar::after {
    left: 12px;
  }
  .wordmark .wm-cf {
    font-size: 13px;
  }
  .wordmark .wm-by,
  .wordmark .wm-k {
    font-size: 9px;
  }
  .tm-nav {
    order: 0;
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    height: 100%;
    gap: 16px;
  }
  .tm-nav a {
    font-size: 8.5px;
    letter-spacing: 0.11em;
  }
  .tm-nav .nav-film {
    display: none;
  }
  .tm-nav {
    gap: 10px;
  }
  .tm-bar-right .chip {
    display: none;
  }
  .tm-main {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
    padding: 8px 8px calc(8px + var(--safe-b));
  }
  .tm-world {
    position: sticky;
    top: 8px;
    height: auto;
  }
  .tm-world > .panel-h {
    display: none;
  }
  .tm-caption > .btn {
    display: inline-flex;
  }
  .tm-stage {
    height: calc(100vh - 44px - 16px - 62px);
    height: calc(100dvh - 44px - 16px - 62px);
  }
  .tm-transport {
    position: static;
    box-shadow: none;
    padding: 6px 8px;
    background: rgba(33, 9, 30, 0.88);
    border-top: 1px solid var(--c-line);
  }
  .tm-transport .btn {
    min-height: 44px;
  }
  .tm-transport {
    flex-wrap: nowrap;
  }
  /* the volume opens above the transport from its button, over the foot of the world, and closes again */
  .tm-transport {
    position: relative;
  }
  .vol-btn {
    display: inline-flex;
  }
  .tm-volume {
    order: 0;
    flex: none;
    position: absolute;
    right: 8px;
    bottom: calc(100% + 6px);
    z-index: 4;
    background: #180615;
    border: 1px solid var(--c-line-hi);
    padding: 8px 12px;
    box-shadow: 0 -6px 18px rgba(10, 2, 9, 0.5);
  }
  .tm-volume:not(.is-open) {
    display: none;
  }
  .tm-volume input[type='range'].tm-range {
    width: 170px;
    flex: none;
  }
  .tm:has(.tm-volume:not([hidden])) .tm-truth {
    padding-bottom: calc(12px + var(--safe-b));
  }
  .tm-truth {
    padding-bottom: calc(12px + var(--safe-b));
  }
}

/* small landscape phones (iPhone SE): play is told by its icon alone, so the transport keeps one row */
@media (max-height: 599px) and (min-width: 600px) and (max-width: 760px) and (orientation: landscape) {
  .tm-transport .btn-primary > span + span {
    display: none;
  }
  .tm-transport {
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
  }
}
