/* lethium.net/tools — shared look of the tools. Uses the tokens of ../assets/site.css. */

.tool { padding-block: clamp(28px, 5vw, 56px) clamp(56px, 8vw, 96px); }
.tool-crumb { margin: 0 0 22px; font-family: var(--sans); font-variant-numeric: tabular-nums; font-stretch: 112%; font-size: 0.89rem; letter-spacing: 0; }
.tool-crumb a { color: var(--accent); text-decoration: none; }
.tool-crumb a:hover { text-decoration: underline; }

.tgrid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(16px, 2.5vw, 32px); align-items: start; }
.tgrid > .sticky { position: sticky; top: 86px; }
.tstack { display: flex; flex-direction: column; gap: clamp(14px, 2vw, 22px); min-width: 0; }

.tcard {
  padding: clamp(16px, 2.2vw, 24px);
  background: var(--white);
  box-shadow: 0 0 0 1px var(--rule-paper);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  min-width: 0;
}
@media (prefers-color-scheme: dark) { .tcard { background: #1d1718; } }
.tcard > h2, .tcard > h3 { margin: 0 0 14px; font-size: 1.05rem; font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; }
.tcard > h2 small { font-family: var(--sans); font-variant-numeric: tabular-nums; font-stretch: 112%; font-weight: 650; font-size: 0.82rem; color: var(--on-paper-soft); margin-left: 8px; letter-spacing: 0; }
.thint { margin: 8px 0 0; font-size: 0.86rem; line-height: 1.45; color: var(--on-paper-soft); }
.thint a { color: var(--accent); }

/* controls */
.tf { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin-bottom: 14px; }
.tf:last-child { margin-bottom: 0; }
.tf > span, .tlabel { font-size: 0.82rem; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.tf > span small { font-family: var(--sans); font-variant-numeric: tabular-nums; font-stretch: 112%; font-weight: 650; color: var(--on-paper-soft); }
.tool input[type="text"], .tool input[type="url"], .tool input[type="number"], .tool textarea, .tool select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--rule-paper);
  border-radius: 0;
  background: var(--paper);
  color: var(--on-paper);
  font: inherit;
  font-size: 0.95rem;
}
.tool textarea { resize: vertical; min-height: 5em; line-height: 1.45; }
.tool textarea.code, .tool input.code { font-family: var(--mono); font-size: 0.84rem; }
.tool input:focus, .tool textarea:focus, .tool select:focus { outline: 2px solid var(--red-400); outline-offset: -1px; border-color: transparent; }
.tool input[type="range"] { width: 100%; accent-color: var(--red-500); }
.tool input[type="color"] { width: 44px; height: 38px; padding: 0; border: 1px solid var(--rule-paper); background: none; cursor: pointer; flex: none; }
.trow { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.trow > .tf { flex: 1 1 140px; margin-bottom: 0; }
.trow + .trow, .trow + .tf, .tf + .trow { margin-top: 14px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 0; box-shadow: inset 0 0 0 1px var(--rule-paper); }
.seg button {
  padding: 8px 13px;
  border: 0;
  background: transparent;
  color: var(--on-paper);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.seg button + button { box-shadow: -1px 0 0 var(--rule-paper); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { background: var(--red-600); } }
.seg button:hover:not([aria-pressed="true"]) { background: var(--paper-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--rule-paper);
  background: transparent;
  color: var(--on-paper);
  font: inherit; font-size: 0.84rem; font-weight: 600;
  cursor: pointer;
}
.chip:hover { background: var(--paper-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { background: var(--red-600); } }
.chip i { width: 34px; height: 12px; flex: none; }
.chip .x { margin-left: 2px; opacity: 0.6; font-style: normal; }

.tbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border: 0;
  background: var(--ink); color: #fff;
  font: inherit; font-size: 0.9rem; font-weight: 700; font-stretch: 108%;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}
.tbtn:hover { background: #000; }
.tbtn.red { background: var(--red-500); }
.tbtn.red:hover { background: var(--red-600); }
.tbtn.plain { background: var(--paper-2); color: var(--on-paper); }
.tbtn.plain:hover { background: var(--rule-paper); }
.tbtn.small { padding: 6px 11px; font-size: 0.82rem; }
.tbtn:disabled { opacity: 0.5; cursor: default; }
@media (prefers-color-scheme: dark) {
  .tbtn { background: var(--paper-2); color: var(--on-paper); box-shadow: inset 0 0 0 1px var(--rule-paper); }
  .tbtn:hover { background: #2d2425; }
  .tbtn.red { box-shadow: none; color: #fff; }
}
.tbtn.ok { background: #1d7a46 !important; color: #fff !important; }

/* colour stops */
.stops { display: flex; flex-direction: column; gap: 8px; }
.stop { display: flex; align-items: center; gap: 8px; }
.stop input[type="text"] { font-family: var(--mono); font-size: 0.86rem; max-width: 120px; text-transform: uppercase; }
.stop .tbtn { padding: 6px 10px; }
.bar { height: 14px; margin-top: 12px; box-shadow: inset 0 0 0 1px var(--rule-paper); }

/* output blocks */
.out { background: var(--panel); color: #fff; min-width: 0; }
.out + .out { margin-top: 10px; }
.out-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.out-head b { min-width: 0; overflow-wrap: anywhere; font-family: var(--sans); font-variant-numeric: tabular-nums; font-stretch: 112%; font-size: 0.82rem; letter-spacing: 0; font-weight: 650; color: #cfc6c3; }
.out-head span { font-family: var(--mono); font-size: 0.72rem; color: #a89c99; margin-left: auto; }
.out-head span.over { color: var(--red-300); }
.out-head .tbtn { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; }
.out-head .tbtn:hover { background: rgba(255, 255, 255, 0.22); }
.out pre {
  margin: 0;
  padding: 12px 14px;
  max-height: 220px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.out.tall pre { max-height: 420px; white-space: pre; overflow-wrap: normal; }

/* Minecraft-style preview (colours are exact, the font is ours) */
.mc {
  padding: 18px 16px;
  background: #1a1414;
  background-image: linear-gradient(rgba(255,255,255,.03), rgba(255,255,255,0));
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  text-shadow: 0.09em 0.09em 0 rgba(0, 0, 0, 0.75);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  min-height: 3.2em;
}
.mc.tip { background: #170817; box-shadow: inset 0 0 0 2px #2b0a5c, inset 0 0 0 3px #170817; }
.mc .b { font-weight: 800; }
.mc .i { font-style: italic; }
.mc .u { text-decoration: underline; }
.mc .s { text-decoration: line-through; }
.mc .u.s { text-decoration: underline line-through; }

/* notes and results */
.note { padding: 10px 12px; font-size: 0.88rem; line-height: 1.45; box-shadow: inset 3px 0 0 var(--on-paper-soft); background: var(--paper-2); }
.note + .note { margin-top: 8px; }
.note.good { box-shadow: inset 3px 0 0 #1d7a46; }
.note.warn { box-shadow: inset 3px 0 0 #c98a00; }
.note.bad { box-shadow: inset 3px 0 0 var(--red-500); }
.note b { font-weight: 700; }
.note code, .thint code, .tool li code, .tool p code { font-family: var(--mono); font-size: 0.86em; padding: 1px 4px; background: var(--rule-paper); }
.note .ln { font-family: var(--mono); font-size: 0.78rem; color: var(--on-paper-soft); margin-right: 6px; }
.note button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  padding: 10px 16px; background: var(--ink); color: #fff; font-weight: 600; font-size: 0.9rem;
  z-index: 50; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

/* hub */
.hub-group { margin: clamp(30px, 4vw, 46px) 0 14px; font-family: var(--sans); font-variant-numeric: tabular-nums; font-stretch: 112%; font-size: 0.89rem; font-weight: 650; letter-spacing: 0; color: var(--on-paper-soft); }
.hub-lead + .hub-group { margin-top: 0; }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: clamp(14px, 2vw, 22px); list-style: none; }
.hub a {
  display: flex; flex-direction: column; gap: 10px; height: 100%;
  padding: 22px 22px 26px;
  background: var(--white); color: inherit; text-decoration: none;
  box-shadow: 0 0 0 1px var(--rule-paper);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
  transition: background-color 0.15s ease, color 0.15s ease;
}
@media (prefers-color-scheme: dark) { .hub a { background: #1d1718; } }
.hub a:hover { background: var(--hover-bg); color: var(--hover-fg); }
.hub a:hover p { color: var(--hover-soft); }
.hub a:hover small { color: var(--hover-accent); }
.hub small { font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 650; font-stretch: 112%; font-size: 0.8rem; letter-spacing: 0; color: var(--accent); }
.hub strong { font-size: 1.35rem; font-weight: 800; font-stretch: 116%; letter-spacing: -0.02em; line-height: 1.1; }
.hub p { margin: 0; color: var(--on-paper-soft); font-size: 0.95rem; line-height: 1.5; }
.hub em { margin-top: auto; padding-top: 8px; font-style: normal; font-weight: 700; font-size: 0.9rem; }
.hub-note { margin-top: clamp(24px, 4vw, 40px); max-width: 70ch; color: var(--on-paper-soft); font-size: 0.95rem; }
.hub-note a { color: var(--accent); }

/* tables */
.ttable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ttable th { text-align: left; font-family: var(--sans); font-variant-numeric: tabular-nums; font-stretch: 112%; font-size: 0.8rem; letter-spacing: 0; font-weight: 650; color: var(--on-paper-soft); padding: 6px 8px; border-bottom: 1px solid var(--rule-paper); }
.ttable td { padding: 7px 8px; border-bottom: 1px solid var(--rule-paper); vertical-align: top; overflow-wrap: anywhere; }
.ttable td.n, .ttable th.n { text-align: right; font-family: var(--mono); font-size: 0.84rem; white-space: nowrap; }
.ttable tr:last-child td { border-bottom: 0; }
.meter { display: block; height: 6px; margin-top: 5px; background: var(--rule-paper); }
.meter i { display: block; height: 100%; background: var(--red-500); }

@media (max-width: 900px) {
  .tgrid { grid-template-columns: minmax(0, 1fr); }
  .tgrid > .sticky { position: static; }
}

/* GUI Maker (menu-slots.html). The chest keeps the game's grey in both themes; the icons are our own drawings. */
@media (min-width: 901px) and (min-height: 860px) { .tgrid > .gm-left { position: sticky; top: 86px; } }
.gm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.gm-bar .chip { margin-left: auto; }
.gm-chest {
  padding: 8px 9px 10px;
  background: #c6c6c6;
  border-radius: 4px;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555, 0 0 0 2px #1b1b1b;
  overflow-x: auto;
}
.gm-title { min-height: 1.4em; margin: 0 0 6px; padding-left: 4px; font-family: var(--mono); font-size: 0.86rem; font-weight: 600; line-height: 1.4; color: #404040; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.gm-title .b, .gm-tip .b, .gm-iname .b { font-weight: 800; }
.gm-title .i, .gm-tip .i, .gm-iname .i { font-style: italic; }
.gm-title .u, .gm-tip .u, .gm-iname .u { text-decoration: underline; }
.gm-title .s, .gm-tip .s, .gm-iname .s { text-decoration: line-through; }
.gm-title .u.s, .gm-tip .u.s, .gm-iname .u.s { text-decoration: underline line-through; }
.gm-grid { display: grid; gap: 2px; min-width: 250px; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.gm-corner { display: block; }
.gm-head { padding: 0; border: 0; background: transparent; color: #6f6f6f; font-size: 0.72rem; line-height: 1; cursor: pointer; }
.gm-head:hover, .gm-head:focus-visible { color: #1b1b1b; }
.gm-head:focus-visible { outline: 2px solid #1b1b1b; outline-offset: -2px; }
.gm-slot {
  position: relative; aspect-ratio: 1; min-width: 0; padding: 0; border: 0;
  background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff;
  cursor: pointer; container-type: inline-size; overflow: hidden;
}
.gm-slot::after { content: ""; position: absolute; inset: 2px; z-index: 3; pointer-events: none; }
.gm-slot:hover::after { background: rgba(255, 255, 255, 0.35); }
.gm-slot:focus-visible { outline: 3px solid #fff; outline-offset: -3px; z-index: 1; }
.gm-slot.mine { box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff, inset 0 0 0 3px #ffd84a; }
.gm-slot.pending { box-shadow: inset 0 0 0 3px #ff8a3d; }
.gm-slot.lift { box-shadow: inset 0 0 0 3px #3ad0ff; }
.gm-slot.lift .ico { transform: scale(1.12); }
.gm-slot.drop::after { background: rgba(58, 208, 255, 0.4); }
.gm-slot.hidden-state::before { content: ""; position: absolute; inset: 26%; border: 2px dashed rgba(40, 40, 40, 0.55); }
.gm-n { position: absolute; left: 3px; top: 2px; z-index: 2; font-family: var(--mono); font-size: max(8px, 20cqi); font-weight: 600; line-height: 1; color: #2b2b2b; opacity: 0.75; pointer-events: none; }
.gm-slot:has(.ico) .gm-n { color: #fff; opacity: 0.9; text-shadow: 1px 1px 0 #000; }
.gm-amt { position: absolute; right: 3px; bottom: 1px; z-index: 2; font-family: var(--mono); font-size: max(9px, 28cqi); font-weight: 800; line-height: 1; color: #fff; text-shadow: 0.1em 0.1em 0 #3f3f3f; pointer-events: none; }
.gm-badge { position: absolute; right: 2px; top: 2px; z-index: 2; min-width: 1.35em; padding: 1px 2px; background: var(--red-600); color: #fff; font-family: var(--mono); font-size: max(8px, 18cqi); font-weight: 700; line-height: 1.15; text-align: center; border-radius: 2px; pointer-events: none; }

/* icons */
.ico {
  --c: #888; --h: #333; --ink: #fff;
  position: absolute; inset: 15%;
  display: grid; place-items: center;
  color: var(--ink); font-family: var(--mono); font-size: 30cqi; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  transition: transform 0.12s ease;
}
.ico.l3 { font-size: 23cqi; }
.ico.k-item { border-radius: 22%; }
.ico.k-block, .ico.k-wool {
  inset: 13%;
  background: var(--c);
  box-shadow: inset 0.16em 0.16em 0 rgba(255, 255, 255, 0.3), inset -0.16em -0.16em 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.55);
}
.ico.k-block.flat { box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.18), inset -2px -2px 0 rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.55); }
.ico.k-wool {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22) 0 8%, transparent 9%) 0 0 / 34% 34%,
    radial-gradient(circle at 70% 65%, rgba(0, 0, 0, 0.16) 0 8%, transparent 9%) 0 0 / 34% 34%,
    var(--c);
}
.ico.k-pane, .ico.k-glass {
  inset: 8%;
  background:
    linear-gradient(135deg, transparent 22%, rgba(255, 255, 255, 0.55) 23% 30%, transparent 31% 46%, rgba(255, 255, 255, 0.4) 47% 51%, transparent 52%),
    color-mix(in srgb, var(--c) 42%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 75%, #fff), 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.ico.k-glass { inset: 13%; background: linear-gradient(135deg, transparent 18%, rgba(255, 255, 255, 0.6) 19% 27%, transparent 28%), color-mix(in srgb, var(--c) 30%, transparent); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c) 70%, #fff), 0 0 0 1px rgba(0, 0, 0, 0.45); }
.ico.k-head {
  inset: 17%;
  background:
    linear-gradient(90deg, transparent 16%, #2a2a2a 16% 36%, transparent 36% 64%, #2a2a2a 64% 84%, transparent 84%) 0 56% / 100% 14% no-repeat,
    linear-gradient(var(--h), var(--h)) 0 0 / 100% 34% no-repeat,
    var(--c);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.ico.k-head.creeper {
  background:
    linear-gradient(90deg, transparent 18%, #111 18% 40%, transparent 40% 60%, #111 60% 82%, transparent 82%) 0 30% / 100% 20% no-repeat,
    linear-gradient(90deg, transparent 36%, #111 36% 64%, transparent 64%) 0 72% / 100% 30% no-repeat,
    var(--c);
}
.ico.k-gem { inset: 10%; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: none; font-size: 24cqi; }
.ico.k-food { border-radius: 50%; box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.55); }
.ico.k-redstone { border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.55); }
.ico.k-tool { clip-path: polygon(0 26%, 26% 0, 100% 0, 100% 74%, 74% 100%, 0 100%); box-shadow: none; }
.ico.k-armor { clip-path: polygon(0 0, 100% 0, 100% 58%, 50% 100%, 0 58%); box-shadow: none; padding-bottom: 14%; }
.ico.k-custom { inset: 11%; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); box-shadow: none; font-size: 26cqi; }
.ico.k-air { background: transparent; box-shadow: none; outline: 2px dashed rgba(40, 40, 40, 0.6); outline-offset: -2px; color: #2b2b2b; font-size: 22cqi; font-weight: 600; }
.ico.glint::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(176, 98, 255, 0.55) 42%, rgba(255, 190, 255, 0.7) 50%, rgba(176, 98, 255, 0.55) 58%, transparent 70%) 0 0 / 300% 300%;
  mix-blend-mode: screen;
  animation: gm-glint 2.6s linear infinite;
}
@keyframes gm-glint { from { background-position: 100% 100%; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .ico.glint::before { animation: none; background: rgba(176, 98, 255, 0.35); } }

/* tooltip, like the game's */
.gm-tip {
  position: fixed; z-index: 60; left: 0; top: 0;
  max-width: min(380px, calc(100vw - 16px));
  padding: 5px 8px 6px;
  background: rgba(16, 0, 16, 0.94);
  border: 2px solid #3b0a8f;
  border-image: linear-gradient(#5b14e6, #28007f) 1;
  outline: 1px solid rgba(16, 0, 16, 0.94);
  color: #fff; font-family: var(--mono); font-size: 0.84rem; font-weight: 600; line-height: 1.38;
  text-shadow: 0.12em 0.12em 0 rgba(0, 0, 0, 0.55);
  white-space: pre-wrap; overflow-wrap: anywhere;
  pointer-events: none;
}
.gm-tip[hidden] { display: none; }
.gm-tip.static { position: static; max-width: none; pointer-events: auto; margin-top: 2px; }
.gm-tl { min-height: 1.38em; }
.gm-tname { margin-bottom: 3px; }
.gm-tid { margin-top: 2px; color: #555; font-size: 0.78em; }

/* preview as player, used slots */
.gm-policy { margin-top: 14px; }
.gm-policy .seg button { padding: 6px 10px; font-size: 0.82rem; }
.gm-as { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule-paper); }
.gm-as h3 { margin: 0; font-size: 0.95rem; font-weight: 800; }
.gm-as .thint { margin: 2px 0 10px; }
.gm-as-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--rule-paper); overflow-wrap: anywhere; }
.gm-as-row > span { flex: 1 1 180px; min-width: 0; font-family: var(--mono); font-size: 0.8rem; }
.gm-as-row .seg button { padding: 5px 12px; font-size: 0.8rem; }

/* item list */
.gm-items { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; margin-bottom: 12px; padding: 2px; }
.gm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; text-align: left;
  background: transparent; color: var(--on-paper); font: inherit; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--rule-paper);
}
.gm-item:hover { background: var(--paper-2); }
.gm-item[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--on-paper); background: var(--paper-2); }
.gm-ibox { position: relative; flex: none; width: 34px; height: 34px; background: #8b8b8b; box-shadow: inset 1px 1px 0 #373737, inset -1px -1px 0 #fff; container-type: inline-size; }
.gm-itext { display: flex; flex-direction: column; min-width: 0; }
.gm-itext b { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-iname { padding: 1px 5px; margin: 2px 0; align-self: flex-start; max-width: 100%; background: #1b1416; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: pre; }
.gm-itext small { font-size: 0.76rem; color: var(--on-paper-soft); }

/* item editor */
.gm-editor .trow > .tf.gm-narrow { flex: 0 1 96px; }
.gm-editor .tf > label { font-size: 0.82rem; font-weight: 700; }
.gm-combo { position: relative; display: flex; align-items: center; gap: 8px; }
.gm-combo > .gm-ibox { width: 40px; height: 40px; }
.gm-list {
  position: absolute; left: 48px; right: 0; top: 100%; z-index: 20; margin: 2px 0 0; padding: 4px 0; list-style: none;
  max-height: 300px; overflow-y: auto; background: var(--white); box-shadow: 0 0 0 1px var(--rule-paper), 0 10px 28px rgba(0, 0, 0, 0.2);
}
@media (prefers-color-scheme: dark) { .gm-list { background: #1d1718; } }
.gm-list li { display: flex; align-items: center; gap: 8px; padding: 4px 10px; font-family: var(--mono); font-size: 0.8rem; cursor: pointer; overflow-wrap: anywhere; }
.gm-list li .gm-ibox { width: 26px; height: 26px; }
.gm-list li:hover, .gm-list li[aria-selected="true"] { background: var(--paper-2); }
.gm-mathint { margin: -8px 0 14px; font-size: 0.78rem; }
.gm-h3 { margin: 20px 0 4px; padding-top: 14px; border-top: 1px solid var(--rule-paper); font-size: 0.98rem; font-weight: 800; }
.gm-h3 + .thint { margin: 0 0 8px; }
.gm-rows { display: flex; flex-direction: column; gap: 6px; }
.gm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tool .gm-row > select, .tool .gm-row > input { width: auto; flex: 1 1 130px; min-width: 0; padding: 7px 9px; font-size: 0.86rem; }
.tool .gm-row > select { flex: 0 1 auto; max-width: 100%; }
.tool .gm-row > input.gm-grow { flex: 3 1 120px; }
.tool .gm-row > input.gm-short { flex: 0 1 74px; }
.gm-row > .chip { padding: 6px 10px; }
.tbtn.gm-x { flex: none; align-self: stretch; padding: 6px 12px; }
.gm-raw { flex: 1 1 200px; font-size: 0.82rem; color: var(--on-paper-soft); }
.gm-click { margin-top: 8px; padding: 10px; box-shadow: inset 0 0 0 1px var(--rule-paper); }
.gm-click + .trow { margin-top: 10px; }
.tool .gm-chead > select { flex: 1 1 160px; font-weight: 700; }
.gm-sub { margin: 10px 0 4px; font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 650; font-stretch: 112%; font-size: 0.8rem; letter-spacing: 0; color: var(--on-paper-soft); }
.gm-stack { margin-top: 14px; }
.gm-stack p { margin: 0 0 6px; }
.gm-stack ol { margin: 0 0 8px; padding-left: 1.4em; font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.gm-stack li.on { font-weight: 800; }
.gm-stack .trow { margin-top: 0; }

/* output and import */
.tgrid.gm-io { margin-top: clamp(16px, 2.5vw, 32px); grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }
#outtab { margin-bottom: 12px; }
.gm-out .out { margin-top: 8px; }
.gm-out .thint { margin: 12px 0 0; }
.gm-out .thint:first-child { margin-top: 0; }
.gm-out .note { margin-top: 8px; }
.tool textarea.gm-imp { min-height: 220px; white-space: pre; overflow: auto; tab-size: 2; }
#imp-result { margin-top: 12px; }
#imp-result .note + .note { margin-top: 8px; }
.gm-credit { font-size: 0.86rem; color: var(--on-paper-soft); }

/* question when a slot is in use */
.gm-ask { max-width: min(460px, calc(100vw - 32px)); padding: 20px 22px; border: 0; background: var(--white); color: var(--on-paper); box-shadow: 0 0 0 1px var(--rule-paper), 0 18px 48px rgba(0, 0, 0, 0.35); }
@media (prefers-color-scheme: dark) { .gm-ask { background: #1d1718; } }
.gm-ask::backdrop { background: rgba(10, 6, 6, 0.55); }
.gm-ask h2 { margin: 0 0 8px; font-size: 1.1rem; font-weight: 800; }
.gm-ask p { margin: 0 0 16px; font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 900px) { .tgrid.gm-io { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .gm-chest { padding: 6px 5px 8px; }
  .gm-grid { gap: 1px; }
  .gm-slot { box-shadow: inset 1px 1px 0 #373737, inset -1px -1px 0 #fff; }
  .gm-bar .chip { margin-left: 0; }
}

.gm-stack .tbtn.plain { background: transparent; box-shadow: inset 0 0 0 1px var(--rule-paper); }
.tool .gm-editor input[type="text"], .tool .gm-editor input[type="number"] { min-height: 42px; }

/* pages, textured background */
.gm-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; }
.gm-pages .seg button { padding: 6px 11px; font-size: 0.82rem; }
#pset > .chips { margin: 6px 0 14px; }
#pset > .tf { margin-top: 12px; }
.gm-pages .seg button.own::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.gm-chest { position: relative; }
.gm-chest > .gm-title, .gm-chest > .gm-grid { position: relative; z-index: 1; }
.gm-texbg { position: absolute; z-index: 0; max-width: none; image-rendering: pixelated; pointer-events: none; }
.gm-chest.textured { overflow: hidden; }
.gm-chest.textured .gm-slot { background: transparent; box-shadow: none; }
.gm-chest.textured.outlines .gm-slot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), inset 0 0 0 2px rgba(0, 0, 0, 0.35); }
.gm-chest.textured .gm-slot.mine { box-shadow: inset 0 0 0 3px #ffd84a; }
.gm-chest.textured:not(.tex-text) .gm-title { visibility: hidden; }
.gm-chest.textured .gm-head { color: rgba(0, 0, 0, 0.55); }

/* more options */
.gm-det { border-top: 1px solid var(--rule-paper); }
.gm-det:last-child { border-bottom: 1px solid var(--rule-paper); }
.gm-det > summary { padding: 12px 0; font-weight: 800; cursor: pointer; list-style-position: inside; }
.gm-det > summary small { margin-left: 6px; font-family: var(--mono); font-weight: 400; font-size: 0.72rem; color: var(--on-paper-soft); }
.gm-detbody { padding: 0 0 16px; }
.gm-detbody > * + * { margin-top: 10px; }
.gm-detbody .trow + .trow { margin-top: 10px; }
.gm-det.small { margin: -4px 0 12px; border: 0; }
.gm-det.small > summary { padding: 4px 0; font-size: 0.86rem; font-weight: 700; }
.gm-det.small .gm-detbody { padding: 6px 0 4px 12px; box-shadow: inset 2px 0 0 var(--rule-paper); }
.gm-h3.first { margin-top: 0; padding-top: 0; border-top: 0; }
.gm-tt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: -8px 0 14px; font-size: 0.82rem; }
.gm-tt .chip { padding: 4px 9px; font-size: 0.8rem; }
.gm-tt a { color: var(--accent); }
.gm-item.off { opacity: 0.55; }
.gm-bad { color: var(--red-500); }
.gm-editor .trow > .tf.gm-narrow2, .gm-detbody .trow > .tf.gm-narrow2 { flex: 0 1 130px; }
.gm-combo.noicon .gm-list { left: 0; }
.tool .gm-row > .gm-combo { flex: 3 1 140px; min-width: 0; }
.tool .gm-row > .gm-combo input { padding: 7px 9px; font-size: 0.86rem; }
.gm-ziprow { margin-top: 12px; }
.gm-problems ul { margin: 6px 0 0; padding-left: 1.2em; }
.gm-problems li + li { margin-top: 4px; }
.gm-detbody .note { margin: 10px 0 0; }
.gm-detbody .out { margin-top: 8px; }
.tool .thint code, .gm-detbody code { overflow-wrap: anywhere; }
/* Config Doctor */
.tool textarea.doctor-src { min-height: 320px; white-space: pre; overflow: auto; tab-size: 4; }

/* Spark Analyzer */
.spark-link { flex: 1 1 320px !important; }
.spark-result { margin-top: clamp(14px, 2vw, 22px); }
.tcard.dropping { box-shadow: 0 0 0 2px var(--red-500); }
.spark-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 14px; }
.spark-top h2 { margin: 6px 0 4px; font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 800; font-stretch: 116%; letter-spacing: -0.02em; }
.spark-top .thint { margin: 0; }
.spark-badge { display: inline-block; margin: 0; padding: 3px 10px; font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 650; font-stretch: 112%; font-size: 0.82rem; letter-spacing: 0; background: var(--paper-2); }
.spark-badge.good { background: #1d7a46; color: #fff; }
.spark-badge.warn { background: #c98a00; color: #fff; }
.spark-badge.bad { background: var(--red-500); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 16px; }
.tile { padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--rule-paper); min-width: 0; }
.tile small { display: block; font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 650; font-stretch: 112%; font-size: 0.78rem; letter-spacing: 0; color: var(--on-paper-soft); }
.tile strong { display: block; font-size: 1.7rem; font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.2; }
.tile span { display: block; font-size: 0.78rem; line-height: 1.35; color: var(--on-paper-soft); }
.sbar { display: flex; height: 22px; background: var(--rule-paper); }
.sbar span { min-width: 2px; }
.sbar .plugins, .key.plugins i { background: var(--red-500); }
.sbar .server, .key.server i { background: var(--on-paper); }
.sbar .idle, .key.idle i { background: var(--rule-paper); }
.key { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; white-space: nowrap; }
.key i { width: 10px; height: 10px; display: inline-block; }
.mono-cell { font-family: var(--mono); font-size: 0.8rem; }
.soft { color: var(--on-paper-soft); }
.ttable .meter { width: 90px; margin-left: auto; }
.chip.static { cursor: default; }
.chip.static:hover { background: transparent; }
.chip.static small { color: var(--on-paper-soft); font-weight: 400; }
.wchart { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 4px; border-bottom: 1px solid var(--rule-paper); }
.wcol { position: relative; flex: 1 1 0; min-width: 2px; max-width: 28px; height: 100%; }
.wcol b, .wcol u { position: absolute; left: 0; right: 0; bottom: 0; display: block; }
.wcol b { background: var(--rule-paper); }
.wcol u { background: var(--on-paper); }
.wcol.bad u { background: var(--red-500); }
.wchart .limit { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--red-500); }
@media (max-width: 700px) { .ttable .meter { width: 56px; } #plugins-table th:nth-child(2), #plugins-table td:nth-child(2) { display: none; } }

.hub em svg { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-left: 4px; rotate: 45deg; }

/* tool pages: a lower header so the tool starts on the first screen */
.masthead.compact .masthead-body { padding-block: clamp(14px, 2.4vw, 26px) clamp(22px, 3.4vw, 38px); }
.masthead.compact h1 { margin-top: 0; font-size: clamp(1.9rem, 4vw, 3rem); }
.masthead.compact .masthead-meta { margin-top: 12px; }
.masthead.compact + .tool { padding-top: clamp(18px, 3vw, 30px); }
.masthead.compact + .tool .tool-crumb { margin-bottom: 16px; }

/* the hidden attribute must win over the display rules above */
.tool [hidden] { display: none !important; }

/* text below a tool: how to use it, the formats, questions; plus a column of related links */
.tguide p, .tguide li, .tguide td, .tside p, .tside li { overflow-wrap: break-word; }
.tguide {
  display: grid;
  grid-template-columns: minmax(0, 46rem) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: clamp(32px, 4vw, 48px);
  border-top: 2px solid var(--on-paper);
}
.tguide.first { margin-top: 0; padding-top: 0; border-top: 0; }
.tguide .prose { max-width: none; min-width: 0; }
.tguide .prose code { overflow-wrap: anywhere; }
.tguide .prose h3 code { font-size: 0.9em; }
.tguide .prose .lead { font-size: 1.08rem; line-height: 1.6; }
.tguide pre {
  margin: 0 0 1.05em;
  padding: 12px 14px;
  background: var(--panel);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
}
.tguide .table table { min-width: 0; }
.tguide .table td { overflow-wrap: anywhere; }
.tside { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tside .tcard > h2 { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 0.82rem; font-weight: 650; font-stretch: 100%; letter-spacing: 0; color: var(--accent); }
.tside ul { list-style: none; margin: 0; padding: 0; }
.tside li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule-paper); }
.tside li a { font-weight: 700; color: var(--on-paper); text-decoration: none; }
.tside li a:hover { color: var(--accent); text-decoration: underline; }
.tside li span { display: block; margin-top: 2px; font-size: 0.86rem; line-height: 1.4; color: var(--on-paper-soft); }
.tside p { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--on-paper-soft); }
.tside p + p { margin-top: 10px; }
.tside p a { color: var(--accent); }
@media (max-width: 900px) {
  .tguide { grid-template-columns: minmax(0, 1fr); }
  .tside { position: static; }
}

/* Minecraft Color Codes: swatches (classes, because the page's CSP allows no inline styles) */
.sw { display: inline-block; width: 30px; height: 18px; vertical-align: middle; box-shadow: inset 0 0 0 1px var(--rule-paper); }
.sw-0 { background: #000000; } .sw-1 { background: #0000AA; } .sw-2 { background: #00AA00; } .sw-3 { background: #00AAAA; }
.sw-4 { background: #AA0000; } .sw-5 { background: #AA00AA; } .sw-6 { background: #FFAA00; } .sw-7 { background: #AAAAAA; }
.sw-8 { background: #555555; } .sw-9 { background: #5555FF; } .sw-a { background: #55FF55; } .sw-b { background: #55FFFF; }
.sw-c { background: #FF5555; } .sw-d { background: #FF55FF; } .sw-e { background: #FFFF55; } .sw-f { background: #FFFFFF; }
.cc-table td small { display: block; font-family: var(--mono); font-size: 0.78rem; font-weight: 400; color: var(--on-paper-soft); }
.cc-table td:first-child code { font-size: 0.95rem; }
.cc-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0 0 1.05em; padding: 16px 18px; background: var(--panel); color: var(--on-ink); }
.cc-cta p { margin: 0; flex: 1 1 260px; }
.cc-cta .tbtn { background: var(--red-500); color: #fff; box-shadow: none; }
.cc-cta .tbtn:hover { background: var(--red-600); }
.hub-lead { max-width: 70ch; margin: 0 0 clamp(22px, 3vw, 34px); font-size: 1.08rem; line-height: 1.6; }

/* very narrow phones: long button labels wrap instead of pushing the page sideways */
@media (max-width: 420px) { .tbtn { white-space: normal; } }
