﻿@import url("https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap");

@font-face {
  font-family: "Minecraft Ten";
  src: url("https://db.onlinewebfonts.com/t/a7fcb1becc12274d5b761b1d895f8aa9.woff2") format("woff2"),
       url("https://db.onlinewebfonts.com/t/a7fcb1becc12274d5b761b1d895f8aa9.woff") format("woff"),
       url("https://db.onlinewebfonts.com/t/a7fcb1becc12274d5b761b1d895f8aa9.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ore-black: #1e1e1f;
  --ore-ink: #111214;
  --ore-panel: rgba(22, 23, 26, 0.92);
  --ore-panel-solid: #1c1d21;
  --ore-panel-2: rgba(32, 33, 38, 0.94);
  --ore-header: rgba(24, 25, 29, 0.96);
  --ore-line: #0d0e10;
  --ore-muted: #a0a1a4;
  --ore-text: #f8f8f8;
  --ore-dim: #c6c6c6;
  --ore-green: #3c8527;
  --ore-green-hover: #52a535;
  --ore-green-pressed: #2a641c;
  --ore-green-deep: #1d4d13;
  --ore-green-hi: #659f50;
  --ore-green-hi-hover: #7fa277;
  --ore-white: #d0d1d4;
  --ore-white-hover: #f4f6f9;
  --ore-white-pressed: #b1b2b5;
  --ore-white-deep: #58585a;
  --ore-white-hi: #e5ebeb;
  --ore-gray: #48494d;
  --ore-gray-hover: #58585a;
  --ore-gray-deep: #323335;
  --ore-gray-hi: #52575b;
  --ore-red: #ca3636;
  --ore-red-hover: #c02d2d;
  --ore-red-deep: #ad1d1d;
  --ore-red-hi: #e06a6a;
  --ore-gold: #ffd83d;
  --ore-blue: #2e6be5;
  --ore-focus: #ffffff;
  --font-seven: "Noto Sans", "Segoe UI", sans-serif;
  --font-ten: "Minecraft Ten", "Noto Sans", sans-serif;
  --shadow-ui: 0 8px 28px rgba(0, 0, 0, 0.45);
  --field-fill: #2b2b2d;
  --field-fill-hover: #323234;
  --field-edge: #101012;
  --field-depth:
    inset 0 2px 0 rgba(0, 0, 0, 0.55),
    inset 3px 3px 0 rgba(0, 0, 0, 0.28),
    inset 0 -2px 0 rgba(255, 255, 255, 0.08),
    inset -2px -1px 0 rgba(255, 255, 255, 0.05);
  --btn-shadow: inset 0 -4px var(--deep), inset 3px 3px rgba(255, 255, 255, 0.2), inset -3px -7px rgba(255, 255, 255, 0.1);
  --btn-shadow-hover: inset 0 -4px var(--deep), inset 3px 3px rgba(255, 255, 255, 0.4), inset -3px -7px rgba(255, 255, 255, 0.4);
  --btn-shadow-active: inset 3px 3px rgba(255, 255, 255, 0.4), inset -3px -3px rgba(255, 255, 255, 0.2);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html {
  color-scheme: dark only;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ore-text);
  font-family: var(--font-seven);
  font-size: 15px;
  line-height: 1.45;
  background-color: #0e0f12;
  background-image:
    linear-gradient(rgba(10, 11, 14, 0.42), rgba(10, 11, 14, 0.58)),
    url("../img/panorama.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: hidden;
}

button, input, select { font-family: inherit; }

.brand-copy strong,
.ore-tabs a,
.side a,
.side h2,
.chip,
.btn,
.tag,
.toast,
.dialog-head,
.panel h1,
.hero-card h1,
.command h2,
.command .cmd,
.dialog h1,
h2.section,
.log-ver,
.feature h3,
.feature-icon,
.header-link,
.step h3,
.cat-select,
.step::before,
.tool-name,
th {
  font-family: var(--font-ten);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0;
  text-transform: none;
}

a { color: #b6e08f; text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

.app {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.ore-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 8px 16px;
  background: var(--ore-header);
  border-bottom: 3px solid var(--ore-line);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28);
  position: relative;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  flex: 1 1 0;
}
.brand:hover { text-decoration: none; color: inherit; }

.cube,
.brand-mark {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex: none;
  border-radius: 8px;
  background: #12141a;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy strong {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 16px;
}
.brand-copy span {
  color: var(--ore-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.search {
  flex: 0 1 560px;
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 2px 38px;
  color: var(--ore-text);
  background: var(--field-fill);
  border: 2px solid var(--field-edge);
  border-radius: 2px;
  box-shadow: var(--field-depth);
  outline: none;
  font-size: 14px;
}
.search input:hover { background: var(--field-fill-hover); }
.search input:focus { outline: 2px solid var(--ore-focus); outline-offset: 0; }
.search input::placeholder { color: #8d8e91; }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  opacity: 0.7;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.ore-tabs {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  background: rgba(16, 17, 20, 0.86);
  border-bottom: 3px solid var(--ore-line);
}
.ore-tabs-row {
  display: flex;
  flex: none;
  gap: 0;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px 12px 10px;
}
.ore-tabs a,
.side a,
.chip {
  --bg: var(--ore-white);
  --fg: #1b1b1b;
  --deep: #58585a;
  position: relative;
  flex: none;
  display: block;
  color: var(--fg);
  text-decoration: none;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--ore-black);
  outline: none;
  box-shadow: inset 0 -4px var(--deep), inset 2px 2px rgb(236, 237, 238), inset -2px -6px rgb(227, 227, 229);
  padding: 8px 12px 12px;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0;
  cursor: pointer;
  user-select: none;
  appearance: none;
  font-family: var(--font-ten);
  white-space: nowrap;
}
.ore-tabs a + a { margin-left: -1px; }
.side a + a { margin-top: -1px; }
.ore-tabs a:focus-visible,
.side a:focus-visible,
.chip:focus-visible {
  z-index: 3;
  outline: 2px solid #fff;
  outline-offset: -2px;
}
.ore-tabs a:hover,
.side a:hover,
.chip:hover {
  --bg: #ffffff;
  color: #1b1b1b;
  text-decoration: none;
  z-index: 1;
}
.ore-tabs a:active:not(.active),
.side a:active:not(.active),
.chip:active:not(.active) {
  --bg: var(--ore-white-pressed);
  --deep: var(--ore-white-deep);
  color: #1b1b1b;
  padding-top: 11px;
  padding-bottom: 9px;
  box-shadow: inset 0 3px 0 var(--ore-white-deep), inset 2px 2px rgba(0, 0, 0, 0.12), inset -2px -2px rgba(255, 255, 255, 0.2);
}
.ore-tabs a.active,
.side a.active,
.chip.active {
  --bg: var(--ore-green-pressed);
  --fg: #fff;
  --deep: var(--ore-green-deep);
  color: #fff;
  z-index: 2;
  padding-top: 11px;
  padding-bottom: 9px;
  box-shadow: inset 0 3px 0 var(--ore-green-deep), inset 2px 2px rgba(0, 0, 0, 0.18), inset -2px -2px rgba(255, 255, 255, 0.12);
}
.ore-tabs a.active::after,
.side a.active::after,
.chip.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 30%;
  min-width: 14px;
  max-width: 48px;
  height: 2px;
  transform: translateX(-50%);
  background: #fff;
  pointer-events: none;
}

.stage {
  overflow: auto;
  padding: 24px 24px 32px;
}
#stage-cache { display: none !important; }

.layout {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 20px;
  width: 100%;
  max-width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
}
.layout.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: min(1540px, calc(100% - 32px));
}
.layout.centered {
  grid-template-columns: 1fr;
  min-height: 100%;
  place-items: center;
  max-width: min(520px, calc(100% - 32px));
}

.side {
  position: sticky;
  top: 0;
  align-self: start;
  width: max-content;
  min-width: 200px;
  max-width: 280px;
  background: var(--ore-panel);
  border: 3px solid var(--ore-black);
  box-shadow: var(--shadow-ui), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 10px;
  overflow-anchor: none;
}
.side h2 {
  margin: 4px 8px 8px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ore-muted);
  font-weight: 400;
}
.side a {
  display: block;
  margin-bottom: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.index-backdrop,
#index-layer {
  display: none;
}

.panel, .card, .hero-card, .command, .notice, .dialog {
  background: var(--ore-panel);
  border: 3px solid var(--ore-black);
  box-shadow: var(--shadow-ui), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel { padding: 26px 30px 30px; }
.panel h1, .hero-card h1, .command h2, .dialog h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.15;
}
.lede {
  margin: 0 0 18px;
  color: var(--ore-dim);
  font-size: 15.5px;
  max-width: 68ch;
}
.panel > p,
.panel > ul,
.panel > ol,
.panel > .notice {
  max-width: 68ch;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: start;
}
.stack { display: grid; gap: 14px; }
.feature {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: var(--ore-panel-2);
  border: 3px solid var(--ore-black);
  color: inherit;
  text-decoration: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28);
}
.feature:hover { background: #2a2c33; text-decoration: none; color: inherit; }
.feature h3 { margin: 0; font-size: 18px; }
.feature p { margin: 3px 0 0; color: var(--ore-muted); font-size: 13.5px; }
.feature-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--ore-green);
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 var(--ore-green-hi), inset 0 -3px 0 var(--ore-green-deep);
  font-size: 20px;
  font-weight: 400;
}

.hero-card { padding: 22px; display: flex; flex-direction: column; }
.workshop-preview {
  --workshop-progress: 0%;
  position: relative;
  height: 390px;
  min-width: 0;
  margin-bottom: 20px;
  overflow: hidden;
  isolation: isolate;
  color: var(--ore-text);
  background: var(--ore-panel-solid);
  border: 1px solid var(--ore-gray-deep);
  box-shadow: 0 4px 0 var(--ore-line), inset 0 1px rgba(255,255,255,.07);
}
.workshop-heading {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 18px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.workshop-controls { display: flex; gap: 4px; }
.workshop-control {
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid transparent;
  color: var(--ore-dim);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.workshop-control:hover { color: var(--ore-text); background: var(--field-fill); border-color: var(--ore-gray); }
.workshop-control:focus-visible { outline: 2px solid var(--ore-focus); outline-offset: 2px; }
.workshop-canvas { position: absolute; top: 0; left: 0; width: 100%; height: calc(100% - 105px); display: block; }
.workshop-console {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 64px;
  padding: 10px 12px;
  border-left: 2px solid #8fb86b;
  background: var(--ore-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.workshop-command { display: flex; align-items: center; gap: 8px; min-height: 19px; color: #9ecb81; }
.workshop-command code { padding: 0; border: 0; background: transparent; color: #dcf1c6; font-size: 13px; font-family: ui-monospace, Consolas, monospace; }
.workshop-caret { width: 6px; height: 12px; background: #adcf8b; animation: workshop-caret 1.1s steps(1, end) infinite; }
.workshop-feedback { margin-top: 4px; color: var(--ore-muted); font-size: 11px; min-height: 16px; }
.workshop-timeline { position: absolute; left: 16px; right: 16px; bottom: 6px; }
.workshop-timeline-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--ore-dim); font-size: 11px; line-height: 16px; }
.workshop-timeline-labels [data-workshop-time] { color: var(--ore-muted); font-family: ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.workshop-scrubber { display: block; width: 100%; height: 32px; padding: 0; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: ew-resize; touch-action: none; }
.workshop-scrubber::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(to right, var(--ore-green-hi) 0 var(--workshop-progress), var(--ore-gray-deep) var(--workshop-progress) 100%); }
.workshop-scrubber::-moz-range-track { height: 6px; background: var(--ore-gray-deep); }
.workshop-scrubber::-moz-range-progress { height: 6px; background: var(--ore-green-hi); }
.workshop-scrubber::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 14px; height: 18px; margin-top: -6px; border: 2px solid var(--ore-line); border-radius: 0; background: var(--ore-white); box-shadow: inset 0 -3px var(--ore-white-deep); }
.workshop-scrubber::-moz-range-thumb { width: 10px; height: 14px; border: 2px solid var(--ore-line); border-radius: 0; background: var(--ore-white); box-shadow: inset 0 -3px var(--ore-white-deep); }
.workshop-scrubber:hover::-webkit-slider-thumb { background: var(--ore-white-hover); }
.workshop-scrubber:hover::-moz-range-thumb { background: var(--ore-white-hover); }
.workshop-scrubber:focus-visible { outline: 2px solid var(--ore-focus); outline-offset: 2px; }
.workshop-preview.is-paused .workshop-caret { animation-play-state: paused; }
@keyframes workshop-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .workshop-caret { animation: none; }
}
@media (pointer: coarse) {
  .workshop-control { min-height: 44px; min-width: 44px; }
  .workshop-scrubber { height: 44px; }
  .workshop-console { bottom: 76px; }
  .workshop-canvas { height: calc(100% - 122px); }
  .workshop-heading { top: 5px; }
}

.mountain-editor {
  margin: 8px 0 18px;
  min-width: 0;
  max-width: 100%;
}
.mountain-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.mountain-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--ore-muted);
  font-family: var(--font-ten);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.mountain-field input {
  width: 100%;
  height: 40px;
  padding: 0 10px 2px;
  color: var(--ore-text);
  background: var(--field-fill);
  border: 2px solid var(--field-edge);
  border-radius: 2px;
  box-shadow: var(--field-depth);
  outline: none;
  font-size: 14px;
  font-family: var(--font-seven);
}
.mountain-field input:hover { background: var(--field-fill-hover); }
.mountain-field input:focus { outline: 2px solid var(--ore-focus); outline-offset: 0; }
.mountain-field input::placeholder { color: #8d8e91; }
.mountain-field-actions { justify-content: flex-start; align-self: start; width: 100%; }
.mountain-field-actions .btn { width: 100%; }
.mountain-field-wide { grid-column: 1 / -1; }
.mountain-field .switch { margin-top: 3px; }
.gen-presets { margin: 0 0 12px; }
.mountain-view {
  position: relative;
  height: min(420px, 62vh);
  width: 100%;
  min-width: 0;
  background: #1c1c1e;
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 3px 0 #070808;
  overflow: hidden;
}
.mountain-view canvas {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}
.mountain-view.is-fly canvas { cursor: crosshair; }
.mountain-view.is-locked canvas { cursor: none; }
.mountain-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.mountain-view canvas.mountain-gl { display: none; }
.mountain-view.has-gl canvas.mountain-gl,
.mountain-view.is-fly canvas.mountain-gl { display: block; }
.mountain-view.is-fly {
  height: min(560px, 72vh);
  cursor: crosshair;
}
.mountain-view.is-locked {
  cursor: none;
}
.mountain-view.is-fly .mountain-crosshair { display: block; }
.mountain-fly-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: auto;
  min-width: 0;
  pointer-events: auto;
}
.mountain-touch {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.mountain-view.is-fly.is-touch .mountain-touch { display: block; }
.mountain-stick {
  position: absolute;
  left: 16px;
  bottom: 36px;
  width: 120px;
  height: 120px;
  background: url("../img/stick-frame.png") center / contain no-repeat;
  pointer-events: auto;
  touch-action: none;
}
.mountain-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  background: url("../img/stick-knob.png") center / contain no-repeat;
  pointer-events: none;
}
.mountain-vert {
  position: absolute;
  right: 12px;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  width: 76px;
}
.mountain-vert .btn { width: 100%; }
.mountain-crosshair {
  display: none;
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  pointer-events: none;
}
.mountain-view.is-locked .mountain-crosshair {
  display: block;
}
.mountain-crosshair::before,
.mountain-crosshair::after {
  content: "";
  position: absolute;
  background: #f4f4f4;
  box-shadow: 0 0 0 1px #000;
}
.mountain-crosshair::before {
  left: 8px;
  top: 0;
  width: 2px;
  height: 18px;
}
.mountain-crosshair::after {
  left: 0;
  top: 8px;
  width: 18px;
  height: 2px;
}
.mountain-view-meta {
  position: absolute;
  z-index: 2;
  left: 10px;
  right: 10px;
  bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #c4c5c8;
  font-size: 12px;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.mountain-fs {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: auto;
  min-width: 0;
  pointer-events: auto;
}
.mountain-view:fullscreen,
.mountain-view:-webkit-full-screen {
  width: 100%;
  height: 100%;
  max-height: none;
  border: none;
  box-shadow: none;
  background: #1c1c1e;
}
.mountain-view.is-fly:fullscreen,
.mountain-view.is-fly:-webkit-full-screen {
  height: 100%;
}


.btn {
  --bg: var(--ore-white);
  --fg: #1b1b1b;
  --deep: #58585a;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 18px 12px;
  color: var(--fg);
  background: var(--bg);
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 -4px var(--deep), inset 2px 2px rgb(236, 237, 238), inset -2px -6px rgb(227, 227, 229);
  font-family: var(--font-ten);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.btn:active {
  --bg: var(--ore-white-pressed);
  --fg: #1b1b1b;
  color: #1b1b1b;
  min-height: 38px;
  padding-top: 11px;
  padding-bottom: 9px;
  box-shadow: inset 0 3px 0 var(--ore-white-deep), inset 2px 2px rgba(0, 0, 0, 0.12), inset -2px -2px rgba(255, 255, 255, 0.2);
}
.btn.hero {
  --bg: var(--ore-green);
  --fg: #fff;
  --deep: var(--ore-green-deep);
  font-size: 13px;
  min-width: 140px;
  box-shadow: inset 0 -4px var(--deep), inset 2px 2px rgb(92, 143, 77), inset -2px -6px rgb(79, 145, 60);
}
.btn.secondary { --bg: var(--ore-white); --fg: #1b1b1b; --deep: #58585a; }
.btn.danger { --bg: var(--ore-red); --fg: #fff; --deep: var(--ore-red-deep); }
.btn.small { min-height: 32px; padding: 4px 10px 8px; font-size: 13px; }
.btn.small:active { min-height: 28px; padding-top: 7px; padding-bottom: 5px; }
a.btn:hover,
.btn:hover,
.btn.secondary:hover,
.btn.small:hover {
  --bg: #ffffff;
  color: #1b1b1b;
  text-decoration: none;
}
.btn.hero:hover,
a.btn.hero:hover {
  --bg: var(--ore-green-hi);
  color: #fff;
}
.btn.hero:active,
a.btn.hero:active {
  --bg: var(--ore-green-pressed);
  --fg: #fff;
  color: #fff;
  box-shadow: inset 0 3px 0 var(--ore-green-deep), inset 2px 2px rgba(0, 0, 0, 0.18), inset -2px -2px rgba(255, 255, 255, 0.12);
}
.btn.danger:hover,
a.btn.danger:hover {
  --bg: var(--ore-red-hi);
  color: #fff;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px 4px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  background: #2e3036;
  border: 2px solid var(--ore-black);
  color: var(--ore-dim);
}
.tag.green { background: #2d5a1f; color: #d7f0c8; }
.tag.gold { background: #6d5410; color: #ffe58a; }
.tag.red { background: #6a2424; color: #ffd0d0; }
.tag.blue { background: #1f3f66; color: #cfe4ff; }

.chips { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 14px; padding: 1px 0 0 1px; }
.chip {
  text-transform: none;
  font-size: 12px;
  margin: -1px 0 0 -1px;
}
.cat-select-wrap {
  display: none;
  position: relative;
  margin: 0 0 14px;
}
.cat-select-wrap > span {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ore-muted);
}
.cat-select {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 8px 36px 10px 12px;
  text-align: left;
  color: #1b1b1b;
  background-color: var(--ore-white);
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 -4px #58585a, inset 2px 2px rgba(255, 255, 255, 0.72), inset -2px -6px rgba(255, 255, 255, 0.28);
  font-family: var(--font-ten);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #1b1b1b 50%),
    linear-gradient(135deg, #1b1b1b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.cat-select:focus {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.cat-select[aria-expanded="true"] {
  z-index: 6;
}
.cat-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 3px);
  z-index: 5;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--ore-white);
  border: 3px solid var(--ore-black);
  box-shadow: var(--shadow-ui);
  max-height: min(70vh, 420px);
  overflow: auto;
}
.cat-menu li { margin: 0; padding: 0; }
.cat-menu button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  text-align: left;
  color: #1b1b1b;
  background: var(--ore-white);
  border: 0;
  border-bottom: 1px solid #8d8d8d;
  font-family: var(--font-ten);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  cursor: pointer;
}
.cat-menu li:last-child button { border-bottom: 0; }
.cat-menu button[aria-selected="true"] { background: #c8c9cc; }
.cat-menu button:hover,
.cat-menu button:focus-visible {
  background: #e8e8ea;
  outline: none;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.command {
  display: block;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.command:hover { background: var(--ore-panel-2); text-decoration: none; color: inherit; }
.command .cmd {
  font-weight: 400;
  color: #9be36a;
  font-size: 18px;
  letter-spacing: 0;
}

.command p { margin: 6px 0 0; color: var(--ore-dim); font-size: 13px; }

.api-dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.api-folder {
  margin: 0 0 18px;
}
.api-folder[hidden] { display: none; }
body:not(.folder-sync-on) .api-folder,
body:not(.folder-sync-on) a[href="#/api/folder"] { display: none !important; }
.api-grid { display: grid; gap: 8px; }
.api-group {
  margin: 18px 0 6px;
  font-size: 13px;
  color: var(--ore-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.api-card {
  padding: 12px 14px;
  background: var(--ore-panel);
  box-shadow: var(--shadow-ui);
}
.api-card .cmd {
  font-family: var(--font-ten);
  font-weight: 400;
  color: #9be36a;
  font-size: 18px;
}
.api-card p { margin: 6px 0 0; color: var(--ore-dim); font-size: 13px; }
.api-card .api-params { color: var(--ore-muted); }

h2.section, .panel h1[id] { scroll-margin-top: 8px; }
h2.section {
  margin: 40px 0 12px;
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
}
.permalink {
  margin-left: 0.4em;
  color: var(--ore-muted);
  opacity: 0;
  font-weight: 700;
  text-decoration: none;
}
h1:hover .permalink, h2:hover .permalink, .permalink:hover, .permalink:focus {
  opacity: 1;
  color: #b6e08f;
  text-decoration: none;
}
h3 { margin: 18px 0 8px; font-size: 16px; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 14px; padding-left: 20px; color: var(--ore-dim); }
li { margin: 0 0 6px; }
li strong { color: var(--ore-text); }

.panel ul:not(.cat-menu):not(.chips):not(.log-list),
.wiki-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 6px 8px;
  max-width: 68ch;
  color: var(--ore-dim);
  background: var(--ore-panel-2);
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28);
}
.panel ul:not(.cat-menu):not(.chips):not(.log-list) li,
.wiki-list li {
  position: relative;
  margin: 0;
  padding: 8px 10px 8px 22px;
  border-bottom: 1px solid #2a2b30;
}
.panel ul:not(.cat-menu):not(.chips):not(.log-list) li:last-child,
.wiki-list li:last-child { border-bottom: none; }
.panel ul:not(.cat-menu):not(.chips):not(.log-list) li::before,
.wiki-list li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 0.95em;
  width: 6px;
  height: 6px;
  background: var(--ore-green);
  box-shadow: 1px 1px 0 #111;
}
.wiki-list strong { color: var(--ore-text); }

.table-wrap {
  overflow: auto;
  margin: 0 0 16px;
  border: 3px solid var(--ore-black);
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13.5px;
}
th, td {
  padding: 9px 14px;
  border-bottom: 1px solid #2a2b30;
  text-align: left;
  vertical-align: top;
}
th:first-child,
td:first-child {
  white-space: nowrap;
  width: 1%;
}
th { background: #141518; color: var(--ore-muted); font-size: 12px; letter-spacing: 0; text-transform: none; }
tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

pre, .code {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--field-fill);
  border: 2px solid var(--field-edge);
  border-radius: 2px;
  box-shadow: var(--field-depth);
  padding: 12px 14px;
  padding-right: 76px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #e4e4e4;
  margin: 0 0 14px;
}
.code-wrap {
  overflow: visible;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.code-wrap .code-hl { white-space: pre-wrap; }
.code-hl {
  display: block;
  font: inherit;
  color: inherit;
  white-space: pre;
  tab-size: 2;
}
.tok-kw { color: #569cd6; }
.tok-fn { color: #dcdcaa; }
.tok-str { color: #ce9178; }
.tok-num { color: #b5cea8; }
.tok-cm { color: #6a9955; }
.tok-prop { color: #9cdcfe; }
.tok-type { color: #4ec9b0; }
.tok-var { color: #9cdcfe; }
.tok-br1 { color: #ffd700; }
.tok-br2 { color: #da70d6; }
.tok-br3 { color: #179fff; }
.tok-br-err { color: #f44747; }
.copy { position: absolute; top: 6px; right: 6px; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px 3px;
  border: 2px solid var(--ore-black);
  background: var(--ore-white);
  color: #111;
  font-weight: 700;
  font-size: 12px;
  box-shadow: inset 0 -2px 0 var(--ore-white-deep);
}

.notice { padding: 12px 14px; margin: 0 0 14px; }
.notice.gold { box-shadow: var(--shadow-ui), inset 4px 0 0 var(--ore-gold); }
.notice.green { box-shadow: var(--shadow-ui), inset 4px 0 0 var(--ore-green-hi); }
.notice.red { box-shadow: var(--shadow-ui), inset 4px 0 0 var(--ore-red); }

.steps { counter-reset: step; display: grid; gap: 10px; margin: 0 0 16px; }
.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--ore-panel-2);
  border: 3px solid var(--ore-black);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--ore-green);
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 var(--ore-green-hi), inset 0 -3px 0 var(--ore-green-deep);
  font-weight: 400;
}
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; color: var(--ore-dim); font-size: 13.5px; }

.dialog { width: min(460px, 100%); overflow: hidden; }
.dialog-head {
  background: #2a2c33;
  border-bottom: 3px solid var(--ore-line);
  text-align: center;
  padding: 10px 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-size: 14px;
}
.dialog-body { padding: 18px 16px 16px; }
.dialog-body .btn { width: 100%; }
.dialog-body .btn + .btn { margin-top: 8px; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: rgba(12, 13, 16, 0.92);
  border-top: 3px solid var(--ore-line);
  color: var(--ore-muted);
  font-size: 12px;
}

.search-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 360px;
  overflow: auto;
  background: var(--ore-panel-solid);
  border: 3px solid var(--ore-black);
  box-shadow: var(--shadow-ui);
  display: none;
  z-index: 50;
}
.search-pop.open { display: block; }
.search-hit {
  display: block;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #2a2b30;
}
.search-hit:hover, .search-hit.active { background: #2a641c; text-decoration: none; color: #fff; }
.search-hit b { color: #9be36a; }
.search-hit small { display: block; color: var(--ore-muted); }

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ore-muted);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  margin: 0 0 22px;
  width: 100%;
}
.tool-grid.related-tools {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  margin-bottom: 16px;
}
.tool-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px 10px;
  color: inherit;
  text-decoration: none;
  background: #141518;
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), inset 0 -3px 0 rgba(0, 0, 0, 0.35);
  min-height: 118px;
}
.tool-slot:hover {
  background: #2a2c33;
  text-decoration: none;
  color: inherit;
}
.tool-slot[hidden] { display: none; }
.tool-icon {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  flex: none;
}
.tool-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex: 1;
  min-width: min(100%, 260px);
}
.tool-hero .tool-icon {
  width: 96px;
  height: 96px;
  padding: 10px;
  background: #141518;
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05);
}
.tool-name {
  font-size: 12px;
  text-align: center;
  line-height: 1.2;
  color: var(--ore-text);
}
.tool-cat {
  font-size: 11px;
  color: var(--ore-muted);
  text-align: center;
  line-height: 1.2;
}

.related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--ore-panel-2);
  border: 2px solid var(--ore-line);
  color: inherit;
  text-decoration: none;
}
.related-card:hover {
  background: #2a2c33;
  text-decoration: none;
  color: inherit;
}
.related-card strong {
  font-family: var(--font-ten);
  font-weight: 400;
  color: #b6e08f;
}
.related-card span {
  color: var(--ore-muted);
  font-size: 13px;
  line-height: 1.35;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 54px;
  z-index: 40;
  background: var(--ore-green);
  color: #fff;
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 var(--ore-green-hi), inset 0 -3px 0 var(--ore-green-deep);
  padding: 8px 12px 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 160ms ease;
}
.toast.show { opacity: 1; transform: none; }

.icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--ore-dim);
  background: var(--ore-panel);
  border: 3px solid var(--ore-black);
  box-shadow: var(--shadow-ui), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: 120ms ease;
}
.icon-btn:hover { color: #fff; background: rgba(40, 42, 48, 0.95); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.index-handle,
.icon-btn.search-handle,
.index-peek { display: none; }
.header-end {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}
.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  color: var(--ore-dim);
  background: var(--ore-panel);
  border: 3px solid var(--ore-black);
  box-shadow: var(--shadow-ui), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  transition: 120ms ease;
}
.header-link:hover {
  color: #fff;
  background: rgba(40, 42, 48, 0.95);
  text-decoration: none;
}
.header-link:active { transform: translateY(1px); }
.header-link.active {
  color: #fff;
  background: var(--ore-green-pressed);
}
.header-link svg { flex: none; }
h2.section .tag {
  margin-left: 8px;
  vertical-align: middle;
}
.log-release {
  margin: 0 0 12px;
  background: var(--ore-panel-2);
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28);
}
.log-release[open] {
  box-shadow: inset 4px 0 0 var(--ore-green-hi), inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28);
}
.log-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 4px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.log-summary::-webkit-details-marker { display: none; }
.log-summary::marker { content: none; }
.log-summary:hover { background: rgba(255, 255, 255, 0.03); }
.log-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.log-ver {
  font-size: 20px;
  line-height: 1.1;
}
.log-date,
.log-counts {
  grid-column: 1;
  color: var(--ore-muted);
  font-size: 13px;
  line-height: 1.35;
}
.log-counts { font-size: 12.5px; }
.log-chevron {
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--ore-dim);
  border-bottom: 2px solid var(--ore-dim);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}
.log-release[open] .log-chevron { transform: rotate(-135deg); }
.log-body { padding: 0 14px 14px; }
.log-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.log-col {
  min-width: 0;
  padding: 12px 14px 14px;
  background: var(--ore-panel-2);
  border: 3px solid var(--ore-black);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28);
}
.log-col.added { box-shadow: inset 4px 0 0 var(--ore-green-hi), inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28); }
.log-col.changed { box-shadow: inset 4px 0 0 var(--ore-gold), inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28); }
.log-col.removed { box-shadow: inset 4px 0 0 var(--ore-red), inset 0 2px 0 rgba(255, 255, 255, 0.05), inset 0 -3px 0 rgba(0, 0, 0, 0.28); }
.log-col h3 {
  margin: 0 0 8px;
  font-family: var(--font-ten);
  font-weight: 400;
  font-size: 14px;
}
.log-col.added h3 { color: #b6e08f; }
.log-col.changed h3 { color: #ffe58a; }
.log-col.removed h3 { color: #ffd0d0; }
.panel ul.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
  color: var(--ore-dim);
  background: none;
  border: none;
  box-shadow: none;
}
.panel ul.log-list li {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid #2a2b30;
}
.panel ul.log-list li:last-child { border-bottom: none; }
.panel ul.log-list li::before { content: none; }
.panel ul.log-list span {
  display: block;
  margin-top: 3px;
  color: var(--ore-muted);
  font-size: 13px;
  line-height: 1.4;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay[hidden] { display: none; }
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.overlay .dialog {
  position: relative;
  z-index: 1;
}
body.site-locked .app,
body.site-locked #index-layer,
body.site-locked #settings,
body.site-locked #license,
body.site-locked #toast,
body.site-locked #stage-cache {
  visibility: hidden;
  pointer-events: none;
}
.gate-overlay {
  z-index: 80;
  background: rgba(8, 9, 12, 0.72);
}
body:not(.site-locked) .gate-overlay { display: none; }
.gate-lede { margin: 0 0 14px; max-width: none; }
.gate-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--ore-muted);
  font-family: var(--font-ten);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.gate-field input {
  width: 100%;
  height: 40px;
  padding: 0 10px 2px;
  color: var(--ore-text);
  background: var(--field-fill);
  border: 2px solid var(--field-edge);
  border-radius: 2px;
  box-shadow: var(--field-depth);
  outline: none;
  font-size: 14px;
  font-family: var(--font-seven);
}
.gate-field input:hover { background: var(--field-fill-hover); }
.gate-field input:focus { outline: 2px solid var(--ore-focus); outline-offset: 0; }
.gate-field input::placeholder { color: #8d8e91; }
.gate-err {
  margin: 0 0 10px;
  color: var(--ore-red-hi);
  font-size: 13px;
}
.dialog.license-dialog {
  width: min(560px, 100%);
  background: var(--ore-panel-solid);
}
.license-copy {
  max-height: min(52vh, 420px);
  overflow: auto;
  margin: 0 0 14px;
  color: var(--ore-dim);
  font-size: 13.5px;
}
.license-copy p { margin: 0 0 10px; }
.license-copy ul { margin: 0 0 10px; padding-left: 1.2em; }
.license-copy li { margin: 0 0 4px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  cursor: pointer;
}
.setting-copy { display: flex; flex-direction: column; gap: 2px; }
.setting-copy strong { font-size: 14px; }
.setting-copy em { font-style: normal; font-size: 12.5px; color: var(--ore-muted); }

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  height: 32px;
  -webkit-tap-highlight-color: transparent;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.switch-ui {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: url("../img/toggle/off.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
.switch input:checked + .switch-ui { background-image: url("../img/toggle/on.png"); }
.switch input:hover:not(:disabled):not(:active) + .switch-ui { background-image: url("../img/toggle/off-hover.png"); }
.switch input:checked:hover:not(:disabled):not(:active) + .switch-ui { background-image: url("../img/toggle/on-hover.png"); }
.switch input:focus-visible + .switch-ui { background-image: url("../img/toggle/off-focus.png"); }
.switch input:checked:focus-visible + .switch-ui { background-image: url("../img/toggle/on-focus.png"); }
.switch input:active:not(:disabled) + .switch-ui { background-image: url("../img/toggle/off-pressed.png"); }
.switch input:checked:active:not(:disabled) + .switch-ui { background-image: url("../img/toggle/on-pressed.png"); }

@media (min-width: 981px) {
  body:not(.index-on) .side { display: none; }
  body:not(.index-on) .layout { grid-template-columns: minmax(0, 1fr); }
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #101114; }
::-webkit-scrollbar-thumb {
  background: var(--ore-gray);
  border: 3px solid #101114;
}
::-webkit-scrollbar-thumb:hover { background: var(--ore-gray-hover); }

@media (min-width: 1400px) {
  .stage { padding: 30px 32px 40px; }
  .layout {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 24px;
    max-width: min(1560px, calc(100% - 48px));
  }
  .layout.single { max-width: min(1500px, calc(100% - 48px)); }
  .panel { padding: 26px 30px 32px; }
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1800px) {
  .stage { padding: 36px 44px 48px; }
  .layout {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 26px;
    max-width: min(1720px, calc(100% - 64px));
  }
  .layout.single { max-width: min(1660px, calc(100% - 64px)); }
  .panel h1, .hero-card h1 { font-size: 30px; }
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 980px) {
  body { --index-drawer: min(252px, 84vw); }
  .hero-grid, .layout { grid-template-columns: minmax(0, 1fr); }
  .layout { max-width: 100%; }
  .layout > .side { display: none; }
  .layout > .panel { grid-column: 1; grid-row: 1; min-width: 0; }
  .stage { overflow-x: hidden; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .header-end { flex: 0 0 auto; }
  .brand-copy span, .header-meta .tag { display: none; }
  .panel h1, .hero-card h1 { font-size: 22px; }
  .header-meta { display: none; }
  .header-link {
    width: 38px;
    padding: 0;
  }
  .header-link-label { display: none; }

  .icon-btn.search-handle { display: grid; }
  body.search-open .search-handle {
    color: #fff;
    background: var(--ore-green-pressed);
  }
  .search {
    display: none;
  }
  body.search-open .ore-header { flex-wrap: wrap; }
  body.search-open .search {
    display: block;
    position: relative;
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
  }
  .search input { font-size: 16px; }

  body.index-ready #index-layer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 48;
    overflow: visible;
    pointer-events: none;
  }

  body.index-ready .icon-btn.index-handle {
    display: grid;
    width: auto;
    min-width: 38px;
    padding: 0 10px;
    font-family: var(--font-ten);
    font-size: 11px;
    letter-spacing: 0.06em;
  }
  body.index-open .index-handle {
    color: #fff;
    background: var(--ore-green-pressed);
  }

  .index-drawer {
    position: fixed;
    top: 50%;
    left: 0;
    z-index: 46;
    width: var(--index-drawer);
    overflow: visible;
    pointer-events: none;
    transform: translate(-100%, -50%);
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.index-open .index-drawer {
    transform: translate(0, -50%);
  }

  body.index-ready .index-peek {
    display: grid;
    place-items: center;
    position: absolute;
    left: calc(100% - 5px);
    top: 50%;
    z-index: 2;
    width: 30px;
    height: 48px;
    padding: 0;
    color: #fff;
    background: var(--ore-green);
    border: 3px solid var(--ore-black);
    border-left: none;
    border-radius: 0 10px 10px 0;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    pointer-events: auto;
    cursor: pointer;
    transform: translateY(-50%);
    transition: left 280ms cubic-bezier(0.22, 1, 0.36, 1),
      top 280ms cubic-bezier(0.22, 1, 0.36, 1),
      width 280ms cubic-bezier(0.22, 1, 0.36, 1),
      height 280ms cubic-bezier(0.22, 1, 0.36, 1),
      background 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease,
      transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.index-ready .index-peek svg {
    display: block;
    width: 12px;
    height: 16px;
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.index-ready:not(.index-open) .index-peek {
    animation: index-peek-nudge 2.6s ease-in-out infinite;
  }
  body.index-ready .index-peek:hover,
  body.index-ready .index-peek:focus-visible {
    background: var(--ore-green-hover);
    animation: none;
  }
  body.index-open .index-peek {
    left: calc(100% - 36px);
    top: 8px;
    width: 28px;
    height: 28px;
    background: transparent;
    border-color: transparent;
    border-radius: 0;
    box-shadow: none;
    color: var(--ore-muted);
    transform: none;
    animation: none;
  }
  body.index-open .index-peek:hover,
  body.index-open .index-peek:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  body.index-open .index-peek svg {
    transform: rotate(180deg);
  }

  @keyframes index-peek-nudge {
    0%, 58%, 100% { transform: translateY(-50%) translateX(0); }
    66% { transform: translateY(-50%) translateX(5px); }
    74% { transform: translateY(-50%) translateX(0); }
    82% { transform: translateY(-50%) translateX(4px); }
  }
  @media (prefers-reduced-motion: reduce) {
    body.index-ready:not(.index-open) .index-peek { animation: none; }
    .index-drawer, .index-peek, .index-peek svg { transition: none; }
  }
  .permalink { opacity: 0.5; }

  .ore-header, .ore-tabs {
    min-height: 0;
  }

  .index-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }
  body.index-open .index-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .index-backdrop[hidden] {
    display: block;
    opacity: 0;
    pointer-events: none;
  }

  .index-drawer .side {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 24px);
    margin: 0;
    padding: 12px 10px 14px;
    background: var(--ore-panel-solid);
    overflow-x: hidden;
    overflow-y: auto;
    transform: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    pointer-events: auto;
  }
  .side h2 {
    display: block;
    margin: 4px 8px 10px;
    padding-right: 28px;
  }
  .side a {
    margin: 0;
    text-align: center;
  }
  .side a + a {
    margin-top: -1px;
    margin-left: 0;
  }

  .layout:has(#cmd-cats) .side {
    display: none;
  }
}

@media (max-width: 720px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  .app {
    height: 100%;
    height: 100dvh;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .ore-header {
    gap: 10px;
    padding: 8px 10px;
    min-height: 0;
    flex-wrap: nowrap;
  }
  .brand { min-width: 0; }
  .brand-copy strong { font-size: 13px; letter-spacing: 0.06em; }
  .cube,
  .brand-mark { width: 32px; height: 32px; }
  .ore-tabs {
    justify-content: flex-start;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .ore-tabs::-webkit-scrollbar { display: none; }
  .ore-tabs-row {
    gap: 0;
    padding: 8px 10px 10px;
  }
  .ore-tabs a {
    padding: 9px 12px 11px;
    font-size: 11px;
    min-height: 36px;
  }
  .stage {
    padding: 10px;
    overflow: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .layout { gap: 10px; }
  .panel {
    padding: 14px 12px 18px;
  }
  .panel h1, .hero-card h1 { font-size: 20px; }
  .lede { font-size: 13px; }
  .hero-card {
    padding: 12px;
    min-height: 0;
    height: auto;
    overflow: visible;
  }
  .workshop-preview { height: 320px; min-height: 320px; margin-bottom: 16px; flex: none; }
  .workshop-heading { left: 12px; right: 8px; }
  .workshop-console { left: 10px; right: 10px; }
  .feature {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    flex: none;
  }
  .feature-icon {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }
  .feature h3 { font-size: 14px; }
  .feature p { font-size: 12px; }
  .feature > .tag {
    grid-column: 2;
    justify-self: start;
  }
  .btn-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 12px;
    margin-top: 8px;
  }
  .btn-row .btn,
  .btn-row .btn.hero,
  .btn-row .btn.secondary {
    width: 100%;
    flex: none;
    min-width: 0;
    min-height: 40px;
    font-size: 12px;
  }
  .btn.small {
    width: auto;
    flex: 0 0 auto;
    min-height: 28px;
    min-width: 0;
  }
  .copy { width: auto; }
  .grid-cards {
    grid-template-columns: 1fr;
  }
  .log-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .layout:has(#cmd-cats) .chips {
    display: none;
  }
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
  }
  .tool-slot { min-height: 108px; padding: 10px 6px 8px; }
  .tool-hero { gap: 12px; }
  .tool-hero .tool-icon { width: 72px; height: 72px; padding: 8px; }
  .cat-select-wrap {
    display: block;
  }
  .cat-select {
    min-height: 44px;
    font-size: 16px; /* avoid iOS zoom */
    padding-right: 36px;
  }
  pre, .code {
    font-size: 12px;
    padding-right: 72px;
  }
  /* Stack tables into cards so phones never scroll sideways */
  table, tbody, tr, td {
    display: block;
    width: 100%;
  }
  thead { display: none; }
  table {
    border: 3px solid var(--ore-black);
    background: var(--ore-panel-2);
    margin: 0 0 14px;
  }
  tr {
    padding: 4px 0;
    border-bottom: 2px solid var(--ore-black);
  }
  tr:last-child { border-bottom: none; }
  tr:nth-child(even) td { background: transparent; }
  td {
    border: none;
    padding: 6px 12px;
  }
  th:first-child,
  td:first-child {
    white-space: normal;
    width: 100%;
    font-weight: 700;
    color: var(--ore-text);
    padding-bottom: 2px;
  }
  td:not(:first-child) {
    color: var(--ore-muted);
    font-size: 13px;
    padding-top: 0;
  }
  .footer {
    padding: 8px 10px;
    font-size: 11px;
  }
  .dialog { width: min(100%, 100%); }
  .search-pop { max-height: 50vh; }
}

@media (max-width: 420px) {
  .btn, .btn.hero, .btn.secondary {
    flex: 1 1 100%;
  }
  .feature p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
