/* workbench · tree + viewer + download dropdown */

.dl-drop {
  position: relative;
  display: inline-block;
  margin: 0 6px 8px 0;
  vertical-align: middle;
}
.dl-drop-btn {
  appearance: none;
  border: 1px solid rgba(0, 255, 163, 0.45);
  background: linear-gradient(145deg, #0c2018, #121216);
  color: #00ffa3;
  font: 700 12px system-ui;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(0, 255, 163, 0.12);
}
.dl-drop-btn:hover {
  border-color: #00ffa3;
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.22);
}
.dl-drop-btn .caret {
  font-size: 10px;
  opacity: 0.8;
}
.dl-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  z-index: 50;
  background: #0e0e12;
  border: 1px solid #2c2c36;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  padding: 6px;
  overflow: hidden;
}
.dl-drop-menu.open {
  display: block;
}
.dl-drop-menu .grp {
  font: 800 9px system-ui;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00d4ff;
  padding: 8px 10px 4px;
}
.dl-drop-menu a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #ececf1;
  text-decoration: none;
  border: 1px solid transparent;
}
.dl-drop-menu a:hover {
  background: rgba(0, 255, 163, 0.08);
  border-color: rgba(0, 255, 163, 0.25);
  color: #00ffa3;
}
.dl-drop-menu a b {
  font: 700 12px system-ui;
}
.dl-drop-menu a span {
  font: 11px ui-monospace, monospace;
  color: #5c5c6a;
}
.dl-drop-menu a.green {
  background: linear-gradient(145deg, #0c2018, #0a0c0b);
  border-color: rgba(0, 255, 163, 0.35);
  margin-bottom: 4px;
}
.dl-drop-menu hr {
  border: 0;
  border-top: 1px solid #2c2c36;
  margin: 4px 0;
}

.wb {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 0;
  min-height: 560px;
  border: 1px solid #2c2c36;
  border-radius: 12px;
  overflow: hidden;
  background: #070908;
  margin: 12px 0 24px;
  position: relative;
  z-index: 2;
}
@media (max-width: 860px) {
  .wb {
    grid-template-columns: 1fr;
    min-height: 420px;
  }
}
.wb-tree {
  border-right: 1px solid #2c2c36;
  background: #0e1012;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  min-height: 420px;
}
.wb-tree-h {
  font: 800 10px system-ui;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00ffa3;
  padding: 10px 12px;
  border-bottom: 1px solid #2c2c36;
  flex-shrink: 0;
}
.wb-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #2c2c36;
  max-height: 160px;
  overflow: auto;
  flex-shrink: 0;
}
.wb-thumb {
  border: 1px solid #2c2c36;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #0a0c0b;
  padding: 0;
  text-align: left;
  color: inherit;
  width: 100%;
}
.wb-thumb:hover,
.wb-thumb.on {
  border-color: rgba(0, 255, 163, 0.5);
}
.wb-thumb img {
  display: block;
  width: 100%;
  height: 56px;
  object-fit: cover;
  background: #000;
}
.wb-thumb span {
  display: block;
  font: 10px ui-monospace, monospace;
  padding: 4px 6px;
  color: #5c5c6a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wb-list,
.wb-sub {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow: auto;
  flex: 1;
  min-height: 120px;
}
.wb-sub {
  padding: 2px 0 2px 12px;
  flex: none;
  overflow: visible;
}
.wb-list button,
.wb-sub button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #ececf1;
  font: 12px ui-monospace, monospace;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.wb-list button:hover,
.wb-list button.on,
.wb-sub button:hover,
.wb-sub button.on {
  background: rgba(0, 255, 163, 0.1);
  color: #00ffa3;
}
.wb-list .ic {
  width: 1.2em;
  opacity: 0.8;
}
.wb-view {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 420px;
  background: #070908;
}
.wb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #2c2c36;
  background: #121216;
  flex-shrink: 0;
}
.wb-bar .name {
  font: 700 12px ui-monospace, monospace;
  color: #00ffa3;
}
.wb-bar .meta {
  font: 11px ui-monospace, monospace;
  color: #5c5c6a;
  flex: 1;
  word-break: break-all;
}
.wb-stage {
  flex: 1;
  overflow: auto;
  min-height: 360px;
}
.wb-stage .hl-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 100%;
}
.wb-stage .gutter {
  padding: 8px 0;
  text-align: right;
  color: #3a3a48;
  font: 12px/1.5 ui-monospace, monospace;
  user-select: none;
  border-right: 1px solid #1e1e28;
  background: #080a09;
}
.wb-stage .gutter span {
  display: block;
  padding: 0 10px 0 8px;
}
.wb-stage .code-pane {
  padding: 8px 12px;
  overflow: auto;
}
.wb-stage pre.hl,
.wb-stage pre.v-pre {
  margin: 0;
  white-space: pre;
  font: 12.5px/1.5 ui-monospace, monospace;
  color: #c8e0d4;
}
.wb-stage .prev-img {
  max-width: 100%;
  max-height: 60vh;
  display: block;
  margin: 16px auto;
  border-radius: 8px;
}
.wb-stage .prev-bin {
  padding: 32px;
  text-align: center;
  color: #8b8b9a;
}
.wb-empty {
  padding: 48px 16px;
  text-align: center;
  color: #5c5c6a;
}
.hero-shot {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  object-position: top left;
  border-radius: 12px;
  border: 1px solid #2c2c36;
  margin: 0 0 12px;
  display: block;
}
.lang-pill {
  font: 700 10px system-ui;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(196, 125, 255, 0.15);
  color: #c47dff;
  border: 1px solid rgba(196, 125, 255, 0.35);
}
