/* "Run code in a sandbox" (above the FAQ) and the hourly rates table under the calculator.
   Tokens follow DESIGN.md: #070707 / #141414 surfaces, #E9EDF4 / #A1A6AE / #858B94 / #5F646D text,
   emerald #10B981 for Lizard, champagne #D4A574 as the second accent, Geist and Geist Mono. */

#sandbox-code .code-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1024px) {
  #sandbox-code .code-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
}

#sandbox-code .code-card,
#sandbox-code .limits-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: #141414;
}
#sandbox-code .code-card {
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
/* A faint emerald wash along the top edge, as on the hero's quickstart. */
#sandbox-code .code-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, .55) 30%, rgba(212, 165, 116, .45) 70%, transparent);
  pointer-events: none;
}

#sandbox-code .code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
#sandbox-code .code-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #070707;
}
#sandbox-code .code-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #A1A6AE;
  font: 600 14px/20px Geist, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
#sandbox-code .code-tabs button:hover { background: rgba(255, 255, 255, .04); color: #E9EDF4; }
/* Language marks: the brand colours, dimmed on tabs that are not selected. */
#sandbox-code .code-tab-icon { flex: none; width: 16px; height: 16px; opacity: .6; transition: opacity .15s; }
#sandbox-code .code-tabs button:hover .code-tab-icon,
#sandbox-code .code-tabs button[aria-selected="true"] .code-tab-icon { opacity: 1; }
#sandbox-code .code-tabs button[aria-selected="true"] {
  background: #2e2e2e;
  color: #E9EDF4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
#sandbox-code .code-tabs button:focus-visible,
#sandbox-code .code-copy:focus-visible {
  outline: 2px solid #10B981;
  outline-offset: 2px;
}

#sandbox-code .code-panel { display: flex; flex: 1; flex-direction: column; min-width: 0; }
#sandbox-code .code-panel[hidden] { display: none; }

#sandbox-code .code-install {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .015);
  font: 400 13px/20px Geist Mono, ui-monospace, SFMono-Regular, monospace;
}
#sandbox-code .code-prompt { color: #10B981; user-select: none; }
#sandbox-code .code-install code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  color: #E9EDF4;
  white-space: nowrap;
  scrollbar-width: none;
}
#sandbox-code .code-install code::-webkit-scrollbar { display: none; }

#sandbox-code .code-copy {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  background: #1b1b1b;
  color: #A1A6AE;
  font: 500 12px/18px Geist, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
#sandbox-code .code-copy:hover { border-color: rgba(255, 255, 255, .16); color: #E9EDF4; }
#sandbox-code .code-copy[data-copied] { border-color: rgba(16, 185, 129, .5); color: #10B981; }

#sandbox-code .code-body { position: relative; flex: 1; min-width: 0; }
#sandbox-code .code-copy-float {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0;
  transition: opacity .15s, border-color .15s, color .15s;
}
#sandbox-code .code-body:hover .code-copy-float,
#sandbox-code .code-copy-float:focus-visible,
#sandbox-code .code-copy-float[data-copied] { opacity: 1; }
@media (hover: none) { #sandbox-code .code-copy-float { opacity: 1; } }

#sandbox-code pre {
  margin: 0;
  padding: 20px 20px 22px 0;
  overflow-x: auto;
  color: #C9CED6;
  font: 400 13px/22px Geist Mono, ui-monospace, SFMono-Regular, monospace;
  tab-size: 2;
}
#sandbox-code pre code { display: block; min-width: max-content; counter-reset: code-line; }
#sandbox-code .code-line { display: block; min-height: 22px; padding-right: 20px; }
#sandbox-code .code-line::before {
  counter-increment: code-line;
  content: counter(code-line);
  display: inline-block;
  width: 44px;
  padding-right: 18px;
  color: #3a3d42;
  text-align: right;
  user-select: none;
}
#sandbox-code .tok-k { color: #D4A574; }
#sandbox-code .tok-s { color: #34D399; }
#sandbox-code .tok-c { color: #5F646D; font-style: italic; }
#sandbox-code .tok-f { color: #E9EDF4; }
#sandbox-code .tok-n { color: #A1A6AE; font-style: italic; }

#sandbox-code .limits-card { padding: 24px; }
#sandbox-code .limits-card h3 {
  margin: 0;
  color: #E9EDF4;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}
#sandbox-code .limits-lede { margin: 4px 0 0; color: #858B94; font-size: 13px; line-height: 20px; }
#sandbox-code .limits-lede a {
  color: #E9EDF4;
  text-decoration: underline;
  text-decoration-color: rgba(233, 237, 244, .35);
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
#sandbox-code .limits-lede a:hover { color: #10B981; text-decoration-color: rgba(16, 185, 129, .5); }
#sandbox-code .limits-lede a:focus-visible { outline: 2px solid #10B981; outline-offset: 2px; border-radius: 2px; }
#sandbox-code .limits-list { display: grid; gap: 4px; margin: 20px 0 0; padding: 0; list-style: none; }
#sandbox-code .limits-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px;
  margin: 0 -12px;
  border-radius: 10px;
  transition: background-color .15s;
}
#sandbox-code .limits-list li:hover { background: rgba(255, 255, 255, .025); }
#sandbox-code .limit-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: linear-gradient(180deg, #1b1b1b, #101010);
  color: #D4A574;
}
#sandbox-code .limit-icon svg { width: 18px; height: 18px; }
#sandbox-code .limit-name { margin: 0; color: #E9EDF4; font-size: 14px; font-weight: 600; line-height: 20px; }
#sandbox-code .limit-text { margin: 2px 0 0; color: #858B94; font-size: 13px; line-height: 20px; }

@media (max-width: 640px) {
  #sandbox-code .code-tabs { width: 100%; }
  #sandbox-code .code-tabs button { flex: 1; }
  #sandbox-code pre { font-size: 12px; line-height: 20px; }
  #sandbox-code .code-line { min-height: 20px; }
  #sandbox-code .code-line::before { width: 34px; padding-right: 14px; }
  #sandbox-code .limits-card { padding: 20px; }
}

/* Hourly rates under the calculator: the same providers as the bars, as a table. */
.pricing-rates .pricing-rates-scroll {
  margin: 14px 0;
  overflow-x: auto;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
}
.pricing-rates-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.pricing-rates-table th,
.pricing-rates-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #222;
  color: #A1A6AE;
  text-align: left;
  vertical-align: top;
}
.pricing-rates-table thead th { color: #5F646D; font-size: 12px; font-weight: 500; }
.pricing-rates-table tbody tr:last-child > * { border-bottom: 0; }
.pricing-rates-table tbody th { font-weight: 500; }
/* Beats "#sandbox-pricing .pricing-billing-details a" (landing.css), which spaces out the
   standalone "Full pricing" link under the billing note. */
#sandbox-pricing .pricing-billing-details .pricing-rates-table a {
  display: inline;
  margin: 0;
  color: #E9EDF4;
  font: inherit;
  text-decoration: none;
}
#sandbox-pricing .pricing-rates-table tbody th a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pricing-rates-table td:nth-child(2),
.pricing-rates-table td:nth-child(3) { color: #E9EDF4; white-space: nowrap; }
.pricing-rates-table tr.is-lizard > * { background: rgba(16, 185, 129, .06); }
#sandbox-pricing .pricing-rates-table tr.is-lizard th a,
.pricing-rates-table tr.is-lizard td:nth-child(2),
.pricing-rates-table tr.is-lizard td:nth-child(3) { color: #10B981; }
@media (max-width: 640px) {
  .pricing-rates-table { min-width: 0; font-size: 12px; }
  .pricing-rates-table th,
  .pricing-rates-table td { padding: 9px 6px; }
  .pricing-rates-table td:last-child { min-width: 104px; }
}
