:root {
  --drop-navy: #163c60;
  --drop-border: #cbd6e3;
  --drop-gold: #f0b323;
}

.api-sandbox-page {
  display: grid;
  gap: 1rem;
  padding: 1.5rem 0;
}

/* Force sharp corners across sandbox page elements. */
.api-sandbox-page,
.api-sandbox-page * {
  border-radius: 0 !important;
}

.api-card {
  border: 1px solid var(--drop-border);
  border-radius: 0.65rem;
  background: #fff;
  overflow: hidden;
}

.api-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  padding: 1rem 1.2rem;
  list-style: none;
}

.api-summary::-webkit-details-marker {
  display: none;
}

.api-summary-icon {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: transform 140ms ease;
}

.api-summary-icon::before {
  content: "▾";
  line-height: 1;
  font-size: 1.35rem;
}

.api-card[open] .api-summary-icon {
  transform: rotate(180deg);
}

.api-h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.45rem;
  font-weight: 700;
}

.api-subtitle {
  margin: 0.45rem 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.api-note {
  margin: 0 0 0.75rem;
  color: #64748b;
  font-size: 0.82rem;
}

.api-body {
  border-top: 1px solid #e2e8f0;
  padding: 1rem 1.2rem 1.2rem;
  background: #fff;
}

.api-intro-card {
  background: #fff;
}

.api-summary-static {
  cursor: default;
}

.api-intro-body {
  padding-top: 0.9rem;
}

.api-intro-body a {
  color: #0b72b6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.api-intro-body a:hover {
  color: #075985;
}

.api-intro-list {
  padding-left: 1.35rem;
  margin-bottom: 0.7rem;
}

.docs-grid {
  display: grid;
  gap: 0.8rem;
}

.docs-card {
  border: 1px solid #cbd6e3;
  border-radius: 0.65rem;
  padding: 0.9rem;
  background: #fff;
}

.docs-card-title {
  margin: 0 0 0.5rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

.docs-text {
  margin: 0.4rem 0 0.2rem;
  color: #334155;
  font-size: 0.88rem;
}

.docs-text-gap-after {
  margin-bottom: 0.75rem;
}

.docs-mono {
  margin: 0;
  border-radius: 0.45rem;
  border: 1px solid #d4deea;
  padding: 0.42rem 0.5rem;
  width: 100%;
  box-sizing: border-box;
  display: block;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #f8fafc;
  color: #0f172a;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.docs-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.45;
}

.docs-endpoints {
  border: 1px solid #cbd6e3;
  border-radius: 0.6rem;
  overflow: hidden;
}

.docs-endpoint-head,
.docs-endpoint-row {
  display: grid;
  grid-template-columns: 84px minmax(150px, 1fr) 2fr;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 0.7rem;
}

.docs-endpoint-head {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.docs-endpoint-row {
  border-top: 1px solid #dbe5f1;
  color: #1f2937;
  font-size: 0.84rem;
}

.docs-method,
.docs-path {
  font-weight: 700;
  color: #0f172a;
}

.sandbox-space {
  display: grid;
  gap: 0.9rem;
}

.sandbox-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sandbox-inline-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
}

.api-card:not([open]) .sandbox-inline-refresh {
  display: none;
}

.sandbox-inline-refresh:hover {
  background: transparent;
}

.sandbox-inline-refresh:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.sandbox-inline-refresh-icon {
  font-size: 1.25rem;
  line-height: 1;
  color: #0b72b6;
}

.sandbox-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 0.65rem;
  color: #334155;
}

.sandbox-loading p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Keep loader spinner rounded while rest of sandbox UI is sharp-edged. */
.sandbox-loading .spinner-border,
.sandbox-loading .spinner-grow {
  border-radius: 50% !important;
}

.sandbox-section {
  background: #fff;
  border: 1px solid #cbd6e3;
  border-radius: 0.65rem;
  padding: 0.9rem;
}

.sandbox-section h3 {
  margin: 0 0 0.65rem;
  color: #0f172a;
  font-size: 1.05rem;
}

.sandbox-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.sandbox-list-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #cbd6e3;
  border-radius: 0.55rem;
  background: #fff;
  padding: 0.62rem 0.7rem;
  color: #1f2937;
  font-size: 0.9rem;
}

.sandbox-list-checkbox {
  margin-top: 0.14rem;
}

.sandbox-selection-actions {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.45rem;
}

.sandbox-selection-message {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.sandbox-selection-message.is-success {
  color: #166534;
}

.sandbox-selection-message.is-error {
  color: #9f1239;
}

.sandbox-upload-modal-message {
  color: #334155;
}

.sandbox-credentials {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.sandbox-key {
  margin: 0;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #b9c6d8;
  border-radius: 0.4rem;
  padding: 0.6rem 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.83rem;
  flex: 1;
  min-width: 320px;
}

.sandbox-primary-btn,
.sandbox-download-btn,
.sandbox-danger-btn {
  border-radius: 0.45rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.sandbox-primary-btn {
  border: 1px solid #0369a1;
  background: #0b72b6;
  color: #fff;
}

.sandbox-primary-btn:disabled {
  background: #94a3b8;
  border-color: #94a3b8;
}

.sandbox-download-btn {
  border: 1px solid #b9c6d8;
  background: #fff;
  color: #0f172a;
}

.sandbox-full-download-btn {
  width: 100%;
  margin-top: 0.7rem;
}

.sandbox-download-btn:disabled {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #64748b;
}

.sandbox-submission-download-wrap {
  margin-top: 1rem;
}

.sandbox-submission-download-btn {
  margin-top: 0;
}

.sandbox-summary-key {
  margin-top: 0.8rem;
}

.sandbox-summary-key-title {
  margin: 0 0 0.35rem;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 700;
}

.sandbox-summary-key-item {
  margin: 0.22rem 0;
  color: #334155;
  font-size: 0.84rem;
}

.sandbox-danger-btn {
  border: 1px solid #991b1b;
  background: #b91c1c;
  color: #fff;
}

.sandbox-reset-btn {
  margin-top: 0.2rem;
  width: 100%;
  justify-self: stretch;
}

.sandbox-key-status {
  margin: 0 0 0.6rem;
  color: #334155;
  font-size: 0.88rem;
}

.sandbox-key-status.is-issued {
  color: #166534;
  font-weight: 600;
}

.sandbox-key-status.is-invalid {
  color: #9f1239;
  font-weight: 600;
}

.sandbox-helper-text {
  margin: 0.55rem 0 0;
  color: #475569;
  font-size: 0.85rem;
}

.sandbox-upload-email-note {
  margin-top: 1rem;
}

.sandbox-error-table-wrap {
  margin-top: 0.7rem;
  overflow-x: auto;
}

.sandbox-error-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--drop-border);
  background: #fff;
}

.sandbox-error-table th,
.sandbox-error-table td {
  border: 1px solid var(--drop-border);
  padding: 0.5rem 0.55rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.84rem;
  color: #0f172a;
  line-height: 1.35;
}

.sandbox-error-table th {
  background: #e2e8f0;
  font-weight: 700;
}

.sandbox-list-intro {
  margin-bottom: 0.45rem;
}

.sandbox-discrepancy-status {
  margin-bottom: 0.65rem;
}

.sandbox-production-note {
  margin-top: 0.75rem;
}

.sandbox-activity-grid,
.sandbox-session-stats {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.sandbox-fallback-actions {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.sandbox-activity-card,
.sandbox-stat-card {
  border: 1px solid #cbd6e3;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.62rem 0.72rem;
}

.sandbox-activity-label {
  margin: 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sandbox-activity-value {
  margin: 0.2rem 0 0;
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 600;
}

.sandbox-list-return-grid {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.6rem;
}

.sandbox-list-return-row {
  border: 1px solid #cbd6e3;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.65rem 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.sandbox-list-return-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
}

.sandbox-list-name,
.sandbox-list-count {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.sandbox-list-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sandbox-list-status,
.sandbox-list-metric {
  margin: 0;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  padding: 0.14rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.sandbox-list-status.is-not-started {
  color: #475569;
  background: #f8fafc;
}

.sandbox-list-status.is-success,
.sandbox-list-metric.is-success {
  color: #166534;
  border-color: #86efac;
  background: #f0fdf4;
}

.sandbox-list-status.is-failed,
.sandbox-list-metric.is-failed {
  color: #9f1239;
  border-color: #fda4af;
  background: #fff1f2;
}

.sandbox-list-status.is-missing,
.sandbox-list-metric.is-missing {
  color: #92400e;
  border-color: #fcd34d;
  background: #fffbeb;
}

.sandbox-list-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sandbox-list-progress-track {
  width: 100%;
  background: #e2e8f0;
  border-radius: 999px;
  height: 0.45rem;
  overflow: hidden;
  display: flex;
}

.sandbox-list-progress-fill.is-success {
  background: #15803d;
}

.sandbox-list-progress-fill.is-failed {
  background: #be123c;
}

.sandbox-list-progress-fill.is-missing {
  background: #f59e0b;
}

.sandbox-section.is-locked {
  opacity: 0.6;
}

.sandbox-lock-note {
  margin: 0 0 0.45rem;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 600;
}

.sandbox-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 1060;
}

.sandbox-modal-card {
  width: 100%;
  max-width: 720px;
  border-radius: 1rem;
  border: 1px solid #b9c6d8;
  background: #fff;
  padding: 1.2rem;
  display: grid;
  gap: 0.8rem;
}

.sandbox-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sandbox-modal-head h4 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  color: #0f172a;
}

.sandbox-modal-close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.65rem;
  border: 1px solid #b9c6d8;
  background: #fff;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sandbox-modal-caption {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
}

.sandbox-dropzone {
  position: relative;
  border: 2px dashed #94a3b8;
  border-radius: 0.9rem;
  background: #f8fafc;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.sandbox-file-input-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.sandbox-dropzone-content {
  text-align: center;
  display: grid;
  gap: 0.35rem;
}

.sandbox-dropzone-title {
  margin: 0;
  color: #0f172a;
  font-size: 1.75rem;
  font-weight: 700;
}

.sandbox-dropzone-or {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
}

.sandbox-dropzone-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.5rem;
  min-width: 200px;
  border: 1px solid #b9c6d8;
  border-radius: 0.55rem;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
}

.sandbox-modal-empty {
  margin: 0;
  color: #334155;
  font-size: 0.9rem;
}

.sandbox-upload-file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  max-height: 170px;
  overflow-y: auto;
}

.sandbox-upload-file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #d4deea;
  border-radius: 0.55rem;
  padding: 0.45rem 0.55rem;
  color: #0f172a;
  font-size: 0.83rem;
}

.sandbox-upload-file-list button,
.sandbox-link-btn {
  border: 0;
  background: transparent;
  color: #0b72b6;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.sandbox-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.hasher-panel {
  border: 1px solid #cbd6e3;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.8rem;
  min-width: 0;
  overflow-x: hidden;
}

.hasher-head {
  display: none;
}

.hasher-rows {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.hasher-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  background: #fff;
  border: 1px solid #cbd6e3;
  border-radius: 0.75rem;
  padding: 0.75rem;
  min-width: 0;
}

.hasher-row > div {
  min-width: 0;
}

.hasher-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 700;
}

.hasher-mobile-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 600;
}

.hasher-input,
.hasher-output {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 0.55rem;
  padding: 0.6rem 0.74rem;
  font-size: 0.86rem;
  min-height: 2.55rem;
}

.hasher-input {
  border: 1px solid #b9c6d8;
  background: #fff;
  color: #0f172a;
}

.hasher-output {
  border: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
  box-shadow: inset 0 0 0 1px #c3cfdf;
  color: #0f172a;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.hasher-composites {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}

.composite-card {
  border: 1px solid #cbd6e3;
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.9rem;
  display: grid;
  gap: 0.45rem;
}

.composite-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.composite-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.code-samples-group {
  display: grid;
  gap: 0.65rem;
}

.code-samples-group-title {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
}

.code-samples-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.code-sample-card {
  position: relative;
  border: 1px solid #cbd6e3;
  border-radius: 0.65rem;
  background: #fff;
  padding: 0.75rem;
}

.code-sample-language {
  margin: 0 0 0.45rem;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.code-sample-copy {
  position: absolute;
  top: 0.62rem;
  right: 0.62rem;
  min-width: 3.35rem;
  height: 1.7rem;
  border: 1px solid #b9c6d8;
  border-radius: 0.45rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 700;
}

.code-sample-block {
  margin: 0;
  border: 1px solid #d4deea;
  border-radius: 0.55rem;
  background: #f8fafc;
  padding: 0.65rem 0.75rem;
  max-height: 220px;
  overflow: auto;
  color: #0f172a;
  font-size: 0.78rem;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (min-width: 768px) {
  .sandbox-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-card-wide {
    grid-column: 1 / -1;
  }

  .code-samples-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .hasher-head {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 0.75rem;
    margin: 0 0 0.55rem;
    color: #334155;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .hasher-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 0.78rem;
    align-items: end;
  }

  .hasher-mobile-label {
    display: none;
  }
}

@media (max-width: 960px) {
  .sandbox-credentials {
    flex-direction: column;
    align-items: stretch;
  }

  .sandbox-key {
    min-width: 0;
  }

  .sandbox-activity-grid,
  .sandbox-session-stats {
    grid-template-columns: 1fr;
  }

  .sandbox-fallback-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .sandbox-list-grid {
    grid-template-columns: 1fr;
  }
}
