.text-tool-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.025);
}

.text-tool-editor {
  padding: 1rem;
}

.text-tool-grid {
  display: grid;
  gap: 1rem;
}

.text-tool-label {
  display: block;
  margin-bottom: 0.55rem;
  color: #eaf3ee;
  font-size: 0.875rem;
  font-weight: 600;
}

.text-tool-textarea,
.text-tool-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.18);
  color: #eaf3ee;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.text-tool-textarea {
  display: block;
  min-height: 15rem;
  resize: vertical;
  padding: 1rem;
  line-height: 1.65;
  tab-size: 2;
}

.text-tool-textarea[readonly] {
  color: #d9e9e0;
}

.text-tool-textarea::placeholder {
  color: rgba(177, 195, 185, 0.64);
}

.text-tool-select {
  min-height: 2.75rem;
  padding: 0.6rem 2.1rem 0.6rem 0.8rem;
}

#json-indent.text-tool-select {
  color-scheme: dark;
  background-color: #142722;
  color: #eaf3ee;
}

#json-indent.text-tool-select option {
  background-color: #142722;
  color: #eaf3ee;
}

.text-tool-textarea:focus,
.text-tool-select:focus {
  outline: none;
  border-color: rgba(82, 197, 150, 0.82);
  box-shadow: 0 0 0 3px rgba(82, 197, 150, 0.16);
}

.text-tool-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.text-tool-select-wrap {
  flex: 0 1 10rem;
}

.text-tool-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.text-tool-button {
  min-height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: #eaf3ee;
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.text-tool-button:hover {
  border-color: rgba(82, 197, 150, 0.55);
  color: #52c596;
}

.text-tool-button:focus-visible {
  outline: 2px solid #52c596;
  outline-offset: 3px;
}

.text-tool-button-primary {
  border-color: rgba(82, 197, 150, 0.4);
  background: rgba(82, 197, 150, 0.12);
  color: #73d8ad;
}

.text-tool-status {
  min-height: 2.8rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #b1c3b9;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.text-tool-status[data-state="valid"] {
  color: #73d8ad;
}

.text-tool-status[data-state="error"] {
  color: #ffb4aa;
}

.text-case-metrics {
  display: flex;
  gap: 1rem;
  color: #b1c3b9;
  font-size: 0.75rem;
}

.text-case-metrics output {
  color: #eaf3ee;
  font-family: "IBM Plex Mono", monospace;
}

.text-tool-code {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  color: #d9e9e0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  white-space: pre;
}

@media (min-width: 768px) {
  .text-tool-editor {
    padding: 1.25rem;
  }

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

@media (max-width: 639px) {
  .text-tool-toolbar,
  .text-tool-actions {
    align-items: stretch;
  }

  .text-tool-actions {
    width: 100%;
  }

  .text-tool-button {
    flex: 1 1 calc(50% - 0.65rem);
  }
}
