/* mango.onl — /editor Roblox tools: API badge, UDim2 picker, templates and
   the DataStore / HttpService sandbox. Same tokens as editor.css. */

.ed-st-btn {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.ed-st-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }

/* Every UDim2 the picker understands gets a dotted underline: the cue that
   it can be clicked. */
.ed-udim2 {
  text-decoration: underline dotted rgba(255, 158, 87, 0.55);
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- UDim2 popover ---------- */

.ed-udim {
  position: fixed;
  z-index: 70;
  width: 330px;
  padding: 0.7rem;
  border: 1px solid var(--rim);
  border-radius: 12px;
  background: var(--pane);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.95);
  font-size: 0.74rem;
  color: var(--muted);
}

.ed-udim-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.ed-udim-head b { color: var(--skin); font-family: var(--mono); font-weight: 500; }

.ed-udim-mode {
  display: inline-flex;
  border: 1px solid var(--rim);
  border-radius: 7px;
  overflow: hidden;
}

.ed-udim-mode button,
.ed-udim-foot button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  padding: 0.22rem 0.5rem;
  cursor: pointer;
}

.ed-udim-mode button.is-on { background: rgba(255, 158, 87, 0.15); color: var(--skin); }

.ed-udim-screen {
  margin-left: auto;
  font: inherit;
  font-size: 0.68rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--rim);
  border-radius: 6px;
  padding: 0.18rem 0.3rem;
}

.ed-udim-stage {
  padding: 0.5rem;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.35);
}

.ed-udim-grid {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 25% 25%;
}

.ed-udim-box {
  position: absolute;
  border: 1px dashed rgba(255, 158, 87, 0.6);
  background: rgba(255, 158, 87, 0.1);
  pointer-events: none;
}

.ed-udim-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--skin);
  box-shadow: 0 0 0 4px rgba(255, 158, 87, 0.25);
  pointer-events: none;
}

.ed-udim-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.ed-udim-fields label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.64rem; color: var(--dim); }

.ed-udim-fields input {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.25rem 0.3rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--rim);
  border-radius: 6px;
}

.ed-udim-fields input:focus { outline: none; border-color: rgba(255, 158, 87, 0.5); }

.ed-udim-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.ed-udim-foot button { border: 1px solid var(--rim); border-radius: 6px; font-size: 0.68rem; }
.ed-udim-foot button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.ed-udim-hint { margin-left: auto; font-size: 0.62rem; color: var(--dim); }

/* ---------- wide modals ---------- */

.ed-modal-wide {
  width: min(1100px, calc(100vw - 2rem));
  height: min(760px, calc(100vh - 2rem));
  max-height: none;
  max-width: none;
}

.ed-modal-wide[open] { display: flex; flex-direction: column; }

/* ---------- templates ---------- */

.ed-tpl { display: flex; flex: 1; min-height: 0; }

.ed-tpl-side {
  width: 290px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  border-right: 1px solid var(--rim);
  min-height: 0;
}

.ed-tpl-head { display: flex; align-items: center; justify-content: space-between; }
.ed-tpl-head .ed-modal-title { margin: 0; }

.ed-tpl-cats { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.ed-tpl-cat {
  border: 1px solid var(--rim);
  background: none;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.ed-tpl-cat:hover { color: var(--text); }
.ed-tpl-cat.is-on { color: var(--skin); border-color: rgba(255, 158, 87, 0.45); background: rgba(255, 158, 87, 0.1); }

.ed-tpl-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }

.ed-tpl-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.ed-tpl-item b { font-weight: 500; font-size: 0.82rem; color: var(--text); }
.ed-tpl-item small { font-family: var(--mono); font-size: 0.64rem; color: var(--dim); }
.ed-tpl-item:hover { background: rgba(255, 255, 255, 0.04); }
.ed-tpl-item.is-on { background: rgba(255, 158, 87, 0.09); border-left-color: var(--skin); }

.ed-tpl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 1rem 1.1rem; }

.ed-tpl-info { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.ed-tpl-info h3 { margin: 0; font-family: var(--display); font-size: 1.15rem; }
.ed-tpl-info p { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--muted); }

.ed-tpl-where {
  flex: none;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--leaf);
  border: 1px solid rgba(143, 170, 100, 0.35);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.ed-tpl-code {
  flex: 1;
  min-height: 0;
  overflow: auto;
  margin: 0.8rem 0 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--rim);
  border-radius: 10px;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
}

/* ---------- sandbox ---------- */

.ed-sandbox { color: var(--text); }

.sb-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rim);
  flex: none;
}

.sb-head .ed-modal-title { margin: 0; }
.sb-note { margin-left: auto; font-size: 0.7rem; color: var(--dim); }

.sb-tabs { display: flex; gap: 0.2rem; }

.sb-tabs button {
  border: 0;
  background: none;
  color: var(--dim);
  font-family: var(--body);
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}

.sb-tabs button:hover { color: var(--text); }
.sb-tabs button.is-on { color: var(--skin); background: rgba(255, 158, 87, 0.1); }

.sb-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.8rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.8rem;
}

.sb-body button {
  font-family: var(--body);
  font-size: 0.74rem;
  padding: 0.32rem 0.6rem;
  border-radius: 7px;
  border: 1px solid var(--rim);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.sb-body button:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.sb-body button.sb-go { color: var(--skin); border-color: rgba(255, 158, 87, 0.4); background: rgba(255, 158, 87, 0.12); }
.sb-body button.sb-danger:hover { color: #e8a294; border-color: rgba(224, 139, 122, 0.4); }

.sb-input,
.sb-settings input[type="number"],
.sb-retry input {
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.32rem 0.45rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--rim);
  border-radius: 7px;
  min-width: 0;
}

.sb-input:focus,
.sb-settings input:focus,
.sb-retry input:focus { outline: none; border-color: rgba(255, 158, 87, 0.5); }

.sb-settings input[type="number"] { width: 5.2rem; }

.sb-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rim);
  border-radius: 10px;
  color: var(--dim);
  font-size: 0.74rem;
}

.sb-settings label,
.sb-check { display: inline-flex; align-items: center; gap: 0.35rem; }
.sb-check input { accent-color: var(--skin); }
.sb-budgets { margin-left: auto; font-family: var(--mono); font-size: 0.68rem; color: var(--leaf); }

.sb-cols {
  display: grid;
  grid-template-columns: 220px 240px 1fr;
  gap: 0.7rem;
  min-height: 300px;
  flex: 1;
}

.sb-col {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  min-height: 0;
  padding: 0.6rem;
  border: 1px solid var(--rim);
  border-radius: 10px;
}

.sb-col > header,
.sb-logwrap > header,
.sb-http header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}

.sb-col > header small,
.sb-http header small { text-transform: none; letter-spacing: 0; }
.sb-col > header code { text-transform: none; letter-spacing: 0; color: var(--skin); font-size: 0.8rem; }
.sb-actions { margin-left: auto; display: inline-flex; gap: 0.3rem; text-transform: none; letter-spacing: 0; }

.sb-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }

.sb-list li {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.45rem;
  border-radius: 7px;
  cursor: pointer;
  min-width: 0;
}

.sb-list li span,
.sb-list li small {
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-list li span { font-size: 0.76rem; color: var(--text); }
.sb-list li small { font-size: 0.64rem; color: var(--dim); }
.sb-list li:hover { background: rgba(255, 255, 255, 0.04); }
.sb-list li.is-on { background: rgba(255, 158, 87, 0.1); }
.sb-list li.sb-empty,
.sb-empty { cursor: default; color: var(--dim); font-size: 0.74rem; padding: 0.4rem; }
.sb-wide { width: 100%; }

.sb-detail { gap: 0.5rem; }
.sb-value { flex: 1; min-height: 120px; resize: none; line-height: 1.5; }
.sb-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
.sb-ops,
.sb-row { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.sb-inc { display: inline-flex; gap: 0.2rem; }

.sb-inc input {
  width: 3.6rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  padding: 0.25rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--rim);
  border-radius: 7px;
}

.sb-result { margin: 0; min-height: 1.2em; font-family: var(--mono); font-size: 0.72rem; overflow-wrap: anywhere; }
.sb-result.is-ok { color: var(--leaf); }
.sb-result.is-err { color: #e8a294; }

.sb-versions summary { cursor: pointer; font-size: 0.72rem; color: var(--dim); }
.sb-versions ul { list-style: none; margin: 0.3rem 0 0; padding: 0; max-height: 110px; overflow-y: auto; font-size: 0.68rem; }
.sb-versions li { display: flex; gap: 0.5rem; padding: 0.15rem 0; color: var(--muted); white-space: nowrap; overflow: hidden; }
.sb-versions code { color: var(--skin); }

.sb-logwrap { display: flex; flex-direction: column; gap: 0.35rem; flex: none; }

.sb-log {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0.6rem;
  height: 130px;
  overflow-y: auto;
  border: 1px solid var(--rim);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.sb-log li { display: flex; gap: 0.6rem; padding: 0.08rem 0; white-space: nowrap; overflow: hidden; }
.sb-log time { color: #584f47; }
.sb-log b { font-weight: 500; }
.sb-log li.is-ok b { color: var(--leaf); }
.sb-log li.is-err b,
.sb-log li.is-err em { color: #e8a294; }
.sb-log span { color: var(--muted); }
.sb-log em { font-style: normal; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }

/* retry lab */

.sb-lede { margin: 0; color: var(--muted); font-size: 0.82rem; max-width: 70ch; }
.sb-retry { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.sb-retry fieldset {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.45rem;
  border: 1px solid var(--rim);
  border-radius: 10px;
  padding: 0.6rem 0.7rem 0.7rem;
}

.sb-retry legend { padding: 0 0.3rem; font-size: 0.66rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.sb-retry label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.7rem; color: var(--dim); }

.sb-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; }
.sb-stats > div { border: 1px solid var(--rim); border-radius: 10px; padding: 0.5rem 0.6rem; display: flex; flex-direction: column; }
.sb-stats b { font-family: var(--display); font-size: 1.2rem; }
.sb-stats b.is-ok { color: var(--leaf); }
.sb-stats b.is-err { color: #e8a294; }
.sb-stats span { font-size: 0.68rem; color: var(--dim); }

.sb-warn { margin: 0; color: var(--flesh); font-size: 0.8rem; }
.sb-okline { margin: 0; color: var(--leaf); font-size: 0.8rem; }

.sb-timeline { border: 1px solid var(--rim); border-radius: 10px; padding: 0.5rem 0.7rem; max-height: 280px; overflow-y: auto; }
.sb-tl-row { display: flex; align-items: center; gap: 0.5rem; height: 14px; }
.sb-tl-row > span { width: 2.6rem; flex: none; font-family: var(--mono); font-size: 0.6rem; color: #584f47; }
.sb-tl-track { position: relative; flex: 1; height: 100%; }
.sb-tl-span { position: absolute; top: 6px; height: 2px; background: rgba(143, 170, 100, 0.35); }
.sb-tl-span.is-err { background: rgba(224, 139, 122, 0.4); }
.sb-tl-dot { position: absolute; top: 3px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; }
.sb-tl-axis { display: flex; justify-content: space-between; margin: 0.3rem 0 0 3.1rem; font-family: var(--mono); font-size: 0.6rem; color: var(--dim); }

.sb-tl-dot.is-ok,
.sb-legend .is-ok { background: var(--leaf); }
.sb-tl-dot.is-err,
.sb-legend .is-err { background: #e08b7a; }
.sb-tl-dot.is-throttle,
.sb-legend .is-throttle { background: var(--flesh); }

.sb-legend { margin: 0; display: flex; gap: 0.4rem 0.9rem; align-items: center; font-size: 0.7rem; color: var(--dim); }
.sb-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: -0.5rem; }

/* http */

.sb-http { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem; }

.sb-http section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem;
  border: 1px solid var(--rim);
  border-radius: 10px;
  min-width: 0;
}

.sb-http textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.sb-wide-sec { grid-column: 1 / -1; }
.sb-row .sb-input { flex: 1; }
#sb-req-method { flex: none; width: 6rem; }

.sb-out {
  margin: 0;
  min-height: 2.5em;
  max-height: 200px;
  overflow: auto;
  padding: 0.45rem 0.55rem;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--leaf);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sb-out.is-err { color: #e8a294; }
.sb-out:empty { display: none; }

.sb-mocks { width: 100%; border-collapse: collapse; }
.sb-mocks th { text-align: left; font-weight: 400; font-size: 0.64rem; color: var(--dim); padding: 0 0.3rem 0.3rem 0; }
.sb-mocks td { padding: 0 0.3rem 0.3rem 0; }
.sb-mocks td .sb-input { width: 100%; }
.sb-mocks td:nth-child(1) { width: 5.5rem; }
.sb-mocks td:nth-child(3) { width: 5rem; }
.sb-mocks td:last-child { width: 2rem; }

@media (max-width: 900px) {
  .sb-cols,
  .sb-http,
  .sb-retry { grid-template-columns: 1fr; }
  .sb-stats { grid-template-columns: repeat(3, 1fr); }
  .ed-tpl { flex-direction: column; }
  .ed-tpl-side { width: auto; max-height: 45%; border-right: 0; border-bottom: 1px solid var(--rim); }
}

/* ---------- breadcrumbs ---------- */

/* Standalone Monaco has no breadcrumbs bar; this one sits between the
   notice and the editor and follows the cursor. */
.ed-crumbs {
  display: flex;
  align-items: center;
  flex: none;
  height: 24px;
  padding: 0 0.55rem;
  border-bottom: 1px solid var(--rim);
  background: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--dim);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
}
.ed-crumbs::-webkit-scrollbar { display: none; }

.ed-crumb {
  flex: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
button.ed-crumb { cursor: pointer; color: var(--muted); }
button.ed-crumb:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.ed-crumb.is-file { color: var(--text); }
.ed-crumb.k-function, .ed-crumb.k-method { color: #e9c98d; }
.ed-crumb.k-callback { color: var(--leaf); }
.ed-crumb.k-object, .ed-crumb.k-type { color: #6fa8a0; }
.ed-crumb-sep { flex: none; color: #4a4038; padding: 0 0.05rem; }

/* ---------- sidebar: Rojo game tree ---------- */

.ed-side-views {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--rim);
}
.ed-side-views button {
  flex: 1;
  border: 1px solid var(--rim);
  background: none;
  color: var(--dim);
  font-family: var(--body);
  font-size: 0.7rem;
  padding: 0.2rem 0;
  border-radius: 6px;
  cursor: pointer;
}
.ed-side-views button:hover { color: var(--text); }
.ed-side-views button.is-on {
  color: var(--text);
  border-color: rgba(255, 158, 87, 0.4);
  background: rgba(255, 158, 87, 0.08);
}

.ed-files.is-tree .ed-file { gap: 0.3rem; padding-top: 0.24rem; padding-bottom: 0.24rem; }
.ed-twist {
  flex: none;
  width: 0.75rem;
  color: var(--dim);
  font-size: 0.62rem;
  text-align: center;
  cursor: pointer;
}
.ed-twist:hover { color: var(--text); }

.ed-cls {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
}
.ed-cls.is-server { background: rgba(232, 131, 77, 0.18); color: #e8834d; }
.ed-cls.is-client { background: rgba(111, 168, 160, 0.18); color: #6fa8a0; }
.ed-cls.is-module { background: rgba(243, 197, 102, 0.16); color: var(--flesh); }
.ed-cls.is-folder {
  width: 0.8rem;
  height: 0.62rem;
  margin: 0 0.1rem;
  border: 1.5px solid #6b5e52;
  border-radius: 2px;
}
.ed-cls.is-service { color: var(--leaf); font-size: 0.66rem; }
.ed-cls.is-other { color: var(--dim); }

.ed-tree-head {
  padding: 0.7rem 0.75rem 0.25rem;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- symbol search across open files ---------- */

.ed-goto {
  width: min(640px, calc(100vw - 2rem));
  margin-top: 12vh;
}
.ed-goto-in {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem;
  max-height: 70vh;
}
.ed-goto-status { margin: 0 0.2rem; min-height: 1em; font-size: 0.68rem; color: var(--dim); }
.ed-goto-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.ed-goto-item {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.36rem 0.5rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
}
.ed-goto-item:hover { background: rgba(255, 255, 255, 0.04); }
.ed-goto-item.is-on { background: rgba(255, 158, 87, 0.1); }
.ed-goto-kind {
  flex: none;
  width: 1.2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
}
.ed-goto-kind.k-function, .ed-goto-kind.k-method { color: #e9c98d; }
.ed-goto-kind.k-callback { color: var(--leaf); }
.ed-goto-kind.k-object, .ed-goto-kind.k-type { color: #6fa8a0; }
.ed-goto-name {
  font-family: var(--mono);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ed-goto-where {
  margin-left: auto;
  min-width: 0;
  font-size: 0.68rem;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- menubar ---------- */

.ed-menubar { display: flex; align-items: center; gap: 0.05rem; margin-left: 0.8rem; }
.ed-mb {
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
}
.ed-mb:hover, .ed-mb.is-on { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.ed-menubar + .ed-tools { margin-left: auto; }
.ed-tools + .ed-who { margin-left: 0.6rem; }
.ed-btn-cmd span { font-size: 0.85em; opacity: 0.8; }

/* ---------- file list: collapsible, icons, folders ---------- */

.ed.side-off .ed-side { display: none; }

.ed-side-head { gap: 0.15rem; }
.ed-side-title { flex: 1; min-width: 0; }
.ed-side-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--dim);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.ed-side-icon svg { width: 14px; height: 14px; }
.ed-side-icon:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

.ed-files .ed-file { gap: 0.3rem; }
.ed-folder { color: var(--muted); user-select: none; }
.ed-folder .ed-file-name { font-family: var(--body); }
.ed-folder-count { font-family: var(--mono); font-size: 0.64rem; color: var(--dim); }
.ed-file[draggable="true"] { cursor: grab; }
.ed-files .is-drop { background: rgba(255, 158, 87, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 158, 87, 0.4); }
.ed-files.is-drop { background: rgba(255, 158, 87, 0.05); }

/* ---------- UI preview ---------- */

.ed-gui { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 0.6rem; }
.ed-gui-expand { margin-left: auto; font-size: 1rem; }
.ed-gui code { font-family: var(--mono); font-size: 0.9em; }

.gp-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rim);
  border-radius: 6px;
  /* A neutral "game world" so dark and light UI both read. */
  background: repeating-conic-gradient(#2b3440 0% 25%, #28303b 0% 50%) 0 0 / 40px 40px;
}
.gp-screen { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.gp-topbar { position: absolute; left: 0; right: 0; top: 0; background: rgba(0, 0, 0, 0.25); }
.gp-layer { position: absolute; }
.gp-el { position: absolute; box-sizing: border-box; cursor: pointer; }
.gp-el:hover { outline: 2px solid #ff9e57; outline-offset: 1px; }
.gp-el.is-hidden { opacity: 0.35; outline: 1px dashed rgba(255, 255, 255, 0.5); }
.gp-content { position: absolute; }
.gp-text {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  line-height: 1.1;
  pointer-events: none;
}
.gp-text.is-placeholder { opacity: 0.55; }
.gp-img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 28px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 8px, transparent 8px 16px);
  pointer-events: none;
}
.gp-scrollbar { position: absolute; top: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.35); pointer-events: none; }

.gp-tree { list-style: none; margin: 0.6rem 0 0; padding: 0; font-size: 0.74rem; }
.gp-row { padding: 0.18rem 0.4rem; border-radius: 5px; cursor: pointer; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-row b { font-weight: 500; color: var(--text); }
.gp-row small { font-family: var(--mono); font-size: 0.66rem; color: var(--dim); }
.gp-row:hover { background: rgba(255, 255, 255, 0.05); }
.gp-row.is-off b { color: var(--dim); text-decoration: line-through; }
.gp-note { padding: 0.4rem; color: var(--dim); font-size: 0.7rem; line-height: 1.45; }

.ed-gui-big { width: min(1280px, calc(100vw - 2rem)); }
.ed-gui-big-head { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem 0.2rem; }
.ed-gui-big-head .ed-quota { flex: 1; }
.ed-help .ed-gui-big-head { padding: 0 0 0.6rem; }
.ed-gui-large { max-height: 80vh; padding: 0.6rem 1rem 1rem; }

/* ---------- DataStore check ---------- */

.ed-ds { flex: 1; min-height: 0; overflow: auto; padding: 0.7rem 0.8rem 1rem; font-size: 0.78rem; }
.ed-ds-intro { margin: 0 0 0.5rem; color: var(--muted); line-height: 1.45; }
.ed-ds-in { width: 100%; min-height: 110px; resize: vertical; font-family: var(--mono); font-size: 0.74rem; box-sizing: border-box; }
.ed-ds-row { display: flex; gap: 0.4rem; justify-content: flex-end; margin: 0.45rem 0 0.6rem; }
.ed-ds-out:empty { display: none; }
.ed-ds-meter { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin: 0.4rem 0; }
.ed-ds-meter span { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: var(--leaf); }
.ed-ds-meter.is-warn span { background: var(--flesh); }
.ed-ds-meter.is-bad span { background: #e08b7a; }
.ed-ds-size { margin: 0.2rem 0 0.4rem; color: var(--muted); line-height: 1.45; }
.ed-ds-size b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.ed-ds-bad { margin: 0.3rem 0; color: #e8a294; line-height: 1.45; }
.ed-ds-warn { margin: 0.3rem 0; color: var(--flesh); line-height: 1.45; }
.ed-ds-sub { margin: 0.6rem 0 0.2rem; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.ed-ds-parts { list-style: none; margin: 0; padding: 0; }
.ed-ds-parts li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.15rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.ed-ds-parts code { font-family: var(--mono); color: var(--text); }
.ed-ds-parts span { color: var(--dim); font-family: var(--mono); font-size: 0.7rem; }
.ed-ds-h { margin: 1rem 0 0.4rem; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.ed-ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.ed-ds-grid label { display: flex; flex-direction: column; gap: 0.2rem; color: var(--dim); font-size: 0.7rem; }
.ed-ds-grid .ed-input { width: 100%; box-sizing: border-box; }
.ed-ds-table { width: 100%; border-collapse: collapse; margin: 0.6rem 0 0.2rem; }
.ed-ds-table th { text-align: left; font-weight: 400; color: var(--muted); padding: 0.18rem 0; }
.ed-ds-table td { text-align: right; font-family: var(--mono); color: var(--text); font-size: 0.74rem; }

/* ---------- shortcuts ---------- */

.ed-help { width: min(560px, calc(100vw - 2rem)); }
.ed-keys { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 0.8rem; }
.ed-keys td { padding: 0.28rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); color: var(--muted); }
.ed-keys td:first-child { width: 42%; }
.ed-keys kbd { font-family: var(--mono); font-size: 0.72rem; color: var(--text); background: rgba(255, 255, 255, 0.06); padding: 0.1rem 0.35rem; border-radius: 4px; }
.ed-help a { color: var(--skin); }

/* ---------- in-page prompt / confirm (dialogs.js) ---------- */

.ed-ask { width: min(420px, calc(100vw - 2rem)); }
.ed-ask-text { margin: 0 0 0.8rem; font-size: 0.9rem; line-height: 1.5; color: var(--text); white-space: pre-line; }
.ed-ask-input { width: 100%; box-sizing: border-box; margin-bottom: 0.9rem; font-family: var(--mono); }
.ed-ask .ed-modal-foot { justify-content: flex-end; }
.ed-btn-danger { border-color: rgba(224, 139, 122, 0.45); background: rgba(224, 139, 122, 0.14); color: #e8a294; }
.ed-btn-danger:hover:not(:disabled) { background: rgba(224, 139, 122, 0.24); color: #f0b3a6; }
