:root {
  --bg: #0d0b09;
  --deep: #050403;
  --rock: #15120e;
  --rock-2: #1d1913;
  --rock-3: #262015;
  --edge: #2e281e;
  --edge-2: #4a3f2c;
  --text: #ece5d8;
  --muted: #a89e8c;
  --ember: #f4a938;
  --ember-dim: #b97a1f;
  --crystal: #6fd6c5;
  --moss: #8fcf6a;
  --danger: #ef6f5a;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Torch position; cave.js moves it with the pointer */
  --mx: 50%;
  --my: 16%;
}

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

/* Minimized windows and the empty dock rely on the hidden attribute. */
[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
}

.glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(520px circle at var(--mx) var(--my), rgba(244, 169, 56, 0.17), transparent 70%),
    radial-gradient(1100px 520px at 50% -8%, rgba(244, 169, 56, 0.09), transparent 70%);
}

.rock {
  display: block;
  width: 100%;
  fill: var(--deep);
}

.ceiling {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  height: clamp(44px, 8vw, 92px);
}

.wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero */

.hero {
  padding: clamp(92px, 15vw, 164px) 0 26px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font: 500 0.85rem/1 var(--mono);
}

.eyebrow b {
  color: var(--ember);
  font-weight: 500;
}

.typed::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--ember);
  animation: blink 1s steps(2) infinite;
}

.typed.is-done::after {
  animation-duration: 1.6s;
  opacity: 0.6;
}

h1 {
  margin: 0;
  font: 700 clamp(2.4rem, 9vw, 4.6rem)/1.02 var(--mono);
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  cursor: default;
}

h1 span {
  color: var(--ember);
}

.lede {
  max-width: 44ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
}

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

.fortune {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--crystal);
  font: 0.82rem/1.5 var(--mono);
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.jump a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: rgba(21, 18, 14, 0.72);
  color: var(--text);
  font: 500 0.82rem/1 var(--mono);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.jump a:hover,
.jump a:focus-visible {
  border-color: var(--ember);
  color: var(--ember);
}

/* Sections */

section {
  padding: 30px 0 6px;
  scroll-margin-top: 12px;
}

h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  color: var(--ember);
  font: 600 0.8rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--edge), transparent);
}

.hint {
  max-width: 64ch;
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  align-items: start;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid > li {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  width: 100%;
  padding: 18px 18px 16px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--rock-2), var(--rock));
  color: inherit;
  text-decoration: none;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--ember);
  box-shadow: 0 12px 32px -14px rgba(244, 169, 56, 0.45);
  transform: translateY(-2px);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.06rem;
  font-weight: 650;
  line-height: 1.3;
}

.name .ico {
  flex: 0 0 auto;
  margin-right: 8px;
  font-size: 1.05em;
}

.name .label {
  flex: 1;
  min-width: 0;
}

a.card .name::after {
  content: "\2197";
  color: var(--muted);
  font: 400 0.95rem/1 var(--mono);
  transition: color 0.15s ease, transform 0.15s ease;
}

a.card:hover .name::after,
a.card:focus-visible .name::after {
  color: var(--ember);
  transform: translate(2px, -2px);
}

.desc {
  flex: 1;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.host {
  color: var(--crystal);
  font: 400 0.78rem/1.4 var(--mono);
  overflow-wrap: anywhere;
}

/* "More" panel under a link card */

.more {
  margin: 6px 2px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.more summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  font: 500 0.78rem/1 var(--mono);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.more summary::-webkit-details-marker {
  display: none;
}

.more summary::before {
  content: "\25B8";
  color: var(--ember);
  transition: transform 0.15s ease;
}

.more[open] summary::before {
  transform: rotate(90deg);
}

.more summary:hover {
  color: var(--ember);
}

.more[open] {
  border-color: var(--edge);
  background: rgba(21, 18, 14, 0.6);
}

.more .body {
  padding: 2px 12px 12px;
}

.more p {
  margin: 8px 0;
}

.more .tag {
  margin: 0 0 6px;
  color: var(--ember);
  font: italic 0.88rem/1.4 var(--sans);
}

.more ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.more li {
  margin: 3px 0;
}

.more li::marker {
  color: var(--crystal);
}

.more .note {
  margin-top: 8px;
  color: var(--muted);
  font: 0.78rem/1.5 var(--mono);
  opacity: 0.85;
}

/* Toybox launcher cards */

button.card.toy {
  position: relative;
  margin: 0;
  font: inherit;
  cursor: pointer;
  appearance: none;
}

.toy .toy-icon {
  font-size: 1.7rem;
  line-height: 1;
}

.toy .lamp {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--edge-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.toy.is-open .lamp {
  background: var(--moss);
  box-shadow: 0 0 10px 2px rgba(143, 207, 106, 0.55);
}

.toy.is-min .lamp {
  background: var(--ember);
  box-shadow: 0 0 10px 2px rgba(244, 169, 56, 0.5);
}

/* Windows */

#desk {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

.win {
  position: absolute;
  left: 40px;
  top: 80px;
  width: min(380px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 86px);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 14px;
  background: var(--rock-2);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.5);
  color: var(--text);
  pointer-events: auto;
  overflow: hidden;
}

.win.is-front {
  border-color: var(--ember-dim);
  box-shadow: 0 28px 70px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 40px -10px rgba(244, 169, 56, 0.35);
}

.win.is-dragging {
  opacity: 0.94;
}

.win-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-bottom: 1px solid var(--edge);
  background: linear-gradient(180deg, var(--rock-3), var(--rock-2));
  cursor: move;
  touch-action: none;
  user-select: none;
}

.win-icon {
  font-size: 1rem;
  line-height: 1;
}

.win-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 600 0.86rem/1.2 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-badge {
  color: var(--ember);
  font: 600 0.8rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.win-badge:empty {
  display: none;
}

.win-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 500 1rem/1 var(--mono);
  cursor: pointer;
}

.win-btn:hover {
  border-color: var(--edge-2);
  background: var(--rock);
  color: var(--text);
}

.win-body {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
}

.win-err {
  margin: 0;
  color: var(--danger);
  font: 0.85rem/1.5 var(--mono);
}

@media (max-width: 720px) {
  .win {
    position: fixed;
    inset: auto 0 0 0;
    left: 0 !important;
    top: auto !important;
    width: 100%;
    max-width: none;
    max-height: 86vh;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }

  .win-bar {
    cursor: default;
  }

  /* Leave room for the dock, which floats over the bottom of the sheet. */
  .win-body {
    padding-bottom: 70px;
  }
}

/* Shared controls inside toy windows */

.win-body button,
.win-body input,
.win-body select,
.win-body textarea {
  font: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--rock-3);
  color: var(--text);
  font: 500 0.9rem/1 var(--mono);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}

.btn:hover {
  border-color: var(--ember);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--ember-dim);
  background: linear-gradient(180deg, #f6b24c, var(--ember-dim));
  color: #1a1206;
  font-weight: 700;
}

.btn-primary:hover {
  border-color: var(--ember);
  filter: brightness(1.06);
}

.btn-danger {
  border-color: #6b2f25;
  color: var(--danger);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

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

.btn.is-active {
  border-color: var(--crystal);
  color: var(--crystal);
}

.field,
.win-body input[type="text"],
.win-body input[type="number"],
.win-body input[type="time"],
.win-body input[type="date"],
.win-body input[type="search"],
.win-body input[type="password"],
.win-body select,
.win-body textarea {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: 0.95rem/1.4 var(--mono);
}

.win-body input:focus,
.win-body select:focus,
.win-body textarea:focus {
  border-color: var(--ember);
  outline: none;
  box-shadow: 0 0 0 3px rgba(244, 169, 56, 0.18);
}

.win-body textarea {
  resize: vertical;
}

.win-body label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font: 500 0.78rem/1.3 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.row > * {
  flex: 1 1 auto;
}

.row.is-tight > * {
  flex: 0 0 auto;
}

.stack > * + * {
  margin-top: 10px;
}

.readout {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ember);
  font: 600 1.9rem/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.readout small {
  display: block;
  color: var(--muted);
  font: 400 0.78rem/1.3 var(--mono);
}

.readout.is-done {
  color: var(--moss);
}

.mono {
  font-family: var(--mono);
}

.small {
  color: var(--muted);
  font-size: 0.8rem;
}

.keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.keys .btn {
  min-height: 42px;
  font-size: 1.05rem;
}

.keys .span-2 {
  grid-column: span 2;
}

.win-body table {
  width: 100%;
  border-collapse: collapse;
  font: 0.86rem/1.4 var(--mono);
}

.win-body th,
.win-body td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--edge);
  text-align: left;
}

.win-body th {
  color: var(--muted);
  font-weight: 500;
}

/* Dock and toast */

#dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 31;
  max-width: calc(100vw - 16px);
  transform: translateX(-50%);
}

.dock-list {
  display: flex;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--edge-2);
  border-radius: 999px;
  background: rgba(13, 11, 9, 0.9);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  list-style: none;
  overflow-x: auto;
  backdrop-filter: blur(8px);
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 500 0.8rem/1 var(--mono);
  white-space: nowrap;
  cursor: pointer;
}

.dock-btn:hover {
  border-color: var(--edge-2);
  background: var(--rock-2);
}

.dock-btn.is-min {
  color: var(--muted);
}

.dock-btn.is-min .dock-icon {
  opacity: 0.6;
}

.dock-badge {
  color: var(--ember);
  font-variant-numeric: tabular-nums;
}

.dock-badge:empty {
  display: none;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  z-index: 32;
  max-width: calc(100vw - 32px);
  padding: 8px 14px;
  border: 1px solid var(--edge-2);
  border-radius: 10px;
  background: var(--rock-3);
  color: var(--text);
  font: 0.85rem/1.4 var(--mono);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

#toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Cave floor */

.ground {
  position: relative;
  z-index: 2;
  margin-top: 48px;
}

.floor {
  height: clamp(34px, 6vw, 68px);
  transform: scaleY(-1);
  /* Hide the hairline seam between the rock and the footer */
  margin-bottom: -1px;
}

footer {
  padding: 6px 20px 30px;
  background: var(--deep);
  color: var(--muted);
  font: 0.8rem/1.6 var(--mono);
  text-align: center;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--text);
  text-decoration-color: var(--edge);
  text-underline-offset: 3px;
}

footer a:hover,
footer a:focus-visible {
  color: var(--ember);
  text-decoration-color: var(--ember);
}

/* Ambience: flicker, drips, bats, easter eggs */

.drip {
  position: fixed;
  z-index: 1;
  width: 3px;
  height: 16px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, rgba(111, 214, 197, 0.05), rgba(111, 214, 197, 0.8));
  pointer-events: none;
  animation: drip 1.8s cubic-bezier(0.5, 0, 1, 1) forwards;
}

.bat {
  position: fixed;
  left: -70px;
  z-index: 3;
  width: 44px;
  pointer-events: none;
  animation: fly 9s linear forwards;
}

.bat.is-rtl {
  left: auto;
  right: -70px;
  animation-name: fly-rtl;
}

.bat svg {
  display: block;
  width: 100%;
  fill: #0a0806;
  filter: drop-shadow(0 0 6px rgba(244, 169, 56, 0.25));
  animation: flap 0.24s steps(2) infinite, bob 1.6s ease-in-out infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

@keyframes drip {
  0% { transform: translateY(0) scaleY(0.4); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(100vh) scaleY(1.3); opacity: 0; }
}

@keyframes fly {
  to { transform: translateX(calc(100vw + 150px)); }
}

@keyframes fly-rtl {
  to { transform: translateX(calc(-100vw - 150px)); }
}

@keyframes flap {
  0% { transform: scaleY(1); }
  100% { transform: scaleY(0.35); }
}

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -22px; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  11% { opacity: 0.86; }
  23% { opacity: 0.97; }
  37% { opacity: 0.8; }
  52% { opacity: 0.95; }
  68% { opacity: 0.84; }
  81% { opacity: 0.99; }
  93% { opacity: 0.9; }
}

@keyframes flare {
  0% { opacity: 1; }
  30% { opacity: 1.6; }
  100% { opacity: 1; }
}

@keyframes disco {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .glow {
    animation: flicker 7s ease-in-out infinite;
  }

  body.is-flare .glow {
    animation: flare 0.9s ease-out;
  }

  body.is-disco .glow,
  body.is-disco .card,
  body.is-disco h1 span {
    animation: disco 2.5s linear infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .jump a,
  .name::after,
  .typed::after,
  #toast,
  .btn {
    transition: none;
    animation: none;
  }

  .card:hover,
  .card:focus-visible {
    transform: none;
  }

  .drip,
  .bat {
    display: none;
  }
}

/* toy: stopwatch */

.t-stopwatch-laps {
  max-height: 190px;
  overflow: auto;
}

.win-body .t-stopwatch-best td {
  color: var(--moss);
}

.win-body .t-stopwatch-worst td {
  color: var(--danger);
}

/* toy: alarm */

.t-alarm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--edge);
}

.t-alarm-time {
  flex: 0 0 auto;
  color: var(--ember);
  font: 600 1rem/1.2 var(--mono);
}

.t-alarm-label {
  flex: 1 1 60px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.t-alarm-item.is-off .t-alarm-time,
.t-alarm-item.is-off .t-alarm-label {
  opacity: 0.45;
}

/* toy: dice */

.t-dice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.t-dice-chip {
  padding: 4px 9px;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  background: var(--rock-3);
  font: 600 0.9rem/1.2 var(--mono);
}

.t-dice-chip.is-crit {
  border-color: var(--moss);
  color: var(--moss);
}

.t-dice-chip.is-fumble {
  border-color: var(--danger);
  color: var(--danger);
}

.t-dice-log {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font: 0.8rem/1.5 var(--mono);
  overflow-wrap: anywhere;
}

ol.t-dice-log {
  padding-left: 22px;
  list-style: decimal;
  color: var(--text);
}

/* toy: sweeper */

.t-sweeper-wrap {
  overflow: auto;
  padding: 2px;
}

.t-sweeper-board {
  display: grid;
  gap: 2px;
  width: max-content;
  margin: 0 auto;
}

.win-body .t-sweeper-cell {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 4px;
  background: var(--rock-3);
  color: var(--text);
  font: 700 0.85rem/1 var(--mono);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.win-body .t-sweeper-cell:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: -2px;
}

.win-body .t-sweeper-cell.is-open {
  border-color: var(--edge);
  background: var(--deep);
  cursor: default;
}

.win-body .t-sweeper-cell.is-boom {
  background: #5a1f17;
}

.win-body .t-sweeper-n1 { color: #6aa9ff; }
.win-body .t-sweeper-n2 { color: var(--moss); }
.win-body .t-sweeper-n3 { color: var(--danger); }
.win-body .t-sweeper-n4 { color: #b78cff; }
.win-body .t-sweeper-n5 { color: var(--ember); }
.win-body .t-sweeper-n6 { color: var(--crystal); }
.win-body .t-sweeper-n7 { color: var(--text); }
.win-body .t-sweeper-n8 { color: var(--muted); }

/* toy: terminal */

.t-terminal-out {
  height: 280px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--edge);
  border-radius: 10px 10px 0 0;
  background: var(--deep);
  color: var(--moss);
  font: 0.84rem/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.t-terminal-cmd {
  color: var(--text);
}

.t-terminal-dim {
  color: var(--muted);
}

.t-terminal-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--edge);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: var(--deep);
}

.t-terminal-ps {
  color: var(--ember);
  font: 0.84rem/1 var(--mono);
  white-space: nowrap;
}

.win-body .t-terminal-line input[type="text"] {
  flex: 1;
  min-width: 0;
  min-height: 28px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* toy: sketch */

.win-body .t-sketch-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--edge-2);
  border-radius: 50%;
  cursor: pointer;
}

.win-body .t-sketch-swatch.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--rock-2), 0 0 0 4px var(--ember);
}

.win-body input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.win-body input[type="range"] {
  flex: 1 1 80px;
  min-width: 0;
  accent-color: var(--ember);
}

/* toy: snake */

.t-snake-canvas {
  display: block;
  width: 100%;
  max-width: 54vh;
  margin-left: auto;
  margin-right: auto;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--edge);
  touch-action: none;
}

.t-snake-canvas:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.t-snake-pad {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  gap: 6px;
  justify-content: center;
}

.t-snake-pad .btn {
  min-height: 46px;
  touch-action: manipulation;
}

.t-snake-pad .t-snake-up { grid-column: 2; grid-row: 1; }
.t-snake-pad .t-snake-left { grid-column: 1; grid-row: 2; }
.t-snake-pad .t-snake-down { grid-column: 2; grid-row: 2; }
.t-snake-pad .t-snake-right { grid-column: 3; grid-row: 2; }

/* toy: rockfall */

.t-rockfall-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}

.t-rockfall-board {
  display: block;
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--edge-2);
  touch-action: none;
}

.t-rockfall-board:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.t-rockfall-side {
  flex: 1 1 110px;
  min-width: 96px;
  max-width: 150px;
}

.t-rockfall-side .btn {
  width: 100%;
}

.t-rockfall-next {
  display: block;
  margin-bottom: 8px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--edge);
}

.t-rockfall-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid var(--edge);
  font: 0.84rem/1.4 var(--mono);
}

.t-rockfall-stat b {
  color: var(--ember);
  font-weight: 600;
}

.t-rockfall-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.t-rockfall-pad .btn {
  min-height: 46px;
  padding: 6px 0;
  touch-action: manipulation;
}

/* toy: memory */

.t-memory-grid {
  display: grid;
  gap: 8px;
}

.win-body .t-memory-card {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, var(--rock-3), var(--rock-3) 6px, var(--rock-2) 6px, var(--rock-2) 12px);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.win-body .t-memory-card:hover {
  border-color: var(--ember);
}

.win-body .t-memory-card:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.win-body .t-memory-card.is-up {
  border-color: var(--ember);
  background: var(--bg);
}

.win-body .t-memory-card.is-done {
  border-color: var(--moss);
  background: var(--bg);
  opacity: 0.7;
  cursor: default;
}

/* toy: typing */

.t-typing-text {
  position: relative;
  height: calc(5.7em + 16px);
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  font: 1.05rem/1.9 var(--mono);
}

.t-typing-text span {
  display: inline-block;
  margin-right: 0.6em;
}

.t-typing-text .is-current {
  color: var(--text);
  box-shadow: 0 2px 0 var(--ember);
}

.t-typing-text .is-wrong {
  color: var(--danger);
  box-shadow: 0 2px 0 var(--danger);
}

.t-typing-text .is-ok {
  color: var(--moss);
}

.t-typing-text .is-bad {
  color: var(--danger);
  text-decoration: line-through;
}

/* toy: metronome */

.t-metronome-beats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 20px;
}

.t-metronome-dot {
  width: 18px;
  height: 18px;
  border: 1px solid var(--edge-2);
  border-radius: 50%;
  background: var(--rock-3);
}

.t-metronome-dot.is-on {
  border-color: var(--ember);
  background: var(--ember);
  box-shadow: 0 0 14px rgba(244, 169, 56, 0.7);
}

.t-metronome-dot.is-first.is-on {
  border-color: var(--crystal);
  background: var(--crystal);
  box-shadow: 0 0 14px rgba(111, 214, 197, 0.7);
}

/* toy: clock */

.t-clock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--edge);
}

.t-clock-place {
  flex: 1 1 auto;
  min-width: 0;
}

.t-clock-place b {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.t-clock-place small {
  color: var(--muted);
  font: 0.76rem/1.3 var(--mono);
}

.t-clock-time {
  flex: 0 0 auto;
  color: var(--ember);
  font: 600 1.15rem/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
}

.t-clock-home .t-clock-place b {
  color: var(--crystal);
}

/* toy: passgen */

.win-body .t-passgen-out {
  margin-bottom: 0;
  font-size: 1.15rem;
  line-height: 1.4;
  text-align: left;
  -webkit-user-select: all;
  user-select: all;
}

.t-passgen-meter {
  height: 8px;
  overflow: hidden;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--bg);
}

.t-passgen-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--ember);
  transition: width 0.2s ease;
}

.t-passgen-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.win-body .t-passgen-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font: 0.9rem/1.3 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.win-body .t-passgen-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--ember);
}

/* Toybox categories */

.toycat + .toycat {
  margin-top: 26px;
}

.toycat-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 12px;
  color: var(--crystal);
  font: 600 0.78rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toycat-title small {
  color: var(--muted);
  font: 0.82rem/1.3 var(--sans);
  letter-spacing: 0;
  text-transform: none;
}

/* toy: breaker */

.t-breaker-canvas {
  display: block;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--edge);
  cursor: none;
  touch-action: none;
}

.t-breaker-canvas:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

/* toy: word */

.t-word-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.t-word-modes {
  order: -1;
}

.t-word-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
  border-radius: 8px;
}

.t-word-grid:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 6px;
}

.t-word-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 2px solid var(--edge-2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: 700 1.5rem/1 var(--mono);
  text-transform: uppercase;
}

.t-word-tile.is-filled {
  border-color: var(--muted);
}

.t-word-tile.is-hit {
  border-color: var(--moss);
  background: #3f6b2b;
  color: #fff;
}

.t-word-tile.is-near {
  border-color: var(--ember);
  background: #9a6410;
  color: #fff;
}

.t-word-tile.is-miss {
  border-color: var(--edge);
  background: var(--rock-3);
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .t-word-tile.is-new {
    animation: t-word-pop 0.32s ease backwards;
  }

  .t-word-grid.is-shake {
    animation: t-word-shake 0.3s ease;
  }
}

@keyframes t-word-pop {
  from { transform: scale(0.6); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes t-word-shake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.t-word-keys {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.t-word-keyrow {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.win-body .t-word-key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 34px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 6px;
  background: var(--rock-3);
  color: var(--text);
  font: 600 0.95rem/1 var(--mono);
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
}

.win-body .t-word-key.is-wide {
  flex: 1.6 1 0;
  max-width: 54px;
  font-size: 1.05rem;
}

.win-body .t-word-key.is-hit {
  border-color: var(--moss);
  background: #3f6b2b;
  color: #fff;
}

.win-body .t-word-key.is-near {
  border-color: var(--ember);
  background: #9a6410;
  color: #fff;
}

.win-body .t-word-key.is-miss {
  border-color: var(--edge);
  background: var(--deep);
  color: #6f675a;
}

/* toy: merge */

.t-merge-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  padding: 6px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--deep);
  touch-action: none;
}

.t-merge-board:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.t-merge-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--rock);
  color: var(--text);
  font: 700 1.5rem/1 var(--mono);
}

.t-merge-cell.is-small {
  font-size: 1.1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .t-merge-cell.is-pop {
    animation: t-merge-pop 0.16s ease;
  }
}

@keyframes t-merge-pop {
  from { transform: scale(0.7); }
  to { transform: scale(1); }
}

/* toy: torches */

.t-torches-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.win-body .t-torches-cell {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 10px;
  background: var(--deep);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
}

.win-body .t-torches-cell.is-lit {
  border-color: var(--ember);
  background: #4a2f08;
  box-shadow: 0 0 16px rgba(244, 169, 56, 0.45);
}

.win-body .t-torches-cell:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.win-body .t-torches-cell.is-hint {
  outline: 2px dashed var(--crystal);
  outline-offset: 2px;
}

/* toy: echo */

.t-echo-pads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.win-body .t-echo-pad {
  aspect-ratio: 1.3;
  min-width: 0;
  border: 2px solid rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  background: var(--pad, var(--rock-3));
  color: #1a1206;
  font: 700 1rem/1 var(--mono);
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.08s ease, box-shadow 0.08s ease, transform 0.08s ease;
  touch-action: manipulation;
}

.win-body .t-echo-pad:hover {
  opacity: 0.6;
}

.win-body .t-echo-pad:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.win-body .t-echo-pad.is-on {
  opacity: 1;
  box-shadow: 0 0 26px var(--pad);
  transform: scale(1.03);
}

/* toy: slide */

.t-slide-board {
  display: grid;
  gap: 5px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  padding: 6px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--deep);
}

.t-slide-board:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.win-body .t-slide-tile {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  background: linear-gradient(160deg, var(--rock-3), var(--rock-2));
  color: var(--text);
  font: 700 1.3rem/1 var(--mono);
  cursor: pointer;
  touch-action: manipulation;
}

.win-body .t-slide-tile:hover {
  border-color: var(--ember);
}

.win-body .t-slide-tile:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 1px;
}

.win-body .t-slide-tile.is-home {
  border-color: var(--crystal);
  color: var(--crystal);
}

.win-body .t-slide-tile.is-blank {
  visibility: hidden;
}

/* toy: reflex */

.win-body .t-reflex-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 190px;
  padding: 16px;
  border: 2px solid var(--edge-2);
  border-radius: 16px;
  background: var(--rock-3);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.win-body .t-reflex-pad:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.win-body .t-reflex-pad.is-wait {
  border-color: var(--danger);
  background: #4a1c14;
}

.win-body .t-reflex-pad.is-go {
  border-color: var(--moss);
  background: #2f5a1e;
}

.t-reflex-title {
  font: 700 1.7rem/1.2 var(--mono);
}

.t-reflex-sub {
  color: var(--muted);
  font-size: 0.9rem;
}

.t-reflex-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.t-reflex-chip {
  padding: 4px 9px;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  background: var(--rock-3);
  font: 600 0.85rem/1.2 var(--mono);
}

/* toy: piano */

.t-piano-keys {
  position: relative;
  display: flex;
  height: 150px;
  border-radius: 0 0 8px 8px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.t-piano-keys:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.win-body .t-piano-key {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  padding: 0 0 6px;
  border: 1px solid #6b6253;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(180deg, #d9d0bf, #f3ecdf);
  color: #3d3526;
  font: 600 0.7rem/1.1 var(--mono);
  cursor: pointer;
}

.win-body .t-piano-key small {
  font-size: 0.62rem;
  opacity: 0.65;
}

.win-body .t-piano-key.is-black {
  position: absolute;
  top: 0;
  z-index: 2;
  flex: none;
  height: 60%;
  border-color: #000;
  background: linear-gradient(180deg, #2a241a, #0d0b09);
  color: #a89e8c;
}

.win-body .t-piano-key.is-down {
  background: var(--ember);
  color: #1a1206;
}

.win-body .t-piano-key.is-black.is-down {
  background: var(--ember-dim);
  color: #fff;
}

@media (pointer: coarse) {
  .win-body .t-piano-key small {
    display: none;
  }
}

/* toy: fireflies */

.t-fireflies-canvas {
  display: block;
  width: 100%;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--edge);
  cursor: crosshair;
  touch-action: none;
}

/* toy: subnet */

.t-subnet-bits {
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--bg);
  font: 0.8rem/1.5 var(--mono);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.t-subnet-bits .is-net {
  color: var(--crystal);
}

.t-subnet-bits .is-host {
  color: var(--ember);
}

/* toy: epoch */

.win-body .t-epoch-now {
  display: block;
  width: 100%;
  font: 600 1.9rem/1.2 var(--mono);
  color: var(--ember);
  cursor: pointer;
}

.win-body .t-epoch-now:hover {
  border-color: var(--ember);
}

.win-body .t-epoch-val {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: copy;
}

.win-body .t-epoch-val:hover,
.win-body .t-epoch-val:focus-visible {
  color: var(--ember);
  outline: none;
}

.win-body input[type="datetime-local"] {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: 0.95rem/1.4 var(--mono);
}

/* toy: colour */

.t-colour-sample {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--edge-2);
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.35;
}

.t-colour-sample b {
  font: 700 2rem/1 var(--sans);
}

.win-body input[aria-invalid="true"] {
  border-color: var(--danger);
}

.win-body .t-colour-val {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: copy;
}

.win-body .t-colour-val:hover,
.win-body .t-colour-val:focus-visible {
  color: var(--ember);
  outline: none;
}

.t-colour-ratio {
  color: var(--ember);
  font: 600 1.2rem/1.2 var(--mono);
}

.t-colour-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.t-colour-mark {
  padding: 3px 8px;
  border: 1px solid #6b2f25;
  border-radius: 999px;
  color: var(--danger);
  font: 600 0.74rem/1.3 var(--mono);
}

.t-colour-mark.is-pass {
  border-color: #3f6b2b;
  color: var(--moss);
}

.t-colour-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  align-items: center;
}

.win-body .t-colour-swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  cursor: pointer;
}

.win-body .t-colour-swatch:hover,
.win-body .t-colour-swatch:focus-visible {
  border-color: var(--text);
  outline: none;
}

/* toy: todo */

.t-todo-list {
  max-height: 300px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.t-todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--edge);
}

.win-body .t-todo-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--ember);
  cursor: pointer;
}

.win-body .t-todo-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font: 0.95rem/1.35 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.win-body .t-todo-item.is-done .t-todo-text {
  color: var(--muted);
  text-decoration: line-through;
}

.win-body .t-todo-item .btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 2px 8px;
}

/* toy: json */

.t-json-status {
  flex: 1 1 200px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.t-json-status.is-good {
  color: var(--moss);
}

.t-json-status.is-bad {
  color: var(--danger);
}

/* Maximized windows */

.win.is-max {
  left: 8px !important;
  top: 8px !important;
  width: calc(100vw - 16px) !important;
  height: calc(100vh - 86px);
  max-width: none;
}

.win.is-max .win-bar {
  cursor: default;
}

@media (max-width: 720px) {
  .win-max {
    display: none;
  }

  .win.is-max {
    left: 0 !important;
    width: 100% !important;
    height: auto;
  }
}

/* toy: json (two panes and tree) */

.t-json-panes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.win.is-max .t-json-panes textarea,
.win.is-max .t-json-tree {
  height: calc(100vh - 385px);
  min-height: 200px;
}

.t-json-tree {
  height: 17.4em;
  overflow: auto;
  padding: 8px 10px;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--bg);
  font: 0.86rem/1.55 var(--mono);
}

.t-json-tree details {
  padding-left: 14px;
}

.t-json-tree > details {
  padding-left: 0;
}

.t-json-tree summary {
  cursor: pointer;
}

.t-json-tree summary:hover,
.t-json-leaf:hover,
.t-json-leaf:focus-visible {
  background: var(--rock-3);
  outline: none;
}

.t-json-leaf {
  padding-left: 28px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.t-json-k { color: var(--crystal); }
.t-json-meta { color: var(--muted); }
.t-json-v.is-string { color: var(--moss); }
.t-json-v.is-number { color: var(--ember); }
.t-json-v.is-boolean { color: #b78cff; }
.t-json-v.is-null { color: var(--muted); }

.win-body .t-json-path {
  width: 100%;
  margin-top: 4px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 0.78rem/1.4 var(--mono);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: copy;
}

/* toy: calc (scientific row, tape beside the keys when wide) */

.t-calc-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}

.t-calc-wrap:focus-visible {
  outline: none;
}

.t-calc-sci .btn {
  min-height: 34px;
  font-size: 0.86rem;
}

.t-calc-tape {
  max-height: 260px;
  overflow: auto;
}

.win.is-max .t-calc-tape {
  max-height: calc(100vh - 220px);
}

.win.is-max .t-calc-wrap .keys .btn {
  min-height: 54px;
}

/* toy: notepad (fills a maximized window) */

.win.is-max .t-notepad {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.win.is-max .t-notepad > * + * {
  margin-top: 10px;
}

.win.is-max .t-notepad-page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.win.is-max .t-notepad-page textarea {
  flex: 1 1 auto;
  height: auto !important;
  resize: none;
}

/* Clocks get a huge readout when maximized */

.win.is-max[data-toy="timer"] .readout,
.win.is-max[data-toy="stopwatch"] .readout,
.win.is-max[data-toy="alarm"] .readout {
  padding: 4vh 12px;
  font-size: min(15vw, 30vh);
  text-align: center;
}

.win.is-max[data-toy="timer"] .readout small,
.win.is-max[data-toy="stopwatch"] .readout small,
.win.is-max[data-toy="alarm"] .readout small {
  font-size: 1.1rem;
}

/* toy: clock and convert (roomier when maximized) */

.t-clock-list.is-shifted .t-clock-time {
  color: var(--crystal);
}

.win.is-max .t-clock-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0 28px;
}

.win.is-max .t-clock-time {
  font-size: 1.7rem;
}

.t-convert-all tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0 14px;
}

.t-convert-all tr {
  display: block;
}

.win-body .t-convert-all td {
  display: block;
}

.t-convert-all tr.is-from .t-convert-val {
  color: var(--ember);
}

.win-body .t-convert-val {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: copy;
}

.win-body .t-convert-val:hover {
  color: var(--ember);
}

/* toy: passgen (batch list) */

.t-passgen-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 10px;
}

.win-body .t-passgen-item {
  padding: 4px 8px;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font: 0.86rem/1.4 var(--mono);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: copy;
}

.win-body .t-passgen-item:hover {
  border-color: var(--ember);
}

/* toy: subnet (splitter; two columns when there is room) */

.t-subnet-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
  align-items: start;
}

.t-subnet-split {
  max-height: 230px;
  overflow: auto;
}

.win.is-max .t-subnet-split {
  max-height: calc(100vh - 420px);
}

/* toy: todo (priorities and due dates) */

.win.is-max .t-todo-list {
  max-height: calc(100vh - 330px);
}

.win-body .t-todo-item .t-todo-flag {
  min-width: 30px;
  color: var(--muted);
  font-weight: 700;
}

.win-body .t-todo-item.is-pri1 .t-todo-flag { color: var(--ember); }
.win-body .t-todo-item.is-pri2 .t-todo-flag { color: var(--danger); }

.t-todo-due {
  flex: 0 0 auto;
  padding: 1px 7px;
  border: 1px solid var(--edge-2);
  border-radius: 999px;
  color: var(--crystal);
  font: 0.72rem/1.5 var(--mono);
}

.t-todo-due.is-late {
  border-color: #6b2f25;
  color: var(--danger);
}

.win-body .t-todo-item.is-done .t-todo-due {
  opacity: 0.5;
}

/* toy: colour (two columns when maximized) */

.win.is-max .t-colour {
  columns: 2 380px;
  column-gap: 28px;
}

.win.is-max .t-colour > * {
  break-inside: avoid;
}

.win.is-max .t-colour-sample {
  padding: 40px 20px;
  font-size: 1.3rem;
}

/* Syntax highlighting (text.js) and the notepad's highlighted editor */

.hl-com { color: #8a8170; font-style: italic; }
.hl-str { color: var(--moss); }
.hl-num { color: var(--ember); }
.hl-kw { color: #b78cff; }
.hl-key { color: var(--crystal); }
.hl-tag { color: #6aa9ff; }

.t-notepad-edit {
  position: relative;
}

.win-body .t-notepad-edit textarea {
  display: block;
  position: relative;
  scrollbar-gutter: stable;
  overflow-wrap: break-word;
  tab-size: 4;
}

.t-notepad-hl {
  position: absolute;
  inset: 0;
  display: none;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: 0.95rem/1.4 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  tab-size: 4;
  overflow: hidden;
  scrollbar-gutter: stable;
  pointer-events: none;
}

.t-notepad-edit.is-lit .t-notepad-hl {
  display: block;
}

.win-body .t-notepad-edit.is-lit textarea {
  background: transparent;
  color: transparent;
  caret-color: var(--text);
}

.win.is-max .t-notepad-edit {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.win.is-max .t-notepad-edit textarea {
  flex: 1 1 auto;
  height: auto !important;
  resize: none;
}

.t-notepad .row.is-tight > .row {
  flex: 1 1 100%;
  min-width: 0;
}

.t-notepad-tools > .row {
  flex: 1 1 auto !important;
}

/* Reference tables, chmod, cron */

.t-ref-scroll {
  max-height: 380px;
  overflow: auto;
}

.win.is-max .t-ref-scroll {
  max-height: calc(100vh - 260px);
}

.win-body .t-ref-copy {
  padding: 1px 6px;
  border: 1px solid var(--edge-2);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ember);
  font: 600 0.86rem/1.4 var(--mono);
  cursor: copy;
}

.win-body .t-http-2 { color: var(--moss); }
.win-body .t-http-3 { color: var(--crystal); }
.win-body .t-http-4 { color: var(--ember); }
.win-body .t-http-5 { color: var(--danger); }

.win-body .t-chmod-grid th,
.win-body .t-chmod-grid td {
  text-align: center;
}

.win-body .t-chmod-grid th[scope="row"] {
  text-align: left;
}

.win-body .t-chmod-grid input,
.win-body .t-ref-check {
  width: 20px;
  height: 20px;
  accent-color: var(--ember);
}

.win-body .t-chmod-cmd {
  display: block;
  width: 100%;
  margin: 0;
  font: 600 1.3rem/1.3 var(--mono);
  color: var(--ember);
  text-align: left;
  cursor: copy;
}

.win-body .t-cron-out {
  margin: 0;
  font: 500 1.05rem/1.4 var(--sans);
  text-align: left;
}

.t-cron-runs {
  margin: 0;
  padding-left: 22px;
  font: 0.9rem/1.6 var(--mono);
}

/* Developer toys: regex, diff, markdown, bases */

.t-regex-marked {
  height: 9.6em;
  margin: 0;
  padding: 6px 10px;
  overflow: auto;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--bg);
  font: 0.95rem/1.4 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.t-regex-marked mark {
  border-radius: 3px;
  background: rgba(244, 169, 56, 0.4);
  color: var(--text);
}

.t-regex-marked mark.is-alt {
  background: rgba(111, 214, 197, 0.35);
}

.t-diff-out {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--bg);
  font: 0.86rem/1.5 var(--mono);
}

.win.is-max .t-diff-out {
  max-height: calc(100vh - 430px);
}

.t-diff-line {
  display: flex;
  gap: 8px;
  padding: 0 8px;
}

.t-diff-line.is-add { background: rgba(143, 207, 106, 0.16); }
.t-diff-line.is-del { background: rgba(239, 111, 90, 0.16); }

.t-diff-no {
  flex: 0 0 2.4em;
  color: var(--muted);
  text-align: right;
  user-select: none;
}

.t-diff-sign {
  flex: 0 0 1em;
  color: var(--ember);
}

.t-diff-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.t-uuid-list {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  max-height: 300px;
  overflow: auto;
}

.t-md-out {
  height: 21.4em;
  overflow: auto;
  padding: 4px 14px;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--bg);
  line-height: 1.55;
}

.win.is-max .t-md-panes textarea,
.win.is-max .t-md-out {
  height: calc(100vh - 250px);
}

.t-md-out h3, .t-md-out h4, .t-md-out h5, .t-md-out h6 { margin: 0.9em 0 0.4em; color: var(--ember); font-family: var(--sans); }
.t-md-out h3 { font-size: 1.35rem; }
.t-md-out h4 { font-size: 1.15rem; }
.t-md-out p, .t-md-out ul, .t-md-out ol { margin: 0.6em 0; }
.t-md-out ul, .t-md-out ol { padding-left: 24px; }
.t-md-out a { color: var(--crystal); }
.t-md-out code { padding: 1px 5px; border-radius: 4px; background: var(--rock-3); font: 0.88em var(--mono); }
.t-md-out pre { padding: 10px; overflow: auto; border-radius: 8px; background: var(--deep); }
.t-md-out pre code { padding: 0; background: none; }
.t-md-out blockquote { margin: 0.6em 0; padding: 2px 12px; border-left: 3px solid var(--ember-dim); color: var(--muted); }
.t-md-out hr { border: 0; border-top: 1px solid var(--edge-2); }

.t-base-bits {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
}

.win-body .t-base-bit {
  min-width: 0;
  padding: 5px 0;
  border: 1px solid var(--edge-2);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font: 600 0.82rem/1 var(--mono);
  cursor: pointer;
}

.win-body .t-base-bit.is-on {
  border-color: var(--ember);
  background: #4a2f08;
  color: var(--ember);
}

.win-body .t-base-bit.is-edge {
  margin-right: 5px;
}

/* Everyday batch: QR, dates, percent, loan, ratio, wheel; file hashing; password checker */

.t-qr-canvas {
  display: block;
  width: min(100%, 300px);
  margin: 0 auto;
  border-radius: 8px;
  image-rendering: pixelated;
}

.win-body .t-dates-result {
  display: block;
  width: 100%;
  margin: 0;
  font: 600 1.15rem/1.4 var(--sans);
  color: var(--ember);
  text-align: left;
  cursor: copy;
}

.win-body input[type="date"] {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: 0.95rem/1.4 var(--mono);
}

.t-percent-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--edge);
}

.win-body .t-percent-line input {
  flex: 0 1 92px;
  width: 92px;
}

.t-percent-out {
  color: var(--ember);
  font: 600 1.05rem/1.3 var(--mono);
}

.t-loan-chart {
  display: block;
  width: 100%;
}

.t-ratio-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
}

.t-ratio-shape {
  border: 2px solid var(--ember);
  border-radius: 4px;
  background: rgba(244, 169, 56, 0.12);
}

.t-wheel-canvas {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.t-cipher-file,
.t-passgen-checker {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--edge-2);
}

.t-cipher-ok { color: var(--moss); }
.t-cipher-bad { color: var(--danger); }

.t-passgen-findings {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Developer batch two */

.t-req-out {
  max-height: 260px;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--deep);
  color: var(--text);
  font: 0.86rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.t-cssgen-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  padding: 30px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: #ece5d8;
}

.t-cssgen-box {
  min-width: 150px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1206;
  font: 600 0.95rem var(--sans);
}

.t-datauri-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 0 auto;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  background: repeating-conic-gradient(#3a3226 0% 25%, #262015 0% 50%) 50% / 16px 16px;
}

.t-keys-pad {
  margin: 0;
  padding: 26px 12px;
  text-align: center;
  cursor: pointer;
}

.t-keys-pad:focus {
  border-color: var(--ember);
  outline: none;
  box-shadow: 0 0 0 3px rgba(244, 169, 56, 0.18);
}

.t-keys-log {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.win-body .t-unicode-ch {
  font: 1.2rem/1.2 var(--sans);
  text-align: center;
}

.win-body .t-unicode-risky td {
  background: rgba(239, 111, 90, 0.14);
}

.t-regex-cheat summary {
  color: var(--muted);
  font: 0.8rem var(--mono);
  cursor: pointer;
}

.t-regex-cheat pre {
  margin: 6px 0 0;
  color: var(--muted);
  font: 0.76rem/1.6 var(--mono);
  white-space: pre-wrap;
}

.t-diff-chg {
  border-radius: 3px;
  background: rgba(244, 169, 56, 0.35);
  font-weight: 600;
}

/* Rows of controls must wrap on narrow screens rather than push the window wider */

.win-body .row.is-tight {
  flex-wrap: wrap;
  max-width: 100%;
}

.win-body .row.is-tight > .small,
.win-body .row.is-tight > .row {
  flex: 0 1 auto;
  min-width: 0;
}

.win-body .t-json-status {
  flex: 1 1 160px;
}

/* toy: request (API tester) */

.t-req {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

@media (min-width: 900px) {
  .win.is-max .t-req,
  .win.is-wide .t-req {
    grid-template-columns: minmax(0, 1fr) 240px;
  }
}

.t-req-main > * + * {
  margin-top: 10px;
}

.t-req-tabs .btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.84rem;
}

.t-req-pane > * + * {
  margin-top: 10px;
}

.t-req-table > * + * {
  margin-top: 6px;
}

.t-req-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.win-body .t-req-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--ember);
}

.win-body .t-req-row input[type="text"],
.win-body .t-req-row select {
  flex: 1 1 100px;
  min-width: 0;
  min-height: 32px;
}

.win-body .t-req-row .btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 2px 8px;
}

.t-req-response {
  padding-top: 10px;
  border-top: 1px solid var(--edge-2);
}

.t-req-status {
  margin: 0 0 8px;
  color: var(--muted);
  font: 0.86rem/1.45 var(--mono);
  overflow-wrap: anywhere;
}

.t-req-status.is-good { color: var(--moss); }
.t-req-status.is-warn { color: var(--ember); }
.t-req-status.is-bad { color: var(--danger); }

.t-req-resp {
  min-height: 120px;
  max-height: 360px;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--edge-2);
  border-radius: 9px;
  background: var(--deep);
  color: var(--text);
  font: 0.84rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.win.is-max .t-req-resp {
  max-height: calc(100vh - 480px);
}

.t-req-pass { color: var(--moss); }
.t-req-fail { color: var(--danger); }

.t-req-side > * + * {
  margin-top: 8px;
}

.t-req-list {
  max-height: 220px;
  overflow: auto;
}

.t-req-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--edge);
}

.win-body .t-req-pick {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: 0.8rem/1.4 var(--mono);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.win-body .t-req-pick:hover {
  color: var(--ember);
}

.t-curlconv-out {
  height: 17.4em;
  max-height: none;
}

.win.is-max .t-curlconv-out,
.win.is-max [data-toy] #t-curlconv-in {
  height: calc(100vh - 330px);
}

/* toy: notepad (folders and navigation) */

.t-notepad-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  height: 100%;
}

.win.is-wide .t-notepad-shell,
.win.is-max .t-notepad-shell {
  grid-template-columns: 240px minmax(0, 1fr);
}

@media (max-width: 720px) {
  .win.is-wide .t-notepad-shell,
  .win.is-max .t-notepad-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

.t-notepad-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

.t-notepad-side .btn {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 0.82rem;
}

.t-notepad-tree {
  flex: 1 1 auto;
  min-height: 80px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.win.is-max .t-notepad-tree {
  max-height: none;
}

.t-notepad-folder {
  display: flex;
  align-items: center;
  margin-top: 6px;
  border-bottom: 1px solid var(--edge);
}

.win-body .t-notepad-fname {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--crystal);
  font: 600 0.8rem/1.4 var(--mono);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.win-body .t-notepad-folder .btn {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 6px;
}

.win-body .t-notepad-note {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.win-body .t-notepad-note:hover {
  background: var(--rock-3);
}

.win-body .t-notepad-note.is-current {
  border-left-color: var(--ember);
  background: var(--rock-3);
}

.t-notepad-ntitle {
  font: 500 0.88rem/1.35 var(--sans);
  overflow-wrap: anywhere;
}

.win-body .t-notepad-note .small {
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

/* toy: notepad (line numbers and folding) */

.t-notepad-edit {
  display: flex;
  align-items: stretch;
}

.t-notepad-area {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.win.is-max .t-notepad-area {
  display: flex;
  min-height: 0;
}

.win.is-max .t-notepad-area textarea {
  flex: 1 1 auto;
  height: auto !important;
  resize: none;
}

.t-notepad-hl {
  display: block;
  visibility: hidden;
}

.t-notepad-edit.is-lit .t-notepad-hl {
  visibility: visible;
}

.t-notepad-gutter {
  flex: 0 0 auto;
  min-width: 3.4em;
  padding: 7px 6px 12px 4px;
  overflow: hidden;
  border-right: 1px solid var(--edge);
  color: #6f675a;
  font: 0.95rem/1.4 var(--mono);
  text-align: right;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.t-notepad-ln.is-foldable,
.t-notepad-ln.is-folded {
  cursor: pointer;
}

.t-notepad-ln.is-foldable:hover,
.t-notepad-ln.is-folded {
  color: var(--ember);
}

.hl-fold {
  border-radius: 4px;
  background: rgba(244, 169, 56, 0.2);
  color: var(--ember);
}

/* The number column takes its height from the text box and never the other way round. */
.t-notepad-gutter {
  contain: size;
  box-sizing: content-box;
}

/* toy: notepad (menu bar layout) */

.t-np > * + * {
  margin-top: 8px;
}

.win.is-max .t-np > * + * {
  margin-top: 8px;
}

.t-np-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.win-body .t-np-bar .t-np-title {
  flex: 1 1 180px;
  width: auto;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  font: 600 1.05rem/1.3 var(--sans);
}

.win-body .t-np-bar .t-np-title:hover,
.win-body .t-np-bar .t-np-title:focus {
  border-color: var(--edge-2);
  background: var(--bg);
}

.t-np-menus {
  display: flex;
  gap: 4px;
}

.t-np-menu {
  position: relative;
}

.win-body .t-np-menubtn {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.86rem;
}

.t-np-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 250px;
  max-height: 70vh;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--edge-2);
  border-radius: 10px;
  background: var(--rock-2);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.85);
}

.win-body .t-np-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: 0.88rem/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

.win-body .t-np-item:hover,
.win-body .t-np-item:focus-visible {
  background: var(--rock-3);
  color: var(--ember);
  outline: none;
}

.t-np-tick {
  flex: 0 0 1em;
  color: var(--moss);
}

.t-np-label {
  flex: 1 1 auto;
}

.t-np-item kbd {
  color: var(--muted);
  font: 0.72rem var(--mono);
}

.t-np-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--edge);
}

.t-np-panel {
  padding: 8px 10px;
  border: 1px solid var(--edge-2);
  border-radius: 10px;
  background: var(--rock);
}

.t-np-panel > * + * {
  margin-top: 6px;
}

.t-np-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.win-body .t-np-status p {
  margin: 0;
}

.t-np-spring {
  flex: 1 1 0;
}

.win-body .t-np-pick select {
  width: auto;
  min-height: 28px;
  padding: 2px 6px;
  font-size: 0.8rem;
}

.t-notepad-edit.no-wrap textarea {
  white-space: pre;
  overflow-x: auto;
}

.t-notepad-edit.no-wrap .t-notepad-hl {
  white-space: pre;
}

.t-np-bar {
  position: relative;
}

@media (max-width: 720px) {
  .t-np-menu {
    position: static;
  }

  .t-np-pop {
    left: 0;
    right: 0;
    min-width: 0;
    max-height: 50vh;
  }
}

/* toy: notepad (more languages, find list, word completion) */

.hl-del { color: var(--danger); }

.t-np-results {
  max-height: 150px;
  overflow: auto;
}

.win-body .t-np-result {
  display: block;
  width: 100%;
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text);
  font: 0.8rem/1.5 var(--mono);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.win-body .t-np-result:hover {
  background: var(--rock-3);
}

.t-np-result b {
  display: inline-block;
  min-width: 3ch;
  color: var(--ember);
  text-align: right;
}

.t-np-complete {
  position: absolute;
  z-index: 15;
  min-width: 160px;
  max-width: 280px;
  padding: 4px;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  background: var(--rock-2);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.85);
  font: 0.86rem/1.4 var(--mono);
}

.t-np-sug {
  padding: 2px 8px;
  border-radius: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.t-np-sug.is-on {
  background: var(--ember-dim);
  color: #fff;
}

.t-np-sughint {
  margin-top: 3px;
  padding: 3px 8px 1px;
  border-top: 1px solid var(--edge);
  color: var(--muted);
  font: 0.68rem var(--sans);
}

/* toy: notepad (marks layer, versions) */

.t-np-marks {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 9px;
  pointer-events: none;
}

.t-np-mark {
  position: absolute;
  border-radius: 2px;
}

.t-np-mark.is-line {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0;
}

.t-np-mark.is-same {
  background: color-mix(in srgb, var(--ember) 22%, transparent);
}

.t-np-mark.is-find {
  background: rgba(255, 214, 90, 0.28);
  outline: 1px solid rgba(255, 214, 90, 0.6);
}

.t-np-mark.is-bracket {
  background: color-mix(in srgb, var(--ember) 30%, transparent);
  outline: 1px solid var(--ember);
}

.t-np-mark.is-lone {
  outline: 1px solid var(--danger);
}

.t-np-versions {
  display: grid;
  gap: 4px;
  max-height: 190px;
  margin-top: 6px;
  overflow: auto;
}

.t-np-ver {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.t-np-vwhen {
  flex: 0 0 auto;
  color: var(--ember);
  font-family: var(--mono);
}

.t-np-vtext {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.win-body .t-np-ver .btn {
  flex: 0 0 auto;
  width: auto;
  padding: 2px 10px;
}

/* toy: notepad (command palette, Markdown preview) */

.t-notepad.t-np {
  position: relative;
}

.t-np-palette {
  position: absolute;
  top: 46px;
  left: 50%;
  z-index: 30;
  width: min(520px, 94%);
  padding: 8px;
  border: 1px solid var(--ember-dim);
  border-radius: 12px;
  background: var(--rock-2);
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
}

.t-np-pallist {
  position: relative;
  max-height: 300px;
  margin-top: 6px;
  overflow: auto;
}

.t-np-cmd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 0.88rem;
  cursor: pointer;
}

.t-np-cmd.is-on {
  background: var(--ember-dim);
  color: #fff;
}

.t-np-cmd kbd {
  flex: 0 0 auto;
  font-size: 0.7rem;
  opacity: 0.8;
}

.t-np-palnone {
  padding: 6px 9px;
  color: var(--muted);
  font-size: 0.85rem;
}

.t-notepad-page.has-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.win-body .t-np-preview {
  height: auto;
  min-height: 0;
  max-height: 70vh;
}

.win.is-max .t-notepad-page.has-preview {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.win.is-max .t-np-preview {
  height: auto;
  max-height: none;
}

@media (max-width: 720px) {
  .t-notepad-page.has-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .win-body .t-np-preview {
    max-height: 40vh;
  }
}

/* toy: totp */

.t-totp-code span { letter-spacing: 0.08em; }
.t-totp-code small span { letter-spacing: 0; }

.t-totp-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--rock-3);
  overflow: hidden;
}

.t-totp-bar div {
  height: 100%;
  background: var(--crystal);
  transition: width 0.25s linear;
}

.t-totp-bar.is-low div { background: var(--danger); }

/* toy: cvss */

.t-cvss-grid {
  display: grid;
  gap: 6px;
}

.t-cvss-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.t-cvss-name { font-size: 0.86rem; color: var(--muted); }

.win-body .t-cvss-row .btn {
  flex: 1 1 70px;
  padding: 5px 8px;
}

.t-cvss-score[data-sev="critical"], .t-cvss-score[data-sev="high"] { color: var(--danger); }
.t-cvss-score[data-sev="low"], .t-cvss-score[data-sev="none"] { color: var(--crystal); }

@media (max-width: 560px) {
  .t-cvss-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* toy: ioc */

.t-ioc-out {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}

.win.is-max .t-ioc-out { max-height: none; }

.t-ioc-list, .t-xmlfmt-hits {
  margin: 4px 0 0;
  padding: 8px 10px;
  max-height: 150px;
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
  font: 0.84rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.win-body .t-ioc-group .btn { flex: 0 0 auto; width: auto; padding: 2px 10px; }

/* toy: sechead */

.t-sechead-grade[data-grade="A"], .t-sechead-grade[data-grade="B"] { color: var(--crystal); }
.t-sechead-grade[data-grade="D"], .t-sechead-grade[data-grade="F"] { color: var(--danger); }

.t-sechead-table td, .t-sechead-table th { vertical-align: top; overflow-wrap: anywhere; }
.t-sechead-table th { width: 32%; }
.t-sechead-mark { width: 1.6em; font-weight: 700; text-align: center; }
.t-sechead-table tr[data-level="good"] .t-sechead-mark { color: var(--crystal); }
.t-sechead-table tr[data-level="warn"] .t-sechead-mark { color: var(--ember); }
.t-sechead-table tr[data-level="bad"] .t-sechead-mark { color: var(--danger); }
.t-sechead-table tr[data-level="info"] .t-sechead-mark { color: var(--muted); }

/* toy: kanban */

.t-kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 10px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.t-kanban-col {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--rock);
  min-height: 120px;
  align-content: start;
}

.t-kanban-col.is-over { border-color: var(--ember); }

.t-kanban-head {
  display: flex;
  align-items: center;
  gap: 4px;
}

.win-body .t-kanban-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--ember);
  font: 600 0.92rem var(--sans);
  text-align: left;
  cursor: text;
}

.t-kanban-count {
  margin-left: 6px;
  color: var(--muted);
  font: 0.75rem var(--mono);
}

.win-body .t-kanban-x, .win-body .t-kanban-acts button {
  flex: 0 0 auto;
  width: auto;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}

.win-body .t-kanban-x:hover, .win-body .t-kanban-acts button:hover:not(:disabled) { color: var(--text); }
.win-body .t-kanban-acts button:disabled { opacity: 0.3; cursor: default; }

.t-kanban-cards {
  display: grid;
  gap: 6px;
  min-height: 8px;
}

.t-kanban-card {
  padding: 6px 8px 2px;
  border: 1px solid var(--edge-2);
  border-left: 3px solid var(--edge-2);
  border-radius: 8px;
  background: var(--rock-2);
  cursor: grab;
}

.t-kanban-card.is-ember { border-left-color: var(--ember); }
.t-kanban-card.is-crystal { border-left-color: var(--crystal); }
.t-kanban-card.is-danger { border-left-color: var(--danger); }
.t-kanban-card.is-drag { opacity: 0.4; }
.t-kanban-card.is-over { border-top-color: var(--ember); }

.win-body .t-kanban-text {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 0.88rem/1.4 var(--sans);
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: inherit;
}

.t-kanban-acts {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0.55;
}

.t-kanban-card:hover .t-kanban-acts, .t-kanban-card:focus-within .t-kanban-acts { opacity: 1; }

.win-body .t-kanban-add, .win-body .t-kanban-edit {
  padding: 5px 8px;
  font-size: 0.86rem;
}

@media (max-width: 600px) {
  .t-kanban-board { grid-auto-flow: row; grid-auto-columns: auto; }
}

/* toy: tally */

.t-tally-list { display: grid; gap: 8px; }

.t-tally-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.win-body .t-tally-row .t-tally-name { flex: 1 1 120px; min-width: 0; }
.win-body .t-tally-row .t-tally-step { flex: 0 0 4.2em; width: 4.2em; padding-left: 6px; padding-right: 2px; }
.win-body .t-tally-row .btn { flex: 0 0 auto; width: auto; padding: 6px 12px; }
.win-body .t-tally-row .t-tally-plus, .win-body .t-tally-row .t-tally-minus { font-size: 1.2rem; padding: 4px 16px; }

.t-tally-n {
  flex: 0 0 3.2em;
  color: var(--ember);
  font: 600 1.5rem var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@media (max-width: 520px) {
  .t-tally-row { flex-wrap: wrap; }
  .win-body .t-tally-row .t-tally-name { flex: 1 1 100%; }
}

/* toy: imgtool */

.t-imgtool-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 8px;
  border: 1px dashed var(--edge-2);
  border-radius: 10px;
  background: var(--bg);
}

.t-imgtool-stage.is-over { border-color: var(--ember); }

.t-imgtool-canvas {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.win.is-max .t-imgtool-canvas { max-height: calc(100vh - 420px); }

.t-imgtool-lock {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin: 0 6px 0 0;
}

.win-body .t-imgtool-lock input { width: auto; }

/* toys: certdecode, emlhead (shared flag pills) */

.t-cert-out { display: grid; gap: 14px; }
.t-cert-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }

.t-cert-flag {
  padding: 2px 10px;
  border: 1px solid var(--edge-2);
  border-radius: 999px;
  font-size: 0.8rem;
}

.t-cert-flag.is-good { border-color: var(--crystal); color: var(--crystal); }
.t-cert-flag.is-warn { border-color: var(--ember); color: var(--ember); }
.t-cert-flag.is-bad { border-color: var(--danger); color: var(--danger); }
.t-cert-flag.is-info { color: var(--muted); }

.t-cert-table th, .t-emlhead-main th { width: 26%; }
.t-cert-table td, .t-emlhead-main td, .t-emlhead-route td { overflow-wrap: anywhere; vertical-align: top; }
.t-emlhead-route tr[data-level="warn"] .t-emlhead-wait { color: var(--danger); font-weight: 700; }
.t-emlhead-wait { white-space: nowrap; }

/* toy: logparse */

.t-log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.t-log-block { display: grid; gap: 3px; align-content: start; min-width: 0; }

.win-body .t-log-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 2px 6px;
  border: 0;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: 0.78rem/1.5 var(--mono);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}

.t-log-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: color-mix(in srgb, var(--ember) 24%, transparent);
}

.t-log-block[data-kind="probe"] .t-log-fill, .t-log-block[data-kind="prober"] .t-log-fill, .t-log-block[data-kind="errors"] .t-log-fill { background: color-mix(in srgb, var(--danger) 30%, transparent); }
.t-log-key { position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-log-n { position: relative; flex: 0 0 auto; color: var(--muted); }
.t-log-summary th { width: 30%; }
.t-log-summary td { overflow-wrap: anywhere; }

/* toy: riskmatrix */

.t-risk-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 6px;
  align-items: center;
}

.t-risk-axis { color: var(--muted); font-size: 0.75rem; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.t-risk-axis.is-x { writing-mode: horizontal-tb; transform: none; }

.t-risk-grid {
  display: grid;
  grid-template-columns: minmax(70px, 130px) repeat(5, minmax(0, 1fr));
  gap: 3px;
}

.t-risk-lab { align-self: center; color: var(--muted); font-size: 0.72rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.t-risk-lab.is-x { text-align: center; }

.win-body .t-risk-cell {
  min-height: 38px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  color: #111;
  font: 700 1rem var(--mono);
  cursor: pointer;
}

.win-body .t-risk-cell.is-low { background: #4f9d7a; }
.win-body .t-risk-cell.is-medium { background: #d9b84a; }
.win-body .t-risk-cell.is-high { background: #e08a3c; }
.win-body .t-risk-cell.is-critical { background: #d9534a; }
.win-body .t-risk-cell.is-on { border-color: #fff; }

.t-risk-score { padding: 1px 8px; border-radius: 999px; color: #111; font: 700 0.78rem var(--mono); white-space: nowrap; }
.t-risk-score.is-low { background: #4f9d7a; }
.t-risk-score.is-medium { background: #d9b84a; }
.t-risk-score.is-high { background: #e08a3c; }
.t-risk-score.is-critical { background: #d9534a; }

.win-body .t-risk-table input, .win-body .t-risk-table select { padding: 4px 6px; font-size: 0.82rem; }
.win-body .t-risk-table td { padding: 3px 4px; }
.win-body .t-risk-table td:first-child { min-width: 180px; width: 40%; }
.win-body .t-risk-table .btn { width: auto; padding: 2px 8px; }

@media (max-width: 640px) {
  .t-risk-table thead { display: none; }
  .t-risk-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px 0; border-bottom: 1px solid var(--edge); }
  .win-body .t-risk-table td { border: 0; padding: 0; }
  .win-body .t-risk-table td:first-child { grid-column: 1 / -1; width: auto; min-width: 0; }
  .t-risk-grid { grid-template-columns: 44px repeat(5, minmax(0, 1fr)); }
}

/* toy: mockdata */

.win-body .t-mock-chips .btn { flex: 0 0 auto; width: auto; padding: 3px 10px; font-size: 0.8rem; }

/* toy: splitter */

.t-split-items { display: grid; gap: 6px; }

.t-split-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(70px, 1fr) minmax(0, 1.4fr) minmax(0, 2.4fr) auto;
  gap: 6px;
  align-items: center;
}

.t-split-among { display: flex; flex-wrap: wrap; gap: 4px; }
.win-body .t-split-chip { flex: 0 0 auto; width: auto; padding: 2px 8px; font-size: 0.78rem; }
.win-body .t-split-x { width: auto; padding: 2px 8px; }
.t-split-table td, .t-split-table th { text-align: right; font-variant-numeric: tabular-nums; }
.t-split-table th:first-child { text-align: left; }
.t-split-neg { color: var(--danger); }
.t-split-pos { color: var(--crystal); }
.t-split-move { padding: 4px 0; }
.t-split-amt { color: var(--ember); font: 600 1rem var(--mono); }

@media (max-width: 640px) {
  .t-split-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; padding-bottom: 6px; border-bottom: 1px solid var(--edge); }
  .t-split-row .t-split-what { grid-column: 1 / -1; }
  .t-split-among { grid-column: 1 / -1; }
}

/* toy: habit */

.t-habit-wrap { overflow-x: auto; }
.t-habit-table { width: 100%; border-collapse: collapse; }
.win-body .t-habit-table th, .win-body .t-habit-table td { padding: 3px 2px; border: 0; text-align: center; font-size: 0.72rem; }
.win-body .t-habit-table th[scope="row"] { min-width: 150px; text-align: left; }
.t-habit-table thead th { color: var(--muted); font-weight: 400; }
.t-habit-table thead th.is-today { color: var(--ember); font-weight: 700; }
.win-body .t-habit-name { padding: 4px 6px; font-size: 0.85rem; }

.win-body .t-habit-box {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--edge-2);
  border-radius: 6px;
  background: var(--bg);
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

.win-body .t-habit-box.is-today { border-color: var(--ember); }
.win-body .t-habit-box.is-on { border-color: var(--crystal); background: var(--crystal); }
.t-habit-streak, .t-habit-pct { white-space: nowrap; color: var(--ember); font-family: var(--mono); }
.win-body .t-habit-table .btn { width: auto; padding: 2px 8px; }

/* toy: magic */

.t-magic-steps { margin: 0; padding-left: 22px; font-size: 0.86rem; line-height: 1.5; }
.t-magic-preview { overflow-wrap: anywhere; }
.win-body .t-magic-in, .win-body #t-magic-in { overflow-wrap: anywhere; }

/* toy: fileinspect */

.t-fileinspect-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  padding: 10px;
  border: 1px dashed var(--edge-2);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
}

.t-fileinspect-drop.is-over { border-color: var(--ember); background: var(--rock-2); }
.t-fileinspect-table th { width: 32%; }
.t-fileinspect-table td { overflow-wrap: anywhere; vertical-align: top; }
.win-body .t-fileinspect-table .btn { width: auto; padding: 1px 8px; margin-left: 8px; }
.t-fileinspect-hash { font-size: 0.82rem; }

.t-fileinspect-ioc {
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
}

.t-fileinspect-strings {
  margin: 0;
  padding: 8px 10px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
  font: 0.8rem/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* toy: secrets */

.t-secrets-hit {
  padding: 8px 10px;
  border: 1px solid var(--edge-2);
  border-left: 3px solid var(--edge-2);
  border-radius: 8px;
  background: var(--rock-2);
}

.t-secrets-hit.is-high { border-left-color: var(--danger); }
.t-secrets-hit.is-medium { border-left-color: var(--ember); }
.t-secrets-hit.is-low { border-left-color: var(--muted); }

.t-secrets-sev {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font: 700 0.68rem var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #111;
}

.t-secrets-sev.is-high { background: var(--danger); }
.t-secrets-sev.is-medium { background: var(--ember); }
.t-secrets-sev.is-low { background: var(--muted); }

.t-secrets-val {
  display: block;
  margin-top: 4px;
  font: 0.86rem var(--mono);
  color: var(--crystal);
  overflow-wrap: anywhere;
}

.win-body .t-secrets-hit .btn { width: auto; padding: 1px 8px; }

/* toy: csp */

.t-csp-checks label { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; }
.win-body .t-csp-checks input { width: auto; }

/* toy: phishurl */

.t-phishurl-score[data-level="bad"] { color: var(--danger); }
.t-phishurl-score[data-level="warn"] { color: var(--ember); }
.t-phishurl-score[data-level="ok"] { color: var(--crystal); }

/* toy: finding */

.t-finding-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.t-finding-tabs { display: flex; flex-wrap: wrap; gap: 4px; }

.win-body .t-finding-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 4px 10px;
  border: 1px solid var(--edge-2);
  border-radius: 7px 7px 0 0;
  background: var(--rock);
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.win-body .t-finding-tab.is-on { background: var(--rock-2); color: var(--text); border-bottom-color: transparent; }
.t-finding-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.sev-danger { background: var(--danger); }
.sev-ember { background: var(--ember); }
.sev-crystal { background: var(--crystal); }
.sev-muted { background: var(--muted); }

.t-finding-out {
  margin: 0;
  padding: 10px 12px;
  min-height: 240px;
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
  font: 0.82rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.win.is-max .t-finding-out { max-height: calc(100vh - 320px); }

@media (max-width: 680px) {
  .t-finding-grid { grid-template-columns: minmax(0, 1fr); }
}

/* toy: pwned */

.t-pwned-meter {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 4px;
  background: var(--rock-3);
  overflow: hidden;
}

.t-pwned-meter div { height: 100%; width: 0; background: var(--muted); transition: width 0.2s; }
.t-pwned-meter[data-level="bad"] div { background: var(--danger); }
.t-pwned-meter[data-level="warn"] div { background: var(--ember); }
.t-pwned-meter[data-level="good"] div { background: var(--crystal); }
.t-pwned-strength { flex: 0 0 auto; min-width: 9em; text-align: right; }

.t-pwned-result[data-state="bad"] { color: var(--danger); }
.t-pwned-result[data-state="good"] { color: var(--crystal); }
.t-pwned-result[data-state="busy"] { color: var(--muted); }

.t-pwned-privacy {
  padding: 8px 10px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
}

/* toy: timeline */

.t-timeline-table { width: 100%; }
.t-timeline-time { white-space: nowrap; color: var(--crystal); }
.t-timeline-gap { white-space: nowrap; color: var(--muted); }
.t-timeline-table td { vertical-align: top; overflow-wrap: anywhere; }
.t-timeline-table tr[data-level="warn"] .t-timeline-gap { color: var(--ember); font-weight: 700; }
.t-timeline-flag { color: var(--ember); font: 0.72rem var(--mono); }

/* toy: winevents */

.t-winev-table td { vertical-align: top; }
.t-winev-table td:first-child { width: 68px; }
.t-winev-log { color: var(--crystal); }
.t-winev-watch { color: var(--muted); }
.t-ref-copy.t-winev-bad { border-color: var(--danger); color: var(--danger); }
.t-ref-copy.t-winev-warn { border-color: var(--ember); color: var(--ember); }

/* toy: hashid */

.t-hashid-table td { vertical-align: top; }
.t-hashid-table td:last-child { white-space: nowrap; }
.t-hashid-john { color: var(--muted); }

/* toy: ctlogs */

.t-ctlogs-table td { vertical-align: top; }
.t-ctlogs-exp[data-state="expired"] { color: var(--muted); }
.t-ctlogs-exp[data-state="soon"] { color: var(--ember); }
.t-ctlogs-table tr[data-level="bad"] td { color: var(--danger); }

/* Toybox subsections */

.toysub + .toysub {
  margin-top: 18px;
}

.toysub-title {
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--edge);
  color: var(--ember);
  font: 600 0.72rem/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* toy: dns */

.t-dns-block { margin-bottom: 4px; }
.t-dns-table td { vertical-align: top; overflow-wrap: anywhere; }
.t-dns-ttl { white-space: nowrap; color: var(--muted); width: 90px; }
.win-body .t-dns-block .btn { width: auto; padding: 1px 8px; }

/* toy: emailsec */

.t-emailsec-card { padding: 8px 0; border-top: 1px solid var(--edge); }
.t-emailsec-rec { margin: 4px 0; padding: 6px 8px; border-radius: 6px; background: var(--bg); font: 0.78rem/1.4 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.win-body .t-emailsec-card .btn { width: auto; padding: 1px 8px; }

/* toy: jwt */

.t-jwt-part { margin: 0; padding: 8px 10px; min-height: 90px; max-height: 260px; overflow: auto; border: 1px solid var(--edge); border-radius: 8px; background: var(--bg); font: 0.82rem/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.t-jwt-verify[data-state="good"] { color: var(--crystal); }
.t-jwt-verify[data-state="bad"] { color: var(--danger); }

/* toy: checksum */

.t-cksum-table th { white-space: nowrap; vertical-align: top; width: 80px; }
.t-cksum-table td { vertical-align: top; }
.t-cksum-hex { font: 0.82rem var(--mono); overflow-wrap: anywhere; color: var(--crystal); }
.win-body .t-cksum-table .btn { width: auto; padding: 0 8px; margin-left: 6px; }
.t-cksum-table tr.is-match { background: color-mix(in srgb, var(--crystal) 16%, transparent); }
.t-cksum-sri { margin: 0; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 8px; background: var(--bg); font: 0.8rem/1.4 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* toy: cookie */

.t-cookie-card { padding: 8px 0; border-top: 1px solid var(--edge); }
.t-cookie-card:first-child { border-top: 0; }

/* toy: ipv6 */

.t-ipv6-type[data-ok="1"] { color: var(--crystal); }
.win-body .t-ipv6-type { font-size: 1.3rem; }

/* toy: timestamp */

.t-ts-table td { vertical-align: top; }
.t-ts-table tr[data-good="1"] td { color: var(--crystal); }
.t-ts-when { white-space: nowrap; }
.win-body .t-ts-table .btn { width: auto; padding: 0 8px; margin-left: 6px; }

/* toy: sid */

.t-sid-head[data-kind] { font-size: 1.2rem; color: var(--crystal); }
.win-body .t-sid-head .btn, .t-sid-head td .btn { }

/* toy: attack */

.t-attack-tacs { flex-wrap: wrap; }
.win-body .t-attack-tacs .btn { width: auto; padding: 2px 8px; font-size: 0.76rem; }
.t-attack-table td { vertical-align: top; }
.t-attack-table td:first-child { width: 90px; }
.t-attack-tac { color: var(--crystal); }
.t-attack-url { color: var(--muted); }

/* toy: maclookup */

.t-mac-head[data-kind] { font-size: 1.2rem; color: var(--crystal); }
.t-mac-vendor { overflow-wrap: anywhere; }

/* toy: cmdline */

.t-cmdline-verdict[data-level="bad"] { color: var(--danger); }
.t-cmdline-verdict[data-level="warn"] { color: var(--ember); }
.t-cmdline-verdict[data-level="good"] { color: var(--crystal); }
.t-cmdline-findings { display: grid; gap: 4px; }

.t-cmdline-find {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  border-left: 3px solid var(--edge-2);
  border-radius: 4px;
  background: var(--rock-2);
  font-size: 0.86rem;
}

.t-cmdline-find.is-bad { border-left-color: var(--danger); }
.t-cmdline-find.is-warn { border-left-color: var(--ember); }
.t-cmdline-icon { flex: 0 0 1.2em; font-weight: 700; text-align: center; }
.t-cmdline-find.is-bad .t-cmdline-icon { color: var(--danger); }
.t-cmdline-find.is-warn .t-cmdline-icon { color: var(--ember); }
.t-cmdline-msg { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.win-body .t-cmdline-chip { flex: 0 0 auto; font-size: 0.72rem; }
.t-cmdline-bin { overflow-wrap: anywhere; }

.t-cmdline-dec {
  margin: 4px 0 0;
  padding: 8px 10px;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
  font: 0.8rem/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* toy: querybuild */

.t-qb-conds { display: grid; gap: 6px; }
.t-qb-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 2fr) auto; gap: 6px; align-items: center; }
.win-body .t-qb-row .btn { width: auto; padding: 4px 10px; }
.t-qb-warn { color: var(--ember); }
.win-body .t-qb-chip, .win-body .t-qb-tabs .btn { flex: 0 0 auto; width: auto; padding: 3px 10px; font-size: 0.8rem; }
.t-qb-show { flex-wrap: wrap; }
.t-qb-tabs { flex-wrap: wrap; }

.t-qb-out {
  margin: 0;
  padding: 10px 12px;
  min-height: 140px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg);
  color: var(--crystal);
  font: 0.82rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.win.is-max .t-qb-out { max-height: calc(100vh - 520px); min-height: 200px; }
.t-qb-notes { color: var(--muted); display: grid; gap: 2px; }

@media (max-width: 600px) {
  .t-qb-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .t-qb-row input { grid-column: 1 / -1; grid-row: 2; }
}

/* toy: querybuild extras */
.t-qb-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 2fr) auto; }
.t-qb-rowbtns { display: inline-flex; gap: 2px; }
.win-body .t-qb-rowbtns .btn { width: auto; padding: 3px 7px; }
.t-qb-summary { margin: 0; padding: 6px 10px; border-left: 3px solid var(--crystal); background: var(--rock-2); border-radius: 4px; font-size: 0.86rem; }
.t-qb-out .hl-kw { color: var(--ember); }

/* Hide toybox categories and subsections that have no toys on this site */
.toycat:not(:has(li)), .toysub:not(:has(li)) { display: none; }
.t-qb-check { display: inline-flex; align-items: center; gap: 6px; align-self: flex-end; margin: 0 0 8px; }
.win-body .t-qb-check input { width: auto; }

/* Tools mounted on their own page (e.g. /query-builder/) */
.wrap-wide { max-width: 1200px; }
.hero-tight { padding-bottom: 8px; }
.qb-holder.win-body.is-page {
  padding: 18px;
  overflow: visible;
  border: 1px solid var(--edge-2);
  border-radius: 14px;
  background: var(--rock);
}
.is-page .t-qb-out { max-height: none; min-height: 260px; }
@media (min-width: 1000px) { .is-page .t-qb-out { font-size: 0.88rem; } }
.t-qb-pagelink { margin: 0 0 8px; text-align: right; }

/* toy: querybuild hunt library */
.more.t-qb-lib { margin: 0; color: inherit; }
.more.t-qb-lib > summary { padding: 7px 12px; border: 1px solid var(--edge-2); color: var(--text); font-size: 0.84rem; }
.more.t-qb-lib > summary:hover { border-color: var(--ember); color: var(--ember); }
.more.t-qb-lib[open] { padding: 8px 10px 10px; }
.t-qb-libfilters { flex-wrap: wrap; }
.win-body .t-qb-libfilters select { flex: 1 1 150px; min-width: 0; width: auto; }
.win-body .t-qb-libclear, .win-body .t-qb-cardbtns .btn { flex: 0 0 auto; width: auto; padding: 3px 10px; font-size: 0.8rem; }
.t-qb-libcount { color: var(--muted); }
.t-qb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; max-height: 440px; overflow: auto; padding: 2px; }
.is-page .t-qb-cards { max-height: 560px; }
.t-qb-libnone { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.t-qb-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid var(--edge); border-left: 3px solid var(--edge-2); border-radius: 8px; background: var(--rock-2); }
.t-qb-card[data-level="critical"] { border-left-color: var(--danger); }
.t-qb-card[data-level="high"] { border-left-color: var(--ember); }
.t-qb-card[data-level="medium"] { border-left-color: var(--ember-dim); }
.t-qb-card[data-level="low"] { border-left-color: var(--crystal); }
.t-qb-cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.t-qb-cardhead b { min-width: 0; overflow-wrap: anywhere; font-size: 0.9rem; line-height: 1.3; }
.t-qb-sev { flex: 0 0 auto; padding: 1px 7px; border: 1px solid var(--edge-2); border-radius: 999px; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }
.t-qb-card[data-level="critical"] .t-qb-sev { border-color: var(--danger); color: var(--danger); }
.t-qb-card[data-level="high"] .t-qb-sev { border-color: var(--ember); color: var(--ember); }
.t-qb-card[data-level="low"] .t-qb-sev { border-color: var(--crystal); color: var(--crystal); }
.t-qb-cardsrc { color: var(--muted); }
.t-qb-card .t-qb-carddesc { margin: 0; flex: 1 1 auto; color: var(--text); overflow-wrap: anywhere; }
.t-qb-cardtech { color: var(--crystal); overflow-wrap: anywhere; }
.t-qb-cardbtns { margin-top: 4px; }

/* toy: querybuild condition groups and count filter */
.t-qb-group { display: grid; gap: 6px; padding: 8px 10px; border: 1px dashed var(--edge-2); border-left: 3px solid var(--crystal); border-radius: 8px; background: var(--rock-2); }
.t-qb-grouphead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.t-qb-grouphead .t-qb-rowbtns { margin-left: auto; }
.win-body .t-qb-grouphead .btn, .win-body .t-qb-group > .row .btn { flex: 0 0 auto; width: auto; padding: 3px 10px; font-size: 0.8rem; }
.t-qb-thr { display: flex; gap: 6px; }
.win-body .t-qb-thr select { flex: 3 1 0; min-width: 0; }
.win-body .t-qb-thr input { flex: 2 1 0; min-width: 0; }
.more.t-qb-net { margin: 0; color: inherit; }
.more.t-qb-net[open] { padding: 8px 10px 10px; }
.t-qb-exrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) auto; gap: 6px; align-items: center; }
.win-body .t-qb-exrow .btn { width: auto; padding: 3px 9px; }
.t-qb-group .t-qb-group { background: var(--rock); border-left-color: var(--ember-dim); }

/* toy: querybuild library groups, favourites, ATT&CK coverage */
.t-qb-cardgroups { display: grid; gap: 6px; max-height: 560px; overflow: auto; padding: 2px; }
.is-page .t-qb-cardgroups { max-height: 720px; }
.t-qb-cardgroups .t-qb-cards { max-height: none; overflow: visible; margin-top: 8px; }
.t-qb-cardgroup { border: 1px solid var(--edge); border-radius: 8px; padding: 6px 10px; background: var(--rock); }
.t-qb-cardgroup > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.t-qb-cardgroup > summary:hover { color: var(--ember); }
.t-qb-cardgroup > summary .small { color: var(--muted); font-weight: 400; }
.win-body .t-qb-fav { font-size: 1rem; line-height: 1; padding: 3px 8px; }
.t-qb-fav.is-active { color: var(--ember); }
.t-qb-cov { display: grid; gap: 8px; }
.t-qb-covrow { display: grid; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--edge); }
.t-qb-covrow:last-child { border-bottom: 0; padding-bottom: 0; }
.t-qb-covtac .small { color: var(--muted); }
.t-qb-covtechs { flex-wrap: wrap; }
