body:has(#tree-eyes-only) {
  overflow: hidden;
}

body:has(#tree-eyes-only) > footer {
  display: none;
}

main:has(#tree-eyes-only) {
  min-height: 100vh;
}

.treeeyesonly-page {
  --toe-bg: #0b1013;
  --toe-panel: #171d21;
  --toe-panel-soft: #1f272d;
  --toe-line: #33414a;
  --toe-text: #f3f0e8;
  --toe-muted: #aeb7bd;
  --toe-gold: #d7a947;
  --toe-teal: #49b8bb;
  --toe-red: #dd5d5d;
  --toe-green: #74b86f;
  --toe-blue: #6da2d8;
  --toe-purple: #b282c8;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(73, 184, 187, 0.12), transparent 24%),
    radial-gradient(circle at 82% 22%, rgba(215, 169, 71, 0.11), transparent 22%),
    var(--toe-bg);
  background-size: 38px 38px, 38px 38px, auto, auto, auto;
  color: var(--toe-text);
  font-family: "Ysabeau Office", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.toe-topbar,
.toe-panel,
.toe-sprite-dock,
.toe-help,
.toe-tooltip,
.toe-panel-tabs {
  border: 1px solid rgba(174, 183, 189, 0.2);
  background: rgba(23, 29, 33, 0.94);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.toe-topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  z-index: 8;
}

.toe-brand {
  min-width: 0;
}

.toe-kicker {
  color: var(--toe-gold);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.toe-brand h1,
.toe-panel h2,
.toe-sprite-dock h2,
.toe-panel h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.toe-brand h1 {
  font-size: 1.45rem;
  font-weight: 800;
}

.toe-topbar__stats {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--toe-muted);
  font-size: 0.95rem;
}

.toe-topbar__stats span {
  white-space: nowrap;
}

.toe-topbar__stats strong {
  color: var(--toe-text);
}

.toe-topbar__stats [data-tree-context] {
  max-width: min(34vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.toe-actions,
.toe-panel-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toe-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.treeeyesonly-page button,
.treeeyesonly-page select,
.toe-export {
  min-height: 34px;
  border: 1px solid rgba(215, 169, 71, 0.42);
  border-radius: 6px;
  background: #222a2f;
  color: var(--toe-text);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 8px 11px;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.treeeyesonly-page select {
  max-width: 190px;
}

.toe-copy-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-bottom: 1px solid rgba(174, 183, 189, 0.15);
  padding: 0 12px 12px;
}

.toe-copy-box select {
  grid-column: 1 / -1;
  max-width: none;
}

.treeeyesonly-page button:hover,
.treeeyesonly-page select:hover,
.toe-export:hover {
  border-color: rgba(215, 169, 71, 0.9);
  background: #2b343a;
}

.treeeyesonly-page button:disabled {
  cursor: default;
  opacity: 0.45;
}

.treeeyesonly-page button:disabled:hover {
  border-color: rgba(215, 169, 71, 0.42);
  background: #222a2f;
}

.treeeyesonly-page button:active,
.toe-export:active {
  transform: translateY(1px);
}

.treeeyesonly-page button.is-active {
  background: #3b3020;
  border-color: var(--toe-gold);
  color: #ffe4a3;
}

.toe-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.toe-board {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.035), transparent 46%),
    rgba(0, 0, 0, 0.22);
  cursor: grab;
}

.toe-board.is-dragging {
  cursor: grabbing;
}

.toe-board.is-sprite-dragging {
  cursor: copy;
}

.toe-board.is-swap-dragging {
  cursor: grabbing;
}

.toe-board.is-swap-dragging .toe-node {
  cursor: grabbing;
}

.toe-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

.toe-panel,
.toe-sprite-dock {
  position: absolute;
  z-index: 5;
  border-radius: 8px;
  overflow: hidden;
}

.toe-panel--left {
  top: 18px;
  left: 18px;
  width: 304px;
  max-height: calc(100% - 36px);
}

.toe-panel--right {
  top: 18px;
  right: 18px;
  width: 336px;
  max-height: calc(100% - 36px);
}

.treeeyesonly-page .toe-sprite-dock {
  left: 340px;
  right: 368px;
  bottom: 18px;
  height: 214px;
  max-height: 214px;
  display: flex;
  flex-direction: column;
  transition: height 160ms ease, max-height 160ms ease;
}

.treeeyesonly-page .toe-sprite-dock:hover,
.treeeyesonly-page .toe-sprite-dock:focus-within,
.treeeyesonly-page .toe-sprite-dock.is-expanded {
  height: min(44vh, 430px);
  max-height: calc(100% - 36px);
}

.toe-panel[hidden],
.toe-sprite-dock[hidden] {
  display: none;
}

.toe-panel__header,
.toe-panel__subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(174, 183, 189, 0.15);
  padding: 12px;
}

.toe-panel__header h2 {
  font-size: 1rem;
  font-weight: 800;
}

.toe-panel__subhead h3 {
  color: var(--toe-muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.toe-panel__header button,
.toe-panel__subhead button {
  min-height: 28px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.toe-field {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
}

.toe-field span {
  color: var(--toe-muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.toe-field input,
.toe-field textarea,
.toe-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(174, 183, 189, 0.2);
  border-radius: 6px;
  background: #0f1518;
  color: var(--toe-text);
  font: inherit;
  font-size: 0.96rem;
  line-height: 1.25;
  padding: 8px 9px;
}

.toe-field textarea {
  min-height: 96px;
  resize: vertical;
}

.toe-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  color: var(--toe-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.toe-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--toe-gold);
  flex: 0 0 auto;
}

.toe-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.toe-node-list,
.toe-edge-list {
  max-height: 308px;
  overflow: auto;
  padding: 6px;
}

.toe-edge-list {
  max-height: 150px;
}

.toe-node-row,
.toe-edge-row,
.toe-sprite-card {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--toe-text);
}

.toe-node-row {
  width: 100%;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  padding: 7px 8px;
  text-align: left;
}

.toe-node-row:hover,
.toe-node-row.is-selected,
.toe-edge-row:hover,
.toe-edge-row.is-selected {
  border-color: rgba(215, 169, 71, 0.45);
  background: rgba(215, 169, 71, 0.08);
}

.toe-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--toe-muted);
}

.toe-node-dot[data-category="range"] {
  background: var(--toe-green);
}

.toe-node-dot[data-category="melee"] {
  background: var(--toe-red);
}

.toe-node-dot[data-category="str"] {
  background: var(--toe-purple);
}

.toe-node-title {
  min-width: 0;
}

.toe-node-title strong,
.toe-node-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toe-node-title strong {
  font-size: 0.92rem;
}

.toe-node-title small {
  color: var(--toe-muted);
  font-size: 0.76rem;
}

.toe-pill {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--toe-muted);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 7px;
  text-transform: uppercase;
}

.toe-edge-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  padding: 7px 8px;
  text-align: left;
}

.toe-edge-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toe-edge-row button {
  min-height: 24px;
  padding: 4px 7px;
}

.toe-empty {
  color: var(--toe-muted);
  padding: 16px 12px;
}

.toe-inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px 14px;
}

.treeeyesonly-page .toe-sprite-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  align-content: start;
  gap: 8px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 12px 12px;
}

.treeeyesonly-page .toe-sprite-card {
  min-height: 66px;
  display: grid;
  grid-template-rows: 1fr;
  min-width: 0;
  place-items: center;
  gap: 5px;
  padding: 7px;
  text-align: center;
}

.treeeyesonly-page .toe-sprite-card:hover,
.treeeyesonly-page .toe-sprite-card.is-selected,
.treeeyesonly-page .toe-sprite-card.is-dragging {
  border-color: rgba(73, 184, 187, 0.55);
  background: rgba(73, 184, 187, 0.09);
}

.treeeyesonly-page .toe-sprite-card.is-dragging {
  opacity: 0.54;
}

.treeeyesonly-page .toe-sprite-preview {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  border: 1px solid rgba(174, 183, 189, 0.22);
  border-radius: 50%;
  background: #0e1417;
  color: var(--toe-gold);
  font-size: 0.72rem;
  font-weight: 900;
}

.treeeyesonly-page .toe-sprite-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.treeeyesonly-page .toe-sprite-card small {
  display: none;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--toe-muted);
  font-size: 0.72rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.treeeyesonly-page .toe-sprite-dock:hover .toe-sprite-card,
.treeeyesonly-page .toe-sprite-dock:focus-within .toe-sprite-card,
.treeeyesonly-page .toe-sprite-dock.is-expanded .toe-sprite-card {
  grid-template-rows: 42px minmax(30px, auto);
  min-height: 96px;
}

.treeeyesonly-page .toe-sprite-dock:hover .toe-sprite-card small,
.treeeyesonly-page .toe-sprite-dock:focus-within .toe-sprite-card small,
.treeeyesonly-page .toe-sprite-dock.is-expanded .toe-sprite-card small {
  display: block;
}

.toe-sprite-drag-ghost,
.toe-node-swap-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: 154px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(215, 169, 71, 0.65);
  border-radius: 8px;
  background: rgba(17, 23, 27, 0.96);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42);
  color: var(--toe-text);
  padding: 8px;
  pointer-events: none;
}

.toe-node-swap-ghost {
  width: 176px;
  grid-template-columns: 42px 1fr;
}

.toe-sprite-drag-ghost strong,
.toe-node-swap-ghost strong,
.toe-node-swap-ghost small {
  min-width: 0;
  overflow: hidden;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toe-sprite-drag-ghost strong,
.toe-node-swap-ghost strong {
  font-size: 0.76rem;
}

.toe-node-swap-ghost small {
  grid-column: 2;
  color: var(--toe-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.toe-help {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 4;
  display: flex;
  gap: 8px;
  max-width: min(620px, calc(100% - 40px));
  transform: translateX(-50%);
  border-radius: 999px;
  color: var(--toe-muted);
  font-size: 0.82rem;
  padding: 8px 12px;
}

.toe-help span {
  white-space: nowrap;
}

.toe-tooltip {
  position: fixed;
  z-index: 20;
  width: 260px;
  pointer-events: none;
  border-radius: 8px;
  padding: 10px;
}

.toe-tooltip h3 {
  margin: 0 0 3px;
  font-size: 0.98rem;
  line-height: 1.1;
}

.toe-tooltip p {
  margin: 8px 0 0;
  color: var(--toe-muted);
  font-size: 0.86rem;
  line-height: 1.25;
}

.toe-tooltip dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  margin: 8px 0 0;
  font-size: 0.78rem;
}

.toe-tooltip dt {
  color: var(--toe-muted);
  font-weight: 800;
}

.toe-tooltip dd {
  margin: 0;
}

.toe-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 9, 0.72);
  padding: 24px;
}

.toe-modal-backdrop[hidden] {
  display: none;
}

.toe-modal {
  width: min(430px, 100%);
  border: 1px solid rgba(215, 169, 71, 0.45);
  border-radius: 8px;
  background: rgba(23, 29, 33, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  padding: 18px;
}

.toe-modal h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.15;
}

.toe-modal p {
  margin: 10px 0 0;
  color: var(--toe-muted);
  line-height: 1.35;
}

.toe-modal-field {
  padding: 14px 0 0;
}

.toe-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.toe-panel-tabs {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  border-radius: 999px;
  padding: 7px;
}

.toe-node-shape {
  cursor: pointer;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.5));
}

.toe-node-label {
  fill: #f3f0e8;
  font-size: 13px;
  font-weight: 800;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(0, 0, 0, 0.9);
  stroke-width: 4px;
  text-anchor: middle;
}

.toe-node-graph-label {
  fill: #f3f0e8;
  font-size: 14px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(0, 0, 0, 0.86);
  stroke-width: 5px;
  text-anchor: middle;
}

.toe-edge-path {
  fill: none;
  stroke: rgba(83, 118, 135, 0.72);
  stroke-linecap: round;
  stroke-width: 4px;
}

.toe-edge-path.is-selected {
  stroke: var(--toe-gold);
  stroke-width: 7px;
}

.toe-edge-path.is-ghost {
  stroke-dasharray: 10 10;
}

.toe-grid-line {
  stroke: rgba(255, 255, 255, 0.045);
  stroke-width: 1;
}

.toe-node {
  cursor: pointer;
}

.toe-node-swap-ring {
  fill: none;
  pointer-events: none;
  stroke: #ffe08a;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  stroke-width: 3px;
}

.toe-node.is-swap-source .toe-node-image,
.toe-node.is-swap-source .toe-node-fallback {
  opacity: 0.48;
}

.toe-node.is-swap-target .toe-node-swap-ring {
  filter: drop-shadow(0 0 8px rgba(120, 255, 202, 0.7));
  stroke: #79ffca;
  stroke-width: 4px;
}

.toe-node-image,
.toe-node-outline,
.toe-node-fallback,
.toe-node-swap-ring {
  pointer-events: none;
}

@media (max-width: 1180px) {
  .toe-topbar {
    height: auto;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .toe-topbar__stats,
  .toe-actions {
    justify-content: start;
    flex-wrap: wrap;
  }

  .toe-panel--left,
  .toe-panel--right,
  .toe-sprite-dock {
    width: min(330px, calc(100% - 36px));
    left: 18px;
    right: auto;
  }

  .toe-panel--right {
    left: auto;
    right: 18px;
  }

  .treeeyesonly-page .toe-sprite-dock {
    right: 18px;
    width: auto;
    height: 214px;
    max-height: 214px;
  }

  .treeeyesonly-page .toe-sprite-dock:hover,
  .treeeyesonly-page .toe-sprite-dock:focus-within,
  .treeeyesonly-page .toe-sprite-dock.is-expanded {
    height: min(42vh, 380px);
    max-height: calc(100% - 36px);
  }
}
