@font-face {
  font-family: 'Minecraft';
  src: url('/fonts/Minecraft.woff2') format('woff2'),
       url('/fonts/Minecraft.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Monocraft';
  src: url('/fonts/Monocraft.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Monocraft';
  src: url('/fonts/Monocraft-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --mc: 'Minecraft', 'Monocraft', monospace;
  --mono: 'Monocraft', monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Helvetica, Arial, sans-serif;
  --code: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, "SF Mono", Menlo, monospace;
  --sky-a: #0a0e22;
  --sky-b: #111a3a;
  --sky-c: #1a2850;
  --panel: rgba(13, 15, 32, 0.88);
  --panel-border: #283052;
  --panel-hi: #39436e;
  --panel-lo: #0b0e1e;
  --panel-inset: #0b0e1e;
  --input-bg: rgba(7, 9, 20, 0.7);
  --input-brd: #232b4d;
  --text: #e8e6da;
  --text-sec: #b6b1a0;
  --muted: #726c58;
  --accent: #ffd75e;
  --accent-dk: #cfa02e;
  --accent-rgb: 255, 215, 94;
  --green: #55ff55;
  --green-dk: #00aa00;
  --gold: #ffaa00;
  --red: #ff5555;
  --aqua: #55ffff;
  --btn-bg: #b8860e;
  --btn-hi: #e3b84a;
  --btn-lo: #7a5708;
  --btn-grad: #d5a428;
  --btn2-bg: #363c58;
  --btn2-hi: #4e5578;
  --btn2-lo: #22263a;
  --btn2-grad: #434a6e;
  --tsh: 1px 1px 0 rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 55%, var(--sky-c) 100%) fixed;
  color: var(--text);
  font-family: var(--mc);
  font-size: var(--fs-13, 13px);
  line-height: 1.6;
  -webkit-font-smoothing: none;
  overflow-x: hidden;
}

.star-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  image-rendering: pixelated;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.45; }
  to { opacity: 0.8; }
}

/* ---- flying owls & trees ---- */
.owls { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.owl {
  --owl-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14' shape-rendering='crispEdges'%3E%3Cpath fill='%23060917' d='M0 7h2v1H0zM0 8h3v1H0zM2 6h10v5H2zM3 11h7v1H3zM10 1h8v5h-8zM11 6h6v1h-6zM10 0h2v1h-2zM16 0h2v1h-2zM6 1h3v1H6zM5 2h4v1H5zM4 3h5v2H4zM5 5h5v1H5z'/%3E%3Cpath fill='%23ffd75e' d='M11 2h2v2h-2zM15 2h2v2h-2z'/%3E%3Cpath fill='%23cfa02e' d='M13 4h2v1h-2z'/%3E%3C/svg%3E");
  --owl-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14' shape-rendering='crispEdges'%3E%3Cpath fill='%23060917' d='M0 7h2v1H0zM0 8h3v1H0zM2 6h10v5H2zM3 11h7v1H3zM10 1h8v5h-8zM11 6h6v1h-6zM10 0h2v1h-2zM16 0h2v1h-2zM4 11h5v1H4zM5 12h4v1H5zM6 13h3v1H6z'/%3E%3Cpath fill='%23ffd75e' d='M11 2h2v2h-2zM15 2h2v2h-2z'/%3E%3Cpath fill='%23cfa02e' d='M13 4h2v1h-2z'/%3E%3C/svg%3E");
  --owl-sit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 15' shape-rendering='crispEdges'%3E%3Cpath fill='%23060917' d='M2 0h2v1H2zM8 0h2v1H8zM1 1h10v5H1zM1 6h10v6H1zM2 12h8v1H2zM3 13h6v1H3z'/%3E%3Cpath fill='%23ffd75e' d='M2 2h2v2H2zM8 2h2v2H8z'/%3E%3Cpath fill='%23cfa02e' d='M5 4h2v1H5zM3 14h2v1H3zM7 14h2v1H7z'/%3E%3C/svg%3E");
  --owl-blink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 15' shape-rendering='crispEdges'%3E%3Cpath fill='%23060917' d='M2 0h2v1H2zM8 0h2v1H8zM1 1h10v5H1zM1 6h10v6H1zM2 12h8v1H2zM3 13h6v1H3z'/%3E%3Cpath fill='%23cfa02e' d='M2 3h2v1H2zM8 3h2v1H8zM5 4h2v1H5zM3 14h2v1H3zM7 14h2v1H7z'/%3E%3C/svg%3E");
  position: absolute;
  left: -12%;
  width: 72px;
  height: 56px;
  background-image: var(--owl-a);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  image-rendering: pixelated;
  animation:
    owl-fly var(--fly, 60s) linear var(--delay, 0s) infinite,
    owl-flap var(--flap, 0.5s) step-end infinite,
    owl-bob var(--bob, 3.5s) ease-in-out infinite;
}
.owl-1 { top: 11%; --fly: 65s; --flap: 0.45s; --bob: 3.2s; }
.owl-3 { top: 5%; --fly: 100s; --flap: 0.65s; --bob: 4.6s; --delay: -60s; width: 45px; height: 35px; }
.owl-js {
  animation: none;
  left: -100px;
  top: 20vh;
}
.owl-js.flying { animation: owl-flap 0.45s step-end infinite; }
.owl-js.sitting {
  background-image: var(--owl-sit);
  animation: owl-blink 4.5s step-end infinite;
}
.owl {
  transition: scale 0.16s ease, rotate 0.16s ease;
}
.owl.poked { scale: 1.25; rotate: -12deg; }
.owl-giant.poked { scale: 1.1; rotate: -5deg; }
.owl-giant {
  position: fixed;
  z-index: 60;
  top: 12vh;
  width: 38vw;
  max-width: 540px;
  height: auto;
  aspect-ratio: 18 / 14;
  left: -45vw;
  background-image: var(--owl-a);
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
  pointer-events: none;
  transition: left 15s linear;
  animation:
    owl-flap 0.3s step-end infinite,
    owl-bob 1.4s ease-in-out infinite;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.55));
}
.owl-giant.owl-falling {
  animation:
    owl-flap 0.12s step-end infinite,
    owl-bob 0.5s ease-in-out infinite;
}
.debris {
  position: fixed;
  z-index: 59;
  pointer-events: none;
  image-rendering: pixelated;
  animation: debris-pop 0.9s ease-out forwards;
}
.proj-shard {
  position: fixed;
  z-index: 61;
  height: 76px;
  width: auto;
  border: 2px solid #000;
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: shard-pop 1.9s ease-out forwards;
}
@keyframes shard-pop {
  0% { translate: 0 0; scale: 0.4; rotate: 0deg; opacity: 1; }
  10% { scale: 1; }
  55% { translate: calc(var(--dx) * 0.7) var(--dy); opacity: 1; }
  100% { translate: var(--dx) 45vh; rotate: var(--rot); opacity: 0; }
}
@keyframes debris-pop {
  to { translate: var(--dx) var(--dy); rotate: var(--rot); opacity: 0; }
}
body.shake { animation: page-shake 0.35s linear; }
@keyframes page-shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -6px 3px; }
  40% { translate: 5px -4px; }
  60% { translate: -4px 2px; }
  80% { translate: 3px -2px; }
}

@keyframes owl-fly { to { left: 112%; } }
@keyframes owl-flap { 0%, 100% { background-image: var(--owl-a); } 50% { background-image: var(--owl-b); } }
@keyframes owl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(16px); } }
@keyframes owl-blink {
  0%, 88% { background-image: var(--owl-sit); }
  90%, 95% { background-image: var(--owl-blink); }
  97%, 100% { background-image: var(--owl-sit); }
}

.isle {
  position: absolute;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  image-rendering: pixelated;
  background-image: url("/img/iv-tree.svg");
}
.isle-1 { left: 1.5vw; bottom: 17vh; width: 300px; aspect-ratio: 44 / 38; }
.isle-2 { right: 2vw; bottom: 33vh; width: 200px; aspect-ratio: 44 / 38; }
.isle-3 { left: 61vw; top: 8vh; width: 150px; aspect-ratio: 44 / 38; }
.isle-glow {
  position: absolute;
  left: 50%;
  top: 13%;
  width: 82%;
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
  animation: glow-pulse 2.6s ease-in-out infinite alternate;
}
.glow-warm { background: radial-gradient(circle, rgba(255, 200, 90, 0.30) 0%, rgba(255, 200, 90, 0.10) 42%, transparent 66%); }
.glow-fire { top: 10%; width: 98%; background: radial-gradient(circle, rgba(255, 150, 40, 0.40) 0%, rgba(255, 110, 30, 0.14) 44%, transparent 70%); }
.glow-cool { background: radial-gradient(circle, rgba(200, 220, 255, 0.28) 0%, rgba(200, 220, 255, 0.08) 45%, transparent 66%); }
@keyframes glow-pulse {
  from { opacity: 0.55; scale: 0.92; }
  to { opacity: 1; scale: 1.12; }
}

@media (prefers-reduced-motion: reduce) {
  .owls { display: none; }
  .star-canvas { animation: none; }
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: rgba(8, 10, 24, 0.92);
  border-bottom: 2px solid var(--panel-border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 70;
  flex-wrap: wrap;
}

.brand {
  font-size: calc(16px * var(--fs-scale, 1));
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
  user-select: none;
}
.brand-logo { image-rendering: pixelated; vertical-align: -4px; margin-right: 2px; }
.brand .tld { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  font-size: var(--fs-10, 10px);
  color: var(--text-sec);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: var(--tsh);
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-link svg { width: 15px; height: 15px; flex: none; }

input[type="range"] { accent-color: var(--accent); }
.vol-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.vol-box input[type="range"] { width: 88px; }
.vol-step {
  padding: 0 6px;
  font-size: var(--fs-11, 11px);
  line-height: 1.7;
  border-width: 2px;
  background: var(--input-bg);
}
.vol-step:hover:not(:disabled) { border-color: var(--accent); filter: none; }
.vol-ico { font-size: var(--fs-12, 12px); }
.vol-val { font-size: var(--fs-10, 10px); color: var(--text-sec); min-width: 34px; }

.settings-wrap { position: relative; }
.settings-btn {
  background: none;
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 8px 12px;
  cursor: pointer;
}
.settings-btn:hover:not(:disabled) { filter: none; border-color: var(--accent); }
.settings-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent-dk); }
.set-ico { font-size: var(--fs-13, 13px); }
.settings-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  width: max-content;
  max-width: min(340px, calc(100vw - 24px));
  padding: 14px 16px;
  background: var(--panel);
  border: 2px solid;
  border-top-color: var(--panel-hi);
  border-left-color: var(--panel-hi);
  border-bottom-color: var(--panel-lo);
  border-right-color: var(--panel-lo);
  border-radius: 3px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.set-group + .set-group { margin-top: 14px; }
.set-label {
  font-size: var(--fs-10, 10px);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-sec);
  margin-bottom: 7px;
}
.set-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.set-opt {
  padding: 6px 10px;
  font-size: var(--fs-11, 11px);
  border-width: 2px;
  background: var(--input-bg);
  color: var(--text-sec);
}
.set-opt:hover:not(:disabled) { border-color: var(--accent); filter: none; }
.set-opt.active {
  color: var(--accent);
  border-color: var(--accent-dk);
  background: rgba(255, 255, 255, 0.06);
}
#fontOpts .set-opt[data-value="system"] { font-family: var(--sans); }
.pa-pitch { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pa-plabel { font-size: var(--fs-10, 10px); text-transform: uppercase; letter-spacing: 1px; color: var(--text-sec); }
.pa-pitch input[type="range"] { width: 120px; }
.pa-pval { font-size: var(--fs-11, 11px); color: var(--text-sec); min-width: 36px; }
.pa-pstep, .pa-preset { padding: 0 7px; font-size: var(--fs-11, 11px); line-height: 1.7; border-width: 2px; background: var(--input-bg); }
.pa-pstep:hover:not(:disabled), .pa-preset:hover { border-color: var(--accent); filter: none; }


.version-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.version-picker label {
  color: var(--text-sec);
  font-size: var(--fs-10, 10px);
  text-transform: uppercase;
  letter-spacing: 2px;
}

select, input, button { font: inherit; color: var(--text); border-radius: 3px; }

input:not([type]), input[type="text"] {
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 10px 12px;
  font-size: var(--fs-12, 12px);
  color: var(--text);
}
input:not([type]):focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-dk);
}
input::placeholder { color: var(--muted); }

.toolbar input:not([type]), .toolbar input[type="text"] {
  flex: 1;
  min-width: 220px;
}

#versionSelect {
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  padding: 7px 10px;
  min-width: 200px;
  font-size: var(--fs-12, 12px);
}
#versionSelect:focus { outline: none; border-color: var(--accent-dk); }

button {
  cursor: pointer;
  padding: 8px 15px;
  font-size: var(--fs-12, 12px);
  background: linear-gradient(180deg, var(--btn2-grad), var(--btn2-bg));
  border: 3px solid;
  border-top-color: var(--btn2-hi);
  border-left-color: var(--btn2-hi);
  border-bottom-color: var(--btn2-lo);
  border-right-color: var(--btn2-lo);
  color: #fff;
  text-shadow: var(--tsh);
  transition: filter 0.15s;
}
button:hover:not(:disabled) { filter: brightness(1.2); }
button:active:not(:disabled) {
  border-top-color: var(--btn2-lo);
  border-left-color: var(--btn2-lo);
  border-bottom-color: var(--btn2-hi);
  border-right-color: var(--btn2-hi);
}
button:disabled { opacity: 0.45; cursor: default; }

button.primary, #prepareBtn {
  background: linear-gradient(180deg, var(--btn-grad), var(--btn-bg));
  border-top-color: var(--btn-hi);
  border-left-color: var(--btn-hi);
  border-bottom-color: var(--btn-lo);
  border-right-color: var(--btn-lo);
}
button.primary:active:not(:disabled), #prepareBtn:active:not(:disabled) {
  border-top-color: var(--btn-lo);
  border-left-color: var(--btn-lo);
  border-bottom-color: var(--btn-hi);
  border-right-color: var(--btn-hi);
}

.vstatus { font-size: var(--fs-11, 11px); color: var(--text-sec); }
.vstatus.ok { color: var(--green); text-shadow: var(--tsh); }
.vstatus.busy { color: var(--gold); text-shadow: var(--tsh); }

.progress {
  height: 26px;
  background: rgba(0, 0, 0, 0.55);
  border-bottom: 2px solid var(--panel-border);
  position: relative;
  display: flex;
  align-items: center;
}
.progress .bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: repeating-linear-gradient(90deg, var(--green-dk) 0 10px, #00c400 10px 20px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.35);
  transition: width 0.3s;
}
.progress .ptext {
  position: relative;
  padding-left: 14px;
  font-size: var(--fs-11, 11px);
  color: #fff;
  text-shadow: var(--tsh);
}

main { padding: 30px 22px; max-width: 1080px; margin: 0 auto; width: 100%; flex: 1; }
.view[hidden] { display: none; }

.hero { text-align: center; margin: 22px 0 36px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: calc(26px * var(--fs-scale, 1));
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
}
.hero p {
  margin: 0;
  color: var(--accent);
  font-size: var(--fs-11, 11px);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: var(--tsh);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
@media (max-width: 640px) {
  .tool-grid { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; gap: 10px 12px; }
  .nav-links { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
  main { padding: 24px 14px; }
}
@media (max-width: 720px) {
  .settings-wrap { position: static; }
  .settings-pop { left: 12px; right: 12px; width: auto; max-width: none; }
}
.tool-card {
  text-align: left;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  background: var(--panel);
  border: 2px solid;
  border-top-color: var(--panel-hi);
  border-left-color: var(--panel-hi);
  border-bottom-color: var(--panel-lo);
  border-right-color: var(--panel-lo);
  border-radius: 3px;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 20px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  font-family: var(--mc);
}
.tool-card:hover {
  border-color: var(--accent-dk);
  box-shadow: 0 0 0 1px var(--accent-dk), 0 4px 14px rgba(0, 0, 0, 0.4);
  filter: brightness(1.1);
}
.tc-icon {
  font-size: calc(30px * var(--fs-scale, 1));
  flex: none;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
}
.tc-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tc-icon img { image-rendering: pixelated; display: block; }
.tc-title {
  font-size: calc(14px * var(--fs-scale, 1));
  font-weight: 700;
  color: var(--accent);
  text-shadow: var(--tsh);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tc-desc { color: var(--text-sec); font-size: var(--fs-12, 12px); line-height: 1.6; }

.tool-card.tc-featured {
  grid-column: 1 / -1;
  border-color: var(--accent-dk);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.11), rgba(var(--accent-rgb), 0.02)),
    var(--panel);
  box-shadow: 0 0 0 1px var(--accent-dk), 0 0 26px rgba(var(--accent-rgb), 0.18), 0 4px 14px rgba(0, 0, 0, 0.3);
}
.tool-card.tc-featured:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 34px rgba(var(--accent-rgb), 0.30), 0 4px 16px rgba(0, 0, 0, 0.4);
  filter: brightness(1.06);
}
.tool-card.tc-featured .tc-icon {
  border-color: var(--accent-dk);
  background: rgba(var(--accent-rgb), 0.12);
  width: 64px;
  height: 64px;
}
.tool-card.tc-featured .tc-title { font-size: calc(16px * var(--fs-scale, 1)); }
.tc-badge {
  display: inline-block;
  font-size: var(--fs-9, 9px);
  vertical-align: 2px;
  margin-left: 9px;
  padding: 2px 9px;
  border-radius: 10px;
  background: var(--accent);
  color: #1a1206;
  letter-spacing: 1px;
  text-shadow: none;
}

.tc-links {
  width: 100%;
  margin: 0;
}
.tc-links .tc-icon { width: 64px; height: 64px; }
.tc-links .tc-title { font-size: calc(16px * var(--fs-scale, 1)); }
.tool-sep {
  height: 2px;
  margin: 22px 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--input-brd) 12%, var(--input-brd) 88%, transparent);
}

/* ---- about ---- */
.about-wrap { max-width: 680px; margin: 0 auto; }
.about-title {
  margin: 10px 0 22px;
  font-size: calc(22px * var(--fs-scale, 1));
  text-align: center;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
}
.about-card {
  background: var(--panel);
  border: 2px solid;
  border-top-color: var(--panel-hi);
  border-left-color: var(--panel-hi);
  border-bottom-color: var(--panel-lo);
  border-right-color: var(--panel-lo);
  border-radius: 3px;
  backdrop-filter: blur(10px);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.about-card h3 {
  margin: 0 0 10px;
  font-size: var(--fs-11, 11px);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: var(--tsh);
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.25);
}
.about-card p, .about-card li {
  font-family: var(--mc);
  font-size: var(--fs-12, 12px);
  color: #d9d5c7;
  line-height: 1.65;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.about-card p { margin: 0; }
.about-card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.about-card a { color: var(--accent); text-decoration: none; }
.about-card a:hover { text-decoration: underline; }
.about-card code {
  font-family: var(--mono);
  background: var(--input-bg);
  padding: 1px 5px;
  border: 1px solid var(--input-brd);
  border-radius: 3px;
  font-size: var(--fs-125, 12.5px);
}
.about-legal {
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-10, 10px);
  margin: 22px 0 0;
}

/* ---- tool view ---- */
.tool-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tool-top h2 {
  margin: 0;
  font-size: calc(15px * var(--fs-scale, 1));
  font-weight: 700;
  text-shadow: var(--tsh);
  letter-spacing: 0.5px;
}
.tool-top .version-picker { margin-left: auto; }
.back { padding: 6px 12px; font-size: var(--fs-11, 11px); color: var(--text-sec); }
.back:hover:not(:disabled) { color: #fff; }
.tool-panel[hidden] { display: none; }

.needs-version {
  padding: 40px;
  text-align: center;
  color: var(--text-sec);
  font-size: var(--fs-12, 12px);
  background: var(--panel);
  border: 2px dashed var(--input-brd);
  border-radius: 3px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
#searchInput {
  flex: 1;
  min-width: 220px;
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  padding: 10px 12px;
  font-size: var(--fs-12, 12px);
}
#searchInput:focus { outline: none; border-color: var(--accent-dk); }
#searchInput::placeholder { color: var(--muted); }

.segmented { display: flex; border: 2px solid var(--input-brd); border-radius: 3px; overflow: hidden; }
.segmented button {
  border: none;
  background: var(--input-bg);
  color: var(--text-sec);
  font-size: var(--fs-11, 11px);
  padding: 8px 13px;
}
.segmented button + button { border-left: 2px solid var(--input-brd); }
.segmented button.active { background: var(--btn-bg); color: #fff; }
.segmented button:active:not(:disabled) { border-color: var(--input-brd); }

.results-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px 12px;
  flex-wrap: wrap;
}
.sort-box { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.type-box { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#searchResultsHead .sort-box { margin-left: 0; }
.type-box select {
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 5px 8px;
  font-size: var(--fs-11, 11px);
}
.seg-sm button { font-size: var(--fs-10, 10px); padding: 6px 10px; }
.sort-arrow {
  width: 12px;
  height: 8px;
  margin-left: 7px;
  vertical-align: 1px;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.6));
}
.chk { display: flex; align-items: center; gap: 6px; color: var(--text-sec); font-size: var(--fs-11, 11px); }
.muted { color: var(--muted); font-size: var(--fs-11, 11px); }

.results { display: flex; flex-direction: column; gap: 8px; }

.result {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 2px solid;
  border-top-color: var(--panel-hi);
  border-left-color: var(--panel-hi);
  border-bottom-color: var(--panel-lo);
  border-right-color: var(--panel-lo);
  border-radius: 3px;
}
.result:hover { border-color: var(--accent-dk); }
.rmain { min-width: 0; }
.rpath { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ppath { font-family: var(--mono); font-size: var(--fs-12, 12px); word-break: break-all; }
.rmeta { color: var(--muted); font-size: var(--fs-11, 11px); white-space: nowrap; }

.dl {
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, var(--btn-grad), var(--btn-bg));
  border: 2px solid;
  border-top-color: var(--btn-hi);
  border-left-color: var(--btn-hi);
  border-bottom-color: var(--btn-lo);
  border-right-color: var(--btn-lo);
  border-radius: 3px;
  padding: 3px 10px;
  font-size: calc(14px * var(--fs-scale, 1));
  text-shadow: var(--tsh);
}
.dl:hover { filter: brightness(1.2); }

.result .pv { padding: 2px 8px; font-size: var(--fs-13, 13px); line-height: 1.5; }
.result .pv.active { border-color: var(--accent); }
.pv-box {
  background: var(--panel);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.pv-img {
  image-rendering: pixelated;
  background: repeating-conic-gradient(#3a3f55 0% 25%, #2a2f45 0% 50%) 0 0 / 16px 16px;
  border: 1px solid var(--input-brd);
  max-width: 100%;
}
.pv-audio { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 480px; }
.pa-btn { padding: 6px 11px; }
.pa-ico { width: 12px; height: 14px; display: block; }
.pa-track {
  flex: 1;
  height: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.pa-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--accent-dk) 0 8px, var(--accent) 8px 16px);
}
.pa-time { font-size: var(--fs-11, 11px); color: var(--text-sec); white-space: nowrap; }

.pv-pre {
  margin: 0;
  width: 100%;
  max-height: 320px;
  overflow: auto;
  font-family: var(--mono);
  font-size: var(--fs-115, 11.5px);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--input-brd);
  border-radius: 3px;
  padding: 8px 10px;
  white-space: pre;
}

.badge {
  font-size: var(--fs-9, 9px);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--input-brd);
  color: var(--text-sec);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.badge.b-name { color: var(--aqua); border-color: #1d4a5a; }
.badge.b-content { color: var(--green); border-color: #1d5a2a; }
.badge.b-both { color: var(--gold); border-color: #5a481d; }

.snippet {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--input-brd);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: var(--fs-115, 11.5px);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  color: var(--text-sec);
}
.snippet mark { background: rgba(85, 255, 85, 0.22); color: #b8ffb8; padding: 0 1px; border-radius: 2px; }

.loading, .empty, .error { padding: 24px; text-align: center; color: var(--text-sec); font-size: var(--fs-12, 12px); }
.error { color: var(--red); text-shadow: var(--tsh); }

.dropzone {
  border: 2px dashed var(--input-brd);
  border-radius: 3px;
  background: var(--panel);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  font-size: var(--fs-12, 12px);
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(52, 42, 14, 0.88);
}
.dz-icon { font-size: calc(32px * var(--fs-scale, 1)); }
.dropzone code {
  font-family: var(--mono);
  background: var(--input-bg);
  padding: 1px 6px;
  border: 1px solid var(--input-brd);
  border-radius: 3px;
  color: var(--accent);
}

#soundResults { display: flex; flex-direction: column; gap: 8px; }
.sev {
  background: var(--panel);
  border: 1px solid var(--input-brd);
  border-radius: 3px;
  padding: 9px 12px;
}
.sev-head { display: flex; gap: 10px; align-items: center; }
.sev-ev { color: var(--accent); font-size: var(--fs-125, 12.5px); word-break: break-all; flex: 1; }
.sev-files { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.sf-row { display: flex; gap: 10px; align-items: center; font-size: var(--fs-115, 11.5px); color: var(--text-sec); }
.sf-row .fname2 { flex: 1; word-break: break-all; }
.sf-row .sf-play { padding: 1px 8px; font-size: var(--fs-10, 10px); border-width: 2px; }

.reg-group { margin: 0; }
.reg-grouphead { display: flex; justify-content: flex-end; margin: 0 0 6px; }
.reg-list {
  columns: 260px;
  column-gap: 26px;
  margin: 0;
  padding: 12px 8px;
  list-style: none;
  font-size: var(--fs-12, 12px);
  background: var(--panel);
  border: 1px solid var(--input-brd);
  border-radius: 3px;
}
.reg-list li {
  padding: 2px 6px;
  break-inside: avoid;
  overflow-wrap: anywhere;
  color: var(--text-sec);
}
.reg-list li.reg-item {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s, color 0.12s;
}
.reg-list li.reg-item:hover { background: rgba(var(--accent-rgb), 0.12); color: var(--text); }
.reg-list.reg-added li.reg-item:hover { background: rgba(85, 255, 85, 0.14); color: var(--green); }
.reg-list.reg-removed li.reg-item:hover { background: rgba(255, 85, 85, 0.12); color: var(--red); }
.reg-list li.reg-item.copied {
  color: #1a1206;
  background: var(--accent);
  font-weight: 700;
}
.reg-list.reg-added li { color: var(--green); }
.reg-list.reg-removed li { color: var(--red); }

.links-intro { color: var(--text-sec); font-size: var(--fs-12, 12px); margin: 0 0 18px; }
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}
.links-cat {
  background: var(--panel);
  border: 1px solid var(--input-brd);
  border-radius: 4px;
  padding: 14px 16px 6px;
}
.links-cat h3 {
  margin: 0 0 10px;
  font-size: var(--fs-11, 11px);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: var(--tsh);
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.25);
}
.links-list { list-style: none; margin: 0; padding: 0; }
.links-list li { margin: 0 0 12px; }
.links-list a {
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-13, 13px);
  text-decoration: none;
}
.links-list a:hover { text-decoration: underline; }
.links-list a::after { content: " ↗"; color: var(--muted); font-weight: 400; }
.lk-note { display: block; color: var(--text-sec); font-size: var(--fs-11, 11px); margin-top: 2px; }
.lk-note code { color: var(--aqua); }

.arch-drops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.dz-half { padding: 22px; }
.dz-file { color: var(--accent); font-size: var(--fs-11, 11px); margin-top: 6px; word-break: break-all; }
@media (max-width: 620px) {
  .arch-drops { grid-template-columns: 1fr; }
}

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.stat {
  flex: 1;
  min-width: 120px;
  background: var(--panel);
  border: 2px solid;
  border-top-color: var(--panel-hi);
  border-left-color: var(--panel-hi);
  border-bottom-color: var(--panel-lo);
  border-right-color: var(--panel-lo);
  border-radius: 3px;
  padding: 14px;
  text-align: center;
}
.stat .snum { font-size: calc(22px * var(--fs-scale, 1)); font-weight: 700; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); }
.stat .slabel {
  color: var(--text-sec);
  font-size: var(--fs-9, 9px);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.stat.warn .snum { color: var(--gold); }
.stat.ok .snum { color: var(--green); }

.report-block { margin: 24px 0; }
.report-block h3 {
  margin: 0 0 12px;
  font-size: var(--fs-11, 11px);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: var(--tsh);
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.25);
}
.report-block h3 .hint {
  color: var(--muted);
  font-weight: 400;
  font-size: var(--fs-10, 10px);
  text-transform: none;
  letter-spacing: 0.5px;
  text-shadow: none;
}
.hint { color: var(--muted); font-size: var(--fs-11, 11px); }

.flatlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; max-height: 340px; overflow: auto; }
.flatlist li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--input-brd);
  border-radius: 3px;
}
.flatlist .ppath { color: var(--gold); }

.tree-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
#treeFilter {
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 6px 10px;
  min-width: 220px;
  font-size: var(--fs-12, 12px);
}
#treeFilter:focus { outline: none; border-color: var(--accent-dk); }
.tree {
  background: var(--panel);
  border: 2px solid;
  border-top-color: var(--panel-hi);
  border-left-color: var(--panel-hi);
  border-bottom-color: var(--panel-lo);
  border-right-color: var(--panel-lo);
  border-radius: 3px;
  padding: 10px 14px;
  max-height: 520px;
  overflow: auto;
  font-family: var(--mono);
  font-size: var(--fs-12, 12px);
}
.tree ul { list-style: none; margin: 0; padding-left: 16px; }
.tree > ul { padding-left: 0; }
.tree summary { cursor: pointer; padding: 2px 0; user-select: none; }
.tree summary:hover { color: var(--accent); }
.tree .cnt { color: var(--muted); font-size: var(--fs-10, 10px); }
.tree li.file { padding: 2px 0; color: var(--text-sec); }
.tree li.file .leaf-name { min-width: 0; word-break: break-all; }
.tree li.file:has(.leaf-hist) { display: flex; align-items: center; gap: 10px; padding-right: 8px; }
.tree li.file:has(.leaf-hist):hover { background: rgba(255, 255, 255, 0.05); }
.leaf-hist {
  padding: 0 7px;
  font-size: var(--fs-11, 11px);
  line-height: 1.6;
  border-width: 2px;
  background: var(--input-bg);
  flex: none;
}
.leaf-hist:hover:not(:disabled) { border-color: var(--accent); filter: none; }
.leaf-dl { padding: 0 8px; font-size: calc(15px * var(--fs-scale, 1)); line-height: 1.4; flex: none; }
.hist-dl { margin-left: 8px; padding: 0 8px; font-size: calc(15px * var(--fs-scale, 1)); line-height: 1.4; }

/* ---- footer (mc-tools style) ---- */
.sitefooter {
  position: relative;
  margin-top: 56px;
  padding: 44px 22px 26px;
  background: linear-gradient(180deg,
    #123a63 0%, #0d2c4d 20%, #0a2238 48%, #061726 76%, #030d18 100%);
  border-top: none;
  overflow-x: clip;
}
.sitefooter::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 6' shape-rendering='crispEdges'%3E%3Cpath fill='%23123a63' d='M0 2h4v4H0zM4 0h4v6H4zM8 2h4v4H8zM12 1h4v5h-4z'/%3E%3Cpath fill='%23386a9c' d='M4 0h4v1H4zM12 1h4v1h-4zM0 2h4v1H0zM8 2h4v1H8z'/%3E%3C/svg%3E");
  background-size: 32px 12px;
  background-repeat: repeat-x;
  image-rendering: pixelated;
  animation: wave-shift 5s steps(16) infinite;
  pointer-events: none;
}
@keyframes wave-shift {
  to { background-position-x: 32px; }
}
.sf-inner { position: relative; z-index: 8; }

.floater {
  position: absolute;
  top: 0;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  image-rendering: pixelated;
  pointer-events: none;
  animation: float-bob 3.2s ease-in-out infinite alternate;
}
@keyframes float-bob {
  from { translate: 0 -58%; }
  to { translate: 0 -50%; }
}
.fbubble {
  position: absolute;
  z-index: 7;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), rgba(175, 210, 245, 0.55) 70%, rgba(140, 185, 230, 0.2));
  border: 1px solid rgba(220, 240, 255, 0.6);
  pointer-events: none;
  translate: 0 -50%;
}
.sf-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.sf-logo {
  font-family: var(--mc);
  font-size: calc(20px * var(--fs-scale, 1));
  font-weight: 700;
  color: var(--accent);
  text-shadow: 2px 2px 0 #000;
  letter-spacing: 1px;
}
.sf-social {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.sf-soc {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mc);
  font-size: var(--fs-12, 12px);
  color: #eae6f2;
  text-decoration: none;
  text-shadow: var(--tsh);
}
.sf-soc svg { width: 22px; height: 22px; flex: none; transition: transform 0.12s; }
.sf-soc:hover { color: var(--accent); }
.sf-soc:hover svg { transform: scale(1.13); }
.sf-tag {
  font-family: var(--mc);
  font-size: var(--fs-12, 12px);
  color: #d6d2c4;
  margin: 2px auto 0;
  line-height: 1.6;
  white-space: nowrap;
  text-shadow: var(--tsh);
}
@media (max-width: 560px) {
  .sf-tag { white-space: normal; }
}
.sf-copy {
  font-family: var(--mc);
  color: #b8b3a2;
  font-size: var(--fs-11, 11px);
  text-shadow: var(--tsh);
}
.sf-legal {
  font-family: var(--mc);
  color: #8f8a78;
  font-size: var(--fs-10, 10px);
  max-width: 620px;
  line-height: 1.7;
  text-shadow: var(--tsh);
}

/* ---- version diff tool ---- */
.version-picker[hidden] { display: none; }
.diff-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.diff-controls select {
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  padding: 7px 10px;
  font-size: var(--fs-12, 12px);
  min-width: 180px;
}
.drow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--input-brd);
  border-radius: 3px;
}
.drow .ppath { flex: 1; }
.drow button { padding: 3px 10px; font-size: var(--fs-10, 10px); border-width: 2px; }
.dlist { display: flex; flex-direction: column; gap: 5px; max-height: 380px; overflow: auto; }
.diffview {
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: var(--fs-115, 11.5px);
  line-height: 1.5;
  max-height: 480px;
  overflow: auto;
  white-space: pre;
}
.diffview .da { color: #7dff7d; }
.diffview .dd { color: #ff8585; }
.diffview .dh { color: var(--aqua); }
.hist-table { width: 100%; border-collapse: collapse; font-size: var(--fs-12, 12px); }
.hist-table th {
  text-align: left;
  font-size: var(--fs-9, 9px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-sec);
  padding: 6px 10px;
  border-bottom: 2px solid var(--input-brd);
}
.hist-table td { padding: 6px 10px; border-bottom: 1px solid var(--input-brd); }
.hist-table .mono { font-family: var(--mono); font-size: var(--fs-115, 11.5px); }
.st-badge {
  font-size: var(--fs-9, 9px);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--input-brd);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.st-first { color: var(--aqua); border-color: #1d4a5a; }
.st-changed { color: var(--gold); border-color: #5a481d; }
.st-same { color: var(--muted); }
.st-removed, .st-absent { color: var(--red); border-color: #5a2424; }
.st-readded { color: var(--green); border-color: #1d5a2a; }

/* ---- manifest generator ---- */
.mf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.mf-field label {
  display: block;
  font-size: var(--fs-10, 10px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-sec);
  margin-bottom: 5px;
}
.mf-field input, #mfApi, #mfUiVer {
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: var(--fs-12, 12px);
}
.mf-field input:focus, #mfApi:focus, #mfUiVer:focus { outline: none; border-color: var(--accent-dk); }
.mf-out { margin-bottom: 18px; }
.mf-out-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.mf-out-head .fname { font-family: var(--mono); font-size: var(--fs-12, 12px); color: var(--accent); }
.mf-out-head button { padding: 3px 10px; font-size: var(--fs-10, 10px); border-width: 2px; }
.mf-out pre {
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: var(--fs-115, 11.5px);
  overflow-x: auto;
}

/* ---- pack lint ---- */
.lint-sub { margin: 14px 0; }
.lint-sub h4 {
  margin: 0 0 8px;
  font-size: var(--fs-10, 10px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-sec);
}
.lint-sub .flatlist .ppath { color: var(--red); }
.lint-ok { color: var(--green); font-size: var(--fs-12, 12px); }

/* ---- shared new-tool bits ---- */
.badge.b-bad { color: var(--red); border-color: #5a1d1d; }

/* ---- molang playground ---- */
.ml-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
@media (max-width: 720px) { .ml-grid { grid-template-columns: 1fr; } }
.ml-label { display: block; font-size: var(--fs-11, 11px); color: var(--text-sec); margin: 4px 0 6px; }
.ml-label .hint { font-weight: 400; }
.ml-ta {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font-family: var(--mono);
  font-size: var(--fs-13, 13px);
  line-height: 1.5;
  color: var(--text);
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.ml-ta:focus { outline: none; border-color: var(--accent-dk); }
.ml-vars { font-size: var(--fs-12, 12px); color: var(--aqua); }
.ml-examples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ml-ex { font-size: var(--fs-11, 11px); padding: 4px 10px; }
.ml-result {
  font-family: var(--mono);
  font-size: calc(22px * var(--fs-scale, 1));
  font-weight: 700;
  word-break: break-all;
  min-height: 30px;
  padding: 14px 16px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--input-brd);
  color: var(--text-sec);
}
.ml-result.ok { color: var(--green); border-color: #1d5a2a; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); }
.ml-result.error { color: var(--red); border-color: #5a1d1d; font-size: var(--fs-13, 13px); font-weight: 400; line-height: 1.5; }
.ml-cheat {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--panel);
  border: 2px solid var(--input-brd);
  border-left: 3px solid var(--accent-dk);
  border-radius: 3px;
  font-size: var(--fs-11, 11px);
  line-height: 1.7;
  color: var(--text-sec);
}
.ml-cheat h4 { margin: 0 0 8px; font-size: var(--fs-10, 10px); text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-sec); }
.ml-cheat p { margin: 0 0 7px; }
.ml-cheat strong { color: var(--text); }
.ml-cheat code { color: var(--accent); font-size: var(--fs-105, 10.5px); }
.ml-cheat a { color: var(--accent); }

/* ---- zip download progress ---- */
button.zipping { position: relative; overflow: hidden; }
button.zipping::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: var(--zp, 0%);
  background: rgba(var(--accent-rgb), 0.32);
  transition: width 0.15s linear;
  pointer-events: none;
}
button.zipping.indet::after {
  width: 35%;
  animation: zip-indet 1.05s ease-in-out infinite;
}
@keyframes zip-indet {
  0% { left: -35%; }
  100% { left: 100%; }
}

/* ---- whole-pack download ---- */
.pack-dl {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 4px 6px;
}
.pack-dl-btn {
  text-decoration: none;
  font-size: var(--fs-11, 11px);
  color: var(--accent);
  background: var(--btn2-bg);
  border: 2px solid;
  border-top-color: var(--btn2-hi);
  border-left-color: var(--btn2-hi);
  border-bottom-color: var(--btn2-lo);
  border-right-color: var(--btn2-lo);
  border-radius: 3px;
  padding: 4px 10px;
  cursor: pointer;
}
.pack-dl-btn::before { content: "\2193  "; }
.pack-dl-ext::before { content: "\2197  "; }
.pack-dl-btn:hover { filter: brightness(1.2); }
.pack-dl-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
  color: var(--muted);
}

/* ---- pack merger ---- */
.pm-help {
  margin: 14px 0 4px;
  padding: 12px 16px;
  background: var(--panel);
  border: 2px solid var(--input-brd);
  border-left: 3px solid var(--accent-dk);
  border-radius: 3px;
  font-size: var(--fs-12, 12px);
  line-height: 1.6;
  color: var(--text-sec);
}
.pm-help p { margin: 0 0 6px; }
.pm-help p:last-child { margin: 8px 0 0; }
.pm-help ul { margin: 6px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.pm-help strong { color: var(--text); }
.pm-help code { color: var(--accent); }
.pm-help-key {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--input-brd);
  border-radius: 3px;
  background: var(--btn2-bg);
  color: var(--accent);
  font-size: var(--fs-11, 11px);
}
.pm-list { max-height: none; margin: 8px 0; }
.pm-item { display: flex; align-items: center; gap: 10px; }
.pm-ord {
  width: 20px;
  height: 20px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-11, 11px);
  color: #1a1206;
  background: var(--accent);
  border-radius: 3px;
}
.pm-item .ppath { flex: 1; color: var(--gold); }
.pm-move { display: flex; gap: 4px; margin-left: auto; }
.pm-btn {
  padding: 2px 8px;
  font-size: var(--fs-12, 12px);
  line-height: 1.4;
}
.pm-btn.pm-x { color: var(--red); }

/* ---- what's new ---- */
.wn-head h2 { margin: 6px 0 2px; font-size: calc(18px * var(--fs-scale, 1)); }
.wn-head .muted { font-size: var(--fs-13, 13px); }
.wn-row { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; }
.wn-tag {
  flex: none;
  font-size: var(--fs-9, 9px);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--input-brd);
  color: var(--text-sec);
  margin-top: 2px;
}
.wn-tag.ok { color: var(--green); border-color: #1d5a2a; }
.wn-ids { display: flex; flex-wrap: wrap; gap: 5px; }
.wn-id {
  font-family: var(--mono);
  font-size: var(--fs-11, 11px);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--input-brd);
  background: rgba(0, 0, 0, 0.35);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.wn-id.wn-add { color: var(--green); border-color: #1d5a2a; }
.wn-id.wn-rem { color: var(--red); border-color: #5a1d1d; text-decoration: line-through; }
.wn-id.wn-add { cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s; }
.wn-id.wn-add:hover { background: rgba(85, 255, 85, 0.14); border-color: var(--green); }
.wn-id.wn-add.copied {
  color: #1a1206;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
.wn-link { color: var(--accent); }
.wn-copy {
  flex: none;
  font-size: var(--fs-10, 10px);
  padding: 3px 9px;
  margin-top: 1px;
  color: var(--text-sec);
  background: var(--btn2-bg);
  border: 2px solid;
  border-top-color: var(--btn2-hi);
  border-left-color: var(--btn2-hi);
  border-bottom-color: var(--btn2-lo);
  border-right-color: var(--btn2-lo);
  border-radius: 3px;
  cursor: pointer;
}
.wn-copy:hover { filter: brightness(1.2); }
.wn-copy.ok { color: var(--green); }
.wn-copy-all { margin-top: 8px; font-size: var(--fs-11, 11px); color: var(--accent); }

/* ---- geometry viewer ---- */
.geo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 8px;
}
.geo-sel {
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: var(--fs-11, 11px);
  color: var(--text);
}
.geo-name { font-family: var(--mono); font-size: var(--fs-12, 12px); color: var(--gold); }
.geo-tex { display: inline-flex; cursor: pointer; }
.geo-tex-add {
  font-size: var(--fs-10, 10px);
  padding: 6px 10px;
  border: 2px solid;
  border-top-color: var(--btn2-hi);
  border-left-color: var(--btn2-hi);
  border-bottom-color: var(--btn2-lo);
  border-right-color: var(--btn2-lo);
  background: var(--btn2-bg);
  border-radius: 3px;
  color: var(--accent);
}
.geo-tex-add:hover { filter: brightness(1.2); }
.geo-tex-name { font-size: var(--fs-11, 11px); color: var(--text-sec); display: inline-flex; align-items: center; gap: 6px; }
.geo-tex-x {
  padding: 1px 6px;
  font-size: var(--fs-11, 11px);
  color: var(--red);
  line-height: 1.3;
}
.geo-info { margin-left: auto; }
.geo-stage {
  width: 100%;
  height: 340px;
  background:
    radial-gradient(120% 120% at 50% 20%, rgba(41, 54, 92, 0.55), rgba(7, 9, 20, 0.9));
  border: 1px solid var(--input-brd);
  border-radius: 3px;
  overflow: hidden;
}
.geo-stage canvas { display: block; }
.gv-box { width: 100%; box-sizing: border-box; }
.geo-note {
  margin: 14px 0 4px;
  padding: 11px 15px;
  background: var(--panel);
  border: 2px solid var(--input-brd);
  border-left: 3px solid var(--accent-dk);
  border-radius: 3px;
  font-size: var(--fs-12, 12px);
  line-height: 1.6;
  color: var(--text-sec);
}
.geo-note strong { color: var(--text); }
.geo-note code { color: var(--accent); }
.geo-note a { color: var(--accent); }

@media (max-width: 620px) {
  .result { grid-template-columns: auto 1fr; }
  .rmeta, .dl, .result .pv { grid-column: 2; justify-self: start; }
  .sf-social { gap: 16px; }
  .sf-soc span { display: none; }
  .sf-soc svg { width: 26px; height: 26px; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  background: var(--panel);
  border: 2px solid var(--red);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mc);
  font-size: var(--fs-12, 12px);
  padding: 10px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Script API docs ---- */
/* This tool is documentation-dense, so its content uses readable fonts
   (not the site's pixel font) while keeping the site's colours & chrome. */
#panel-scriptapi {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Helvetica, Arial, sans-serif;
  --code: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, "SF Mono", Menlo, monospace;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
#panel-scriptapi button, #panel-scriptapi select, #panel-scriptapi input { text-shadow: none; }

.sapi-top {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sapi-pick { display: flex; flex-direction: column; gap: 4px; }
.sapi-pick label {
  color: var(--text-sec);
  font-size: var(--fs-10, 10px);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: var(--mc);
}
.sapi-top select {
  background: var(--input-bg);
  border: 2px solid var(--input-brd);
  padding: 8px 10px;
  min-width: 210px;
  font-size: var(--fs-13, 13px);
  font-family: var(--code);
}
.sapi-top select:focus { outline: none; border-color: var(--accent-dk); }
.sapi-top #sapiNpm { margin-bottom: 3px; font-family: var(--mc); }

/* --- global search (TypeDoc-style jump box) ------------------------------- */
.sapi-search { display: flex; flex-direction: column; gap: 4px; flex: 1 1 300px; min-width: 200px; }
.sapi-search label {
  color: var(--text-sec); font-size: var(--fs-10, 10px); text-transform: uppercase;
  letter-spacing: 2px; font-family: var(--mc);
}
.sapi-sbox { position: relative; }
/* selector carries two classes so it outranks the base input[type=text] rule
   (which would otherwise force padding 10px / --fs-12 / inherited line-height);
   metrics mirror .sapi-top select so both controls are the same height */
.sapi-search .sapi-sinput {
  width: 100%; box-sizing: border-box;
  background: var(--input-bg); border: 2px solid var(--input-brd);
  padding: 9px 10px; font-size: var(--fs-13, 13px); line-height: normal;
  font-family: var(--code); color: var(--text);
}
.sapi-search .sapi-sinput:focus { outline: none; border-color: var(--accent-dk); }
.sapi-sresults {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0;
  max-height: min(62vh, 480px); overflow-y: auto;
  background: var(--panel); border: 2px solid var(--input-brd); border-radius: 4px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5); padding: 4px;
}
.sapi-shint {
  padding: 7px 8px 5px; font-size: var(--fs-10, 10px); text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted); font-family: var(--mc);
}
.sapi-sr {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: none; border: none; padding: 6px 8px; border-radius: 3px;
  color: var(--text-sec); font-family: var(--code); font-size: var(--fs-13, 13px);
  line-height: 1.3; cursor: pointer; text-shadow: none;
}
.sapi-sr:hover { filter: none; background: rgba(255, 255, 255, 0.06); color: var(--text); }
.sapi-sr.active { background: rgba(var(--accent-rgb), 0.16); color: var(--accent); }
.sapi-srname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sapi-srowner { color: var(--muted); }
.sapi-sr.active .sapi-srowner { color: var(--accent); opacity: 0.85; }
.sapi-srname b { color: var(--text); font-weight: 700; font-style: normal; }
.sapi-sr.active .sapi-srname b { color: #fff; }
.sapi-srkind {
  flex: 0 0 auto; font-size: var(--fs-10, 10px); text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); font-family: var(--mc);
}
.sapi-srbadge {
  flex: 0 0 17px; width: 17px; height: 17px; display: grid; place-items: center;
  border-radius: 3px; font-size: 10px; line-height: 1; font-weight: 700;
  font-family: var(--sans); color: #0a0e22;
}
.sapi-srbadge.k-class { background: var(--gold); }
.sapi-srbadge.k-interface { background: var(--aqua); }
.sapi-srbadge.k-enum { background: var(--green); }
.sapi-srbadge.k-type { background: #c08bff; }
.sapi-srbadge.k-function { background: #ff9d6b; }
.sapi-srbadge.k-constant { background: var(--red); color: #fff; }
.sapi-srbadge.k-method { background: #ff9d6b; }
.sapi-srbadge.k-property { background: var(--aqua); }
.sapi-srbadge.k-enum_member { background: var(--green); }
.sapi-srbadge.k-constructor { background: #c08bff; }
.sapi-srbadge.k-index { background: var(--muted); color: #0a0e22; }
.sapi-sempty { padding: 12px 10px; color: var(--muted); font-size: var(--fs-13, 13px); }

/* The doc tools are content-dense: let them use the full screen width instead
   of main's 1080px reading column. */
html[data-tool="scriptapi"] main,
html[data-tool="scriptapidiff"] main { max-width: none; }

.sapi-layout {
  display: grid;
  grid-template-columns: var(--sapi-side-w, 370px) 16px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}
.sapi-resizer {
  position: relative;
  align-self: stretch;
  min-height: 320px;
  cursor: col-resize;
  touch-action: none;
}
.sapi-resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--input-brd);
  border-radius: 2px;
  transition: background 0.12s, width 0.12s;
}
.sapi-resizer:hover::before,
.sapi-resizer.dragging::before {
  width: 4px;
  background: var(--accent-dk);
}
.sapi-side {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 120px);
}
.sapi-filter { width: 100%; font-family: var(--code); font-size: var(--fs-13, 13px); }
.sapi-list {
  overflow-y: auto;
  border: 2px solid var(--input-brd);
  background: var(--input-bg);
  border-radius: 4px;
  padding: 5px;
}
.sapi-group {
  font-size: var(--fs-10, 10px);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  padding: 12px 6px 5px;
  font-family: var(--mc);
}
.sapi-group span { color: var(--text-sec); }
.sapi-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 5px 7px;
  font-size: var(--fs-13, 13px);
  font-family: var(--code);
  background: none;
  border: none;
  color: var(--text-sec);
  border-radius: 3px;
  line-height: 1.35;
}
.sapi-item:hover:not(:disabled) { filter: none; background: rgba(255, 255, 255, 0.06); color: var(--text); }
.sapi-item.active { background: rgba(var(--accent-rgb), 0.16); color: var(--accent); }
.sapi-iname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sapi-kbadge {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  font-family: var(--sans);
  color: #0a0e22;
}
.sapi-kbadge.k-class { background: var(--gold); }
.sapi-kbadge.k-interface { background: var(--aqua); }
.sapi-kbadge.k-enum { background: var(--green); }
.sapi-kbadge.k-type { background: #c08bff; }
.sapi-kbadge.k-function { background: #ff9d6b; }
.sapi-kbadge.k-constant { background: var(--red); color: #fff; }

.sapi-detail {
  border: 2px solid var(--input-brd);
  background: var(--panel);
  border-radius: 4px;
  padding: 20px 24px;
  min-height: 320px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  font-size: var(--fs-135, 13.5px);
  line-height: 1.65;
  color: var(--text);
}
.sapi-empty { color: var(--muted); font-size: var(--fs-13, 13px); padding: 22px 6px; }
.sapi-empty.sm { padding: 10px 6px; }

.sapi-dhead { border-bottom: 2px solid var(--panel-border); padding-bottom: 12px; margin-bottom: 14px; }
.sapi-dtitle { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.sapi-dtitle h3 { margin: 0; font-size: calc(22px * var(--fs-scale, 1)); font-weight: 700; color: #fff; font-family: var(--sans); letter-spacing: 0.2px; }
.sapi-kind {
  font-size: var(--fs-10, 10px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 3px;
  color: #0a0e22;
  background: var(--gold);
}
.sapi-kind.kind-interface { background: var(--aqua); }
.sapi-kind.kind-enum { background: var(--green); }
.sapi-kind.kind-type { background: #c08bff; }
.sapi-kind.kind-function { background: #ff9d6b; }
.sapi-kind.kind-constant { background: var(--red); color: #fff; }

.sapi-hier, .sapi-impl { margin-top: 9px; font-family: var(--code); font-size: var(--fs-125, 12.5px); color: var(--text-sec); }
.hc-link {
  background: none; border: none; padding: 0; text-shadow: none;
  color: var(--aqua); font-family: var(--code); font-size: var(--fs-125, 12.5px); cursor: pointer;
}
.hc-link:hover { filter: none; text-decoration: underline; }
.hc-cur { color: var(--text); font-weight: 700; }
.hc-ext { color: var(--muted); }
.hc-sep { color: var(--muted); margin: 0 7px; }
.sapi-impl { color: var(--muted); }

.sapi-ddoc { color: var(--text-sec); line-height: 1.7; margin-bottom: 4px; }
.sapi-ddoc p { margin: 0 0 9px; }

/* index / summary block */
.sapi-index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin: 16px 0 6px;
  padding: 14px 16px;
  background: var(--panel-inset);
  border: 1px solid var(--input-brd);
  border-radius: 4px;
}
.sapi-ihead {
  font-size: var(--fs-10, 10px); text-transform: uppercase; letter-spacing: 2px;
  color: var(--accent); margin-bottom: 8px; font-family: var(--mc);
}
.sapi-igrid { display: flex; flex-direction: column; gap: 2px; }
.sapi-ichip {
  display: flex; align-items: center; gap: 7px;
  background: none; border: none; padding: 3px 5px; text-align: left;
  color: var(--text-sec); font-family: var(--code); font-size: var(--fs-125, 12.5px);
  border-radius: 3px; cursor: pointer; text-shadow: none;
}
.sapi-ichip:hover { filter: none; background: rgba(255, 255, 255, 0.06); color: var(--text); }
.sapi-ichip-inh { color: var(--muted); margin-left: auto; font-size: var(--fs-11, 11px); }
.sapi-mini {
  flex: 0 0 16px; width: 16px; height: 16px; display: grid; place-items: center;
  border-radius: 3px; font-size: 9.5px; line-height: 1; font-weight: 700; font-family: var(--sans); color: #0a0e22;
}
.sapi-mini.k-P { background: var(--aqua); }
.sapi-mini.k-M { background: #ff9d6b; }

@media (max-width: 900px) { .sapi-index { grid-template-columns: 1fr; } }

.sapi-section { margin-top: 22px; }
.sapi-shead {
  font-size: var(--fs-11, 11px);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 6px;
  margin-bottom: 10px;
  font-family: var(--mc);
}
.sapi-shead span { color: var(--muted); }

.sapi-member {
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.012);
  scroll-margin-top: 8px;
}
.sapi-member.hit { border-color: var(--accent-dk); background: rgba(var(--accent-rgb), 0.07); }
.sapi-member.sel { border-color: var(--accent-dk); background: rgba(var(--accent-rgb), 0.11); }
.sapi-member.flash { animation: sapiFlash 1.1s ease; }
@keyframes sapiFlash {
  0%, 30% { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
  100% { border-color: var(--panel-border); box-shadow: none; }
}
.sapi-mrow { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sapi-mname { font-size: calc(15px * var(--fs-scale, 1)); font-weight: 700; color: #fff; font-family: var(--sans); }
.sapi-eqval { font-family: var(--code); color: var(--text-sec); font-size: var(--fs-13, 13px); }
.sapi-eqval code { color: var(--green); }

.sapi-badge {
  font-size: var(--fs-95, 9.5px);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--btn2-bg);
  color: var(--text-sec);
  font-family: var(--sans);
}
.sapi-badge.b-static { background: #22344f; color: var(--aqua); }
.sapi-badge.b-read { background: #24331f; color: var(--green); }
.sapi-badge.b-opt { background: #3a3320; color: var(--gold); }
.sapi-badge.b-acc { background: #2b2144; color: #c08bff; }
.sapi-badge.b-priv { background: #3a2626; color: var(--red); }

.sapi-inh {
  margin-left: auto; background: none; border: none; padding: 0; text-shadow: none;
  color: var(--muted); font-size: var(--fs-115, 11.5px); font-family: var(--sans); cursor: pointer;
}
.sapi-inh:hover { filter: none; color: var(--aqua); text-decoration: underline; }

.sapi-sigbox {
  margin: 9px 0 0;
  padding: 10px 13px;
  background: var(--panel-inset);
  border: 1px solid var(--input-brd);
  border-radius: 4px;
  font-family: var(--code);
  font-size: var(--fs-13, 13px);
  line-height: 1.5;
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
}
.sig-name { color: #fff; font-weight: 700; }
.sig-rest { color: var(--aqua); }
.sapi-tlink { color: var(--aqua); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.sapi-tlink:hover { color: var(--accent); text-decoration-style: solid; }

.sapi-copy { display: inline-flex; gap: 5px; flex: 0 0 auto; }
.sapi-cbtn {
  font-size: var(--fs-11, 11px);
  padding: 3px 9px;
  background: var(--btn2-bg);
  border: 1px solid var(--btn2-lo);
  color: var(--text-sec);
  border-radius: 3px;
  font-family: var(--sans);
}
.sapi-cbtn:hover:not(:disabled) { filter: none; border-color: var(--accent-dk); color: var(--accent); }
.sapi-cbtn.q { color: var(--aqua); }

.sapi-mdoc { margin-top: 11px; color: var(--text-sec); line-height: 1.65; }
.sapi-mdoc p { margin: 0 0 8px; }
.sapi-desc p:last-child { margin-bottom: 0; }
.sapi-dlabel {
  font-size: var(--fs-10, 10px); text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-sec); font-weight: 700; font-family: var(--sans);
  margin: 12px 0 4px;
}
.sapi-mdoc .sapi-dlabel:first-child { margin-top: 0; }
.sapi-params { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.sapi-params li { padding-left: 2px; }
.sapi-params code { color: var(--accent); font-family: var(--code); font-size: var(--fs-125, 12.5px); }
.sapi-ret { color: var(--text-sec); }
.sapi-throws { color: var(--text-sec); }
.sapi-dep {
  display: inline-block;
  font-size: var(--fs-115, 11.5px);
  font-weight: 700;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 3px 9px;
  margin-bottom: 8px;
  font-family: var(--sans);
}
.sapi-example { margin-top: 10px; }
.sapi-example summary { cursor: pointer; color: var(--accent); font-size: var(--fs-12, 12px); font-family: var(--sans); }
.sapi-code {
  margin: 8px 0 0;
  padding: 12px 14px;
  background: var(--panel-inset);
  border: 1px solid var(--input-brd);
  border-radius: 4px;
  font-family: var(--code);
  font-size: var(--fs-125, 12.5px);
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

@media (max-width: 720px) {
  .sapi-layout { grid-template-columns: 1fr; }
  .sapi-resizer { display: none; }
  .sapi-side { position: static; max-height: 320px; }
  .sapi-detail { max-height: none; }
}

/* ---- Script API diff ---- */
.sapi-modeseg { align-self: flex-end; margin-bottom: 2px; }
.sapi-swap {
  align-self: flex-end; margin-bottom: 2px; padding: 8px 12px;
  font-family: var(--sans); font-size: calc(15px * var(--fs-scale, 1)); line-height: 1;
}
.sapi-diffreport {
  border: 2px solid var(--input-brd);
  background: var(--panel);
  border-radius: 4px;
  padding: 20px 22px;
  min-height: 320px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  font-size: var(--fs-135, 13.5px);
  line-height: 1.6;
  color: var(--text);
}
.sapi-diffhead {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  border-bottom: 2px solid var(--panel-border); padding-bottom: 12px; margin-bottom: 14px;
}
.sdh-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sdh-mod { font-size: calc(15px * var(--fs-scale, 1)); font-weight: 700; color: #fff; }
.sdh-v {
  font-family: var(--code); font-size: var(--fs-13, 13px); padding: 3px 9px; border-radius: 3px;
  background: var(--panel-inset); border: 1px solid var(--input-brd);
}
.sdh-v.old { color: var(--red); }
.sdh-v.new { color: var(--green); }
.sdh-arrow { color: var(--muted); }
.sapi-diffstats { display: flex; gap: 8px; flex-wrap: wrap; }
.ds { font-family: var(--code); font-size: var(--fs-12, 12px); padding: 3px 9px; border-radius: 3px; border: 1px solid; }
.ds.add { color: var(--green); border-color: rgba(85, 255, 85, 0.4); background: rgba(85, 255, 85, 0.08); }
.ds.rem { color: var(--red); border-color: rgba(255, 85, 85, 0.4); background: rgba(255, 85, 85, 0.08); }
.ds.chg { color: var(--gold); border-color: rgba(255, 170, 0, 0.4); background: rgba(255, 170, 0, 0.08); }

.sapi-dsec { margin-top: 20px; }
.sapi-dsec-head {
  font-size: var(--fs-11, 11px); text-transform: uppercase; letter-spacing: 2px; font-family: var(--mc);
  border-bottom: 1px solid var(--panel-border); padding-bottom: 6px; margin-bottom: 11px;
}
.sapi-dsec-head span { color: var(--muted); }
.sapi-dsec-head.add { color: var(--green); }
.sapi-dsec-head.rem { color: var(--red); }
.sapi-dsec-head.chg { color: var(--gold); }

.sapi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sapi-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 3px; cursor: pointer;
  font-family: var(--code); font-size: var(--fs-125, 12.5px); text-shadow: none;
  background: var(--panel-inset); border: 1px solid var(--input-brd); color: var(--text-sec);
}
.sapi-chip:hover:not(:disabled) { filter: none; color: var(--text); border-color: var(--accent-dk); }
.sapi-chip.add { border-color: rgba(85, 255, 85, 0.35); }
.sapi-chip.rem { border-color: rgba(255, 85, 85, 0.35); }

.sapi-dchanges { display: flex; flex-direction: column; gap: 7px; }
.sapi-dcard {
  border: 1px solid var(--panel-border); border-radius: 4px;
  background: rgba(255, 255, 255, 0.012); overflow: hidden;
}
.sapi-dcard > summary {
  display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 10px 13px; list-style: none;
}
.sapi-dcard > summary::-webkit-details-marker { display: none; }
.sapi-dcard[open] > summary { border-bottom: 1px solid var(--panel-border); }
.dc-name { font-weight: 700; color: #fff; font-family: var(--sans); font-size: calc(14px * var(--fs-scale, 1)); }
.dc-counts { display: inline-flex; gap: 8px; font-family: var(--code); font-size: var(--fs-12, 12px); }
.dc-c.add { color: var(--green); }
.dc-c.rem { color: var(--red); }
.dc-c.chg { color: var(--gold); }
.dc-open { margin-left: auto; color: var(--aqua); cursor: pointer; font-size: calc(15px * var(--fs-scale, 1)); padding: 0 5px; }
.dc-open:hover { color: var(--accent); }
.dc-body { padding: 9px 13px 11px; display: flex; flex-direction: column; gap: 5px; }

.dmem {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-family: var(--code); font-size: var(--fs-125, 12.5px); line-height: 1.5;
}
.dm-sign { font-weight: 700; flex: 0 0 12px; }
.dmem.add { color: #b7f0b0; }
.dmem.add .dm-sign { color: var(--green); }
.dmem.rem { color: #f0b7b7; }
.dmem.rem .dm-sign { color: var(--red); }
.dmem.chg { color: var(--text-sec); }
.dmem.chg .dm-sign { color: var(--gold); }
.dmem code { font-family: var(--code); }
.dm-name { color: var(--text); }
.dm-fromto { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.dm-fromto span { color: var(--muted); }
code.old { color: var(--red); }
code.new { color: var(--green); }
.dmem .sapi-mini { flex: 0 0 16px; align-self: center; }
.sapi-mini.k-E { background: var(--green); }

@media (max-width: 720px) {
  .sapi-diffhead { flex-direction: column; align-items: flex-start; }
}

/* ---- Changelog ---- */
.sf-version { color: var(--accent); text-decoration: none; font-family: var(--mono); }
.sf-version:hover { text-decoration: underline; }

.cl-wrap { max-width: 780px; }
.cl-intro { color: var(--text-sec); font-size: var(--fs-13, 13px); line-height: 1.7; margin: 0 0 18px; }
.cl-intro strong { color: var(--text); }
.cl-list { display: flex; flex-direction: column; gap: 14px; }
.cl-entry {
  background: var(--panel);
  border: 2px solid var(--input-brd);
  border-left: 3px solid var(--accent-dk);
  border-radius: 3px;
  padding: 14px 18px;
}
.cl-head {
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 8px; margin-bottom: 10px;
}
.cl-ver { font-family: var(--mono); font-size: calc(15px * var(--fs-scale, 1)); font-weight: 700; color: var(--accent); text-shadow: var(--tsh); }
.cl-date { font-size: var(--fs-11, 11px); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.cl-changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.cl-changes li { display: flex; gap: 10px; align-items: baseline; color: var(--text-sec); font-size: var(--fs-13, 13px); line-height: 1.6; }
.cl-tag {
  flex: 0 0 auto;
  font-size: var(--fs-9, 9px); text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
  padding: 2px 7px; border-radius: 2px; color: #0a0e22; margin-top: 2px;
}
.cl-tag.t-added { background: var(--green); }
.cl-tag.t-changed { background: var(--gold); }
.cl-tag.t-fixed { background: var(--aqua); }

/* ---- font setting (html[data-font], default = pixel) ---- */
html[data-font="system"] {
  --mc: var(--sans);
  --mono: var(--code);
}
html[data-font="system"] body {
  -webkit-font-smoothing: antialiased;
}
/* Font size scale, multiplied by --fs-scale (1-2 from Settings); System uses the same sizes. */
:root {
  --fs-9: calc(12px * var(--fs-scale, 1));
  --fs-95: calc(12.5px * var(--fs-scale, 1));
  --fs-10: calc(13px * var(--fs-scale, 1));
  --fs-105: calc(13.5px * var(--fs-scale, 1));
  --fs-11: calc(14px * var(--fs-scale, 1));
  --fs-115: calc(14.5px * var(--fs-scale, 1));
  --fs-12: calc(15px * var(--fs-scale, 1));
  --fs-125: calc(15.5px * var(--fs-scale, 1));
  --fs-13: calc(16px * var(--fs-scale, 1));
  --fs-135: calc(16.5px * var(--fs-scale, 1));
}

/* ---- Simple design (flat, stirante-like palette; html[data-theme], default = owls) ---- */
html[data-theme="simple"] {
  --sky-a: #2b2e33;
  --sky-b: #2b2e33;
  --sky-c: #2b2e33;
  --panel: #1e2024;
  --panel-border: #40444b;
  --panel-hi: #40444b;
  --panel-lo: #40444b;
  --panel-inset: #17181c;
  --input-bg: #2b2e33;
  --input-brd: #4a4f57;
  --text: #f5f5f5;
  --text-sec: #c2c7ce;
  --muted: #9096a2;
  --accent: #8ac4ff;
  --accent-dk: #6fa9e0;
  --accent-rgb: 138, 196, 255;
  --green: #6bcf7f;
  --green-dk: #2ea043;
  --gold: #e3b341;
  --red: #f85149;
  --aqua: #79c0ff;
  --btn-bg: #3d6d99;
  --btn-hi: #3d6d99;
  --btn-lo: #3d6d99;
  --btn-grad: #3d6d99;
  --btn2-bg: #3a4048;
  --btn2-hi: #3a4048;
  --btn2-lo: #3a4048;
  --btn2-grad: #3a4048;
  --tsh: none;
}
html[data-theme="simple"] * { text-shadow: none !important; }
html[data-theme="simple"] .star-canvas,
html[data-theme="simple"] .owls,
html[data-theme="simple"] .floater,
html[data-theme="simple"] .fbubble,
html[data-theme="simple"] .owl-giant,
html[data-theme="simple"] .proj-shard,
html[data-theme="simple"] .debris,
html[data-theme="simple"] .sitefooter::before { display: none !important; }
html[data-theme="simple"] body { background: #2b2e33; }
html[data-theme="simple"] .topbar { background: #1e2024; backdrop-filter: none; }
html[data-theme="simple"] .sitefooter { background: #1e2024; border-top: 2px solid var(--panel-border); }
html[data-theme="simple"] .pv-img { background: repeating-conic-gradient(#33373d 0% 25%, #282c31 0% 50%) 0 0 / 16px 16px; }
html[data-theme="simple"] .geo-stage { background: #24272c; }
html[data-theme="simple"] .dropzone:hover,
html[data-theme="simple"] .dropzone.drag { background: rgba(var(--accent-rgb), 0.08); }
