/* mango.onl — /tools and the pages under it. Same tokens and cards as /rdd. */

.tl-shell {
  width: min(1180px, calc(100% - 2rem));
  padding-top: clamp(1.5rem, 5vh, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tl-shell [hidden] { display: none !important; }

/* ---------- header ---------- */

.tl-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; --d: 20ms; }
.tl-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.tl-slash { color: var(--dim); }
.tl-crumb { font-family: var(--mono); color: var(--muted); text-decoration: none; }
.tl-crumb:hover { color: var(--text); }
.tl-route { font-family: var(--mono); color: var(--skin); }
.tl-sub { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; max-width: 70ch; --d: 60ms; }

/* ---------- cards ---------- */

.tl-card {
  padding: 1.1rem 1.2rem;
  background: var(--pane);
  border: 1px solid var(--rim);
  border-radius: 14px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  min-width: 0;
  --d: 120ms;
}

.tl-eyebrow {
  margin: 0 0 0.8rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rim);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.tl-grid { display: grid; gap: 1rem; align-items: start; }
.tl-grid-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

/* ---------- hub ---------- */

.tl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.9rem; }
.tl-tile {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.2rem 1.2rem;
  background: var(--pane);
  border: 1px solid var(--rim);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 140ms ease, transform 140ms ease;
}
.tl-tile:hover { border-color: rgba(255, 158, 87, 0.45); transform: translateY(-2px); }
.tl-tile h2 { margin: 0; font-family: var(--display); font-size: 1.1rem; }
.tl-tile p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.tl-tile span { margin-top: auto; padding-top: 0.4rem; font-size: 0.8rem; color: var(--skin); }

/* ---------- inputs ---------- */

.tl-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rim);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
}
.tl-input:focus { outline: none; border-color: rgba(255, 158, 87, 0.5); }
textarea.tl-input { font-family: var(--mono); font-size: 0.8rem; resize: vertical; min-height: 5.5rem; line-height: 1.5; }
select.tl-input { width: auto; }

.tl-btn {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--rim);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.tl-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.tl-btn.is-on, .tl-btn-go { border-color: rgba(255, 158, 87, 0.4); background: rgba(255, 158, 87, 0.12); color: var(--skin); }

.tl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.tl-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.72rem; color: var(--dim); }
.tl-err { color: #e8a294; font-size: 0.82rem; margin: 0.4rem 0 0; }
.tl-note { color: var(--dim); font-size: 0.76rem; line-height: 1.5; margin: 0.6rem 0 0; }

/* Output blocks with a copy button. */
.tl-out { position: relative; }
.tl-out pre {
  margin: 0;
  padding: 0.6rem 2.8rem 0.6rem 0.7rem;
  border: 1px solid var(--rim);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}
.tl-copy {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--rim);
  border-radius: 6px;
  background: var(--pane);
  color: var(--dim);
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.tl-copy:hover { color: var(--text); }
.tl-label { margin: 0.8rem 0 0.3rem; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }

.tl-kv { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.tl-kv th { text-align: left; font-weight: 400; color: var(--muted); padding: 0.25rem 0.6rem 0.25rem 0; white-space: nowrap; vertical-align: top; }
.tl-kv td { font-family: var(--mono); font-size: 0.76rem; color: var(--text); padding: 0.25rem 0; word-break: break-word; }

.tl-sliders { display: grid; grid-template-columns: auto 1fr 4.5rem; gap: 0.3rem 0.6rem; align-items: center; font-size: 0.78rem; color: var(--muted); }
.tl-sliders input[type="range"] { width: 100%; accent-color: var(--skin); }
.tl-sliders input[type="number"] { width: 100%; box-sizing: border-box; padding: 0.2rem 0.35rem; border: 1px solid var(--rim); border-radius: 6px; background: rgba(0, 0, 0, 0.25); color: var(--text); font-family: var(--mono); font-size: 0.74rem; }

/* ---------- CFrame ---------- */

.cf-view {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--rim);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 40%, #1d1712, #100c0a 70%);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.cf-view:active { cursor: grabbing; }
.cf-view canvas { width: 100%; height: 100%; display: block; }
.cf-legend { position: absolute; left: 0.6rem; bottom: 0.5rem; display: flex; gap: 0.7rem; font-family: var(--mono); font-size: 0.68rem; color: var(--dim); pointer-events: none; }
.cf-legend i { display: inline-block; width: 0.6rem; height: 0.2rem; margin-right: 0.25rem; vertical-align: middle; border-radius: 2px; }
.cf-hint { position: absolute; right: 0.6rem; bottom: 0.5rem; font-size: 0.66rem; color: var(--dim); pointer-events: none; }

/* ---------- tween ---------- */

.tw-grid { display: grid; grid-template-columns: 7.5rem repeat(3, minmax(0, 1fr)); gap: 0.4rem; align-items: stretch; }
.tw-colhead { font-family: var(--mono); font-size: 0.7rem; color: var(--dim); text-align: center; align-self: end; padding-bottom: 0.2rem; }
.tw-rowhead { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); display: flex; align-items: center; }
.tw-cell {
  position: relative;
  padding: 0;
  border: 1px solid var(--rim);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  overflow: hidden;
}
.tw-cell:hover { border-color: rgba(255, 255, 255, 0.2); }
.tw-cell.is-on { border-color: rgba(255, 158, 87, 0.6); background: rgba(255, 158, 87, 0.06); }
.tw-cell canvas { width: 100%; height: 64px; display: block; }
.tw-big { width: 100%; height: 220px; display: block; border: 1px solid var(--rim); border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.tw-track { position: relative; height: 44px; margin-top: 0.7rem; border: 1px solid var(--rim); border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.tw-block { position: absolute; top: 7px; width: 30px; height: 30px; border-radius: 7px; background: var(--skin); box-shadow: 0 0 18px rgba(255, 158, 87, 0.4); }
.tw-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; margin-top: 0.8rem; }
.tw-controls label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.72rem; color: var(--dim); }
.tw-controls .tl-input { padding: 0.4rem 0.55rem; }
.tw-check { flex-direction: row !important; align-items: center; gap: 0.4rem !important; color: var(--muted) !important; font-size: 0.8rem !important; }
.tw-check input { accent-color: var(--skin); }

/* ---------- API reference ---------- */

.ap-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
.ap-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; max-height: calc(100vh - 2rem); }
.ap-status { font-size: 0.72rem; color: var(--dim); margin: 0; }
.ap-results { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; flex: 1; border: 1px solid var(--rim); border-radius: 10px; background: var(--pane); }
.ap-results li { padding: 0.35rem 0.6rem; font-size: 0.8rem; cursor: pointer; display: flex; gap: 0.45rem; align-items: baseline; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.ap-results li:hover, .ap-results li.is-on { background: rgba(255, 158, 87, 0.08); }
.ap-results b { font-weight: 500; color: var(--text); font-family: var(--mono); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-results small { margin-left: auto; color: var(--dim); font-size: 0.66rem; white-space: nowrap; }
.ap-kind { flex: none; width: 1.1rem; text-align: center; font-family: var(--mono); font-size: 0.7rem; color: var(--dim); }
.ap-kind.k-class { color: #e9c98d; } .ap-kind.k-enum { color: #6fa8a0; } .ap-kind.k-item { color: #6fa8a0; }
.ap-kind.k-prop { color: var(--leaf); } .ap-kind.k-func { color: var(--skin); } .ap-kind.k-event { color: #d6a2c4; } .ap-kind.k-cb { color: var(--flesh); }

.ap-main h1 { margin: 0; font-family: var(--display); font-size: 1.6rem; word-break: break-word; }
.ap-chain { margin: 0.35rem 0 0.7rem; font-family: var(--mono); font-size: 0.76rem; color: var(--dim); }
.ap-chain a, .ap-main a.ap-link { color: var(--muted); text-decoration: none; border-bottom: 1px dotted rgba(255, 255, 255, 0.2); cursor: pointer; }
.ap-chain a:hover, .ap-main a.ap-link:hover { color: var(--skin); }
.ap-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.3rem 0 0.6rem; }
.ap-tag { font-family: var(--mono); font-size: 0.66rem; padding: 0.1rem 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.ap-tag.t-bad { background: rgba(224, 139, 122, 0.16); color: #e8a294; }
.ap-tag.t-warn { background: rgba(243, 197, 102, 0.14); color: var(--flesh); }
.ap-tag.t-good { background: rgba(143, 170, 100, 0.16); color: var(--leaf); }
.ap-filters { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0.4rem 0 0.8rem; font-size: 0.78rem; color: var(--muted); }
.ap-filters label { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }
.ap-filters input { accent-color: var(--skin); }
.ap-section { margin: 1.1rem 0 0.35rem; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.ap-members { width: 100%; border-collapse: collapse; }
.ap-members td { padding: 0.35rem 0.5rem 0.35rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: top; font-size: 0.8rem; }
.ap-members td:first-child { width: 36%; }
.ap-members .ap-name { font-family: var(--mono); color: var(--text); font-size: 0.78rem; word-break: break-word; }
.ap-members .ap-sig { font-family: var(--mono); color: var(--muted); font-size: 0.74rem; word-break: break-word; }
.ap-members .ap-from { font-size: 0.66rem; color: var(--dim); }
.ap-members tr.is-dep .ap-name { text-decoration: line-through; color: var(--dim); }
.ap-members tr.is-hit { background: rgba(255, 158, 87, 0.08); }
.ap-subs { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; font-family: var(--mono); font-size: 0.76rem; }
.ap-empty { color: var(--dim); font-size: 0.84rem; }

/* ---------- API changelog ---------- */

.ch-summary { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.2rem 0 0.8rem; }
.ch-pill { font-family: var(--mono); font-size: 0.72rem; padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--rim); color: var(--muted); background: none; cursor: pointer; }
.ch-pill.is-on { border-color: rgba(255, 158, 87, 0.5); color: var(--text); }
.ch-pill b { font-weight: 500; }
.ch-group { margin: 0 0 0.9rem; }
.ch-group h3 { margin: 0 0 0.3rem; font-family: var(--mono); font-size: 0.84rem; font-weight: 500; color: var(--text); }
.ch-group ul { list-style: none; margin: 0; padding: 0; }
.ch-group li { display: flex; gap: 0.5rem; align-items: baseline; padding: 0.2rem 0; font-size: 0.8rem; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.ch-badge { flex: none; width: 5.6rem; font-family: var(--mono); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ch-added { color: var(--leaf); } .ch-removed { color: #e8a294; } .ch-changed { color: var(--flesh); }
.ch-deprecated { color: #d6a2c4; } .ch-undeprecated { color: #6fa8a0; }
.ch-name { font-family: var(--mono); color: var(--text); font-size: 0.78rem; word-break: break-word; }
.ch-detail { font-family: var(--mono); color: var(--dim); font-size: 0.72rem; word-break: break-word; }
.ch-kind { color: var(--dim); font-size: 0.68rem; }
.ch-rss { color: var(--skin); font-size: 0.8rem; text-decoration: none; }

@media (max-width: 860px) {
  .tl-grid-2, .ap-layout { grid-template-columns: minmax(0, 1fr); }
  .ap-side { position: static; max-height: none; }
  .ap-results { max-height: 40vh; }
  .tw-grid { grid-template-columns: 5.5rem repeat(3, minmax(0, 1fr)); }
}

.tl-sub a, .tl-note a { color: var(--skin); text-decoration: none; }
.tl-sub a:hover, .tl-note a:hover { text-decoration: underline; }
.tl-sub code, .tl-note code { font-family: var(--mono); font-size: 0.9em; color: var(--text); }
