/*
 * Hand-drawn technical figures.
 *
 * The warm paper, spare black linework, and restrained bronze annotations
 * match the contact-planning article's lead illustration. The drawings remain
 * exact enough to read and operate; only their visual surface is imperfect.
 */
:root {
  --panel: #d8d8d4;
  --panel-2: rgba(255, 255, 255, 0.2);
  --panel-edge: rgba(1, 1, 1, 0.34);
}

.inst {
  --text: #0b0b0a;
  --text-2: rgba(11, 11, 10, 0.82);
  --text-3: rgba(11, 11, 10, 0.58);
  --line: rgba(11, 11, 10, 0.25);
  --line-2: rgba(11, 11, 10, 0.12);
  --silver: #73736d;
  --silver-fill: rgba(75, 75, 70, 0.12);
  --gold: #966b43;
  --bronze: #966b43;
  --rain-1: rgba(150, 107, 67, 0.78);
  --rain-2: rgba(131, 72, 44, 0.92);
  --cloud: rgba(78, 78, 73, 0.3);
  --mono: var(--sans);

  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-edge);
  background-color: var(--panel);
  background-image:
    radial-gradient(circle at 16% 24%, rgba(1, 1, 1, 0.035) 0 0.45px, transparent 0.7px),
    radial-gradient(circle at 72% 68%, rgba(255, 255, 255, 0.16) 0 0.55px, transparent 0.85px);
  background-size: 9px 11px, 13px 15px;
  color: var(--text-2);
  box-shadow: inset 0 0 34px rgba(1, 1, 1, 0.018);
}

.inst::before {
  position: absolute;
  z-index: 3;
  top: 47px;
  left: 16px;
  width: 56px;
  height: 1px;
  background: var(--bronze);
  content: "";
  pointer-events: none;
  transform: rotate(-0.45deg);
  transform-origin: left center;
}

.inst :focus-visible {
  outline: 1px solid var(--bronze);
  outline-offset: 3px;
}

.inst-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.01em;
}

.inst-head .t {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inst-head .chips {
  display: flex;
  gap: 8px;
}

.inst-head .clock {
  color: var(--text);
  font: 500 11.5px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 2px 1px 2px 1px;
  background: transparent;
  color: var(--text);
  font: 600 10.5px/1 var(--sans);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip[data-tone="degraded"] {
  border-color: var(--bronze);
  color: var(--bronze);
}

.chip[data-tone="down"] {
  border-color: var(--bronze);
  background: var(--bronze);
  color: var(--panel);
}

.inst-stage {
  position: relative;
  background: transparent;
}

.inst-stage::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  content: "";
  pointer-events: none;
}

.inst-stage canvas {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.78;
  pointer-events: none;
}

.inst-stage svg {
  position: relative;
  display: block;
  width: 100%;
}

.inst-stage svg path,
.inst-stage svg line,
.inst-stage svg polyline,
.inst-stage svg polygon,
.inst-stage svg circle,
.inst-stage svg ellipse,
.inst-stage svg rect {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inst svg {
  fill: var(--text-2);
}

.inst svg .m {
  font: 450 12px var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.inst svg .mc {
  font: 550 11.5px var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

.inst svg .lb {
  fill: var(--text-2);
  font: 520 13px var(--sans);
}

.inst svg .eb {
  fill: var(--text-3);
  font: 600 11px var(--sans);
  letter-spacing: 0.1em;
}

.inst svg .halo {
  stroke: var(--panel);
  stroke-width: 4;
  paint-order: stroke;
}

.inst svg [role="slider"] {
  outline: none;
}

.inst svg [role="slider"] .ring {
  display: none;
}

.inst svg [role="slider"]:focus-visible .ring {
  display: inline;
}

.inst-ctl {
  display: flex;
  min-height: 50px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  font: 500 11.5px/1.35 var(--sans);
  letter-spacing: 0.015em;
}

.inst-ctl .note,
.inst-ctl .read {
  white-space: nowrap;
}

.inst-ctl .note {
  color: var(--text-3);
}

.inst-ctl .read {
  margin-left: auto;
  color: var(--text);
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.inst .btn {
  min-width: 34px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--text);
  border-radius: 2px 1px 2px 1px;
  background: transparent;
  color: var(--text);
  font: 600 11.5px/1 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  transition:
    background-color 150ms cubic-bezier(0.2, 0, 0, 1),
    border-color 150ms cubic-bezier(0.2, 0, 0, 1),
    color 150ms cubic-bezier(0.2, 0, 0, 1);
}

.inst .btn:hover,
.inst .btn[aria-pressed="true"] {
  border-color: var(--bronze);
  background: var(--bronze);
  color: var(--panel);
}

.inst .btn:disabled {
  border-color: var(--line);
  background: transparent;
  color: var(--text-3);
  opacity: 1;
}

.inst .seg {
  display: inline-flex;
}

.inst .seg .btn + .btn {
  margin-left: -1px;
}

.fig figcaption {
  max-width: 44rem;
  margin-top: 14px;
  color: rgba(1, 1, 1, 0.7);
  font-size: 14px;
  line-height: 1.55;
}

.fig figcaption .n {
  margin-right: 8px;
  color: var(--bronze);
  font: 700 10.5px var(--sans);
  letter-spacing: 0.1em;
}

@media (max-width: 520px) {
  .inst::before {
    top: 43px;
    left: 12px;
  }

  .inst-head {
    min-height: 44px;
    padding-inline: 12px;
  }

  .inst-head .clock {
    display: none;
  }

  .inst-ctl {
    padding-inline: 10px;
  }

  .inst-ctl .read {
    width: 100%;
    margin-left: 0;
  }

  .inst svg .m {
    font-size: 11px;
  }

  .inst svg .lb {
    font-size: 12px;
  }

  .inst svg .eb {
    font-size: 10px;
  }

  .fig figcaption {
    font-size: 13px;
  }
}
