.llm-tool-shell,
.llm-tool-shell *,
.llm-tool-shell *::before,
.llm-tool-shell *::after {
  box-sizing: border-box;
}

.llm-tool-shell {
  display: grid;
  gap: 28px;
}

.llm-tool-button {
  align-items: center;
  background: #17201f;
  border: 1px solid #17201f;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.llm-tool-button.is-secondary {
  background: #ffffff;
  color: #17201f;
}

.llm-tool-button:focus-visible,
.llm-tool-field :is(input, select, textarea):focus-visible {
  outline: 3px solid rgba(47, 117, 97, 0.35);
  outline-offset: 2px;
}

.llm-tool-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  max-width: 100%;
}

.llm-tool-panel {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.12);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(23, 32, 31, 0.08);
  max-width: 100%;
  overflow: hidden;
  padding: 22px;
}

.llm-tool-panel h2,
.llm-tool-panel h3 {
  color: #17201f;
  margin: 0 0 14px;
}

.llm-tool-panel p {
  color: #52605d;
  line-height: 1.65;
}

.llm-tool-controls {
  display: grid;
  gap: 16px;
}

.llm-tool-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.llm-tool-field {
  display: grid;
  gap: 8px;
}

.llm-tool-field label {
  color: #263331;
  font-size: 0.92rem;
  font-weight: 800;
}

.llm-tool-field small {
  color: #6b7774;
}

.llm-tool-field :is(input, select, textarea) {
  background: #f8faf8;
  border: 1px solid rgba(23, 32, 31, 0.16);
  border-radius: 8px;
  color: #17201f;
  font: inherit;
  min-height: 44px;
  padding: 11px 12px;
  width: 100%;
}

.llm-tool-field textarea {
  min-height: 310px;
  resize: vertical;
}

.llm-tool-actions,
.llm-tool-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.llm-tool-presets .llm-tool-button {
  min-height: 34px;
  padding: 7px 10px;
}

.llm-tool-results {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.llm-tool-metric {
  background: #f6f7f4;
  border: 1px solid rgba(23, 32, 31, 0.08);
  border-radius: 8px;
  padding: 14px;
}

.llm-tool-metric span {
  color: #6b7774;
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.llm-tool-metric strong {
  color: #17201f;
  display: block;
  font-size: clamp(1.25rem, 2.5vw, 1.9rem);
  line-height: 1.2;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.llm-tool-meter {
  background: #e6ece8;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.llm-tool-meter span {
  background: #2f7561;
  display: block;
  height: 100%;
  transition: width 160ms ease;
  width: 0;
}

.llm-tool-status {
  border-radius: 999px;
  display: inline-flex;
  font-weight: 800;
  padding: 7px 11px;
}

.llm-tool-status[data-status="normal"] {
  background: #e6f4ee;
  color: #0f5b3d;
}

.llm-tool-status[data-status="warning"] {
  background: #fff4d8;
  color: #7a4f00;
}

.llm-tool-status[data-status="overflow"] {
  background: #ffe3df;
  color: #9b2418;
}

.llm-tool-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.llm-tool-list li {
  align-items: center;
  background: #f8faf8;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 10px 12px;
}

.llm-tool-list span,
.llm-tool-list a {
  color: #263331;
  overflow-wrap: anywhere;
}

.llm-tool-list small {
  color: #6b7774;
}

.llm-tool-note {
  background: #f1f5f2;
  border-left: 4px solid #2f7561;
  border-radius: 8px;
  color: #42504d;
  margin: 0;
  padding: 12px 14px;
}

.llm-tool-error {
  background: #fff0ed;
  border: 1px solid rgba(155, 36, 24, 0.28);
  border-radius: 8px;
  color: #9b2418;
  padding: 12px 14px;
}

.llm-tool-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.llm-tool-meta-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.llm-tool-meta-row span:first-child {
  color: #6b7774;
}

.llm-tool-meta-row span:last-child,
.llm-tool-meta-row a {
  color: #17201f;
  font-weight: 700;
  text-align: right;
}

.llm-tool-hub-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.llm-tool-hub-card {
  background: #ffffff;
  border: 1px solid rgba(23, 32, 31, 0.12);
  border-radius: 8px;
  color: inherit;
  padding: 22px;
  text-decoration: none;
}

.llm-tool-hub-card:hover,
.llm-tool-hub-card:focus-visible {
  border-color: rgba(47, 117, 97, 0.45);
  box-shadow: 0 14px 38px rgba(23, 32, 31, 0.08);
  outline: none;
}

.llm-tool-hub-card span {
  color: #2f7561;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.llm-tool-hub-card h2 {
  color: #17201f;
  margin: 8px 0;
}

@media (max-width: 860px) {
  .tools-content .llm-tool-shell {
    padding-left: 20px;
    padding-right: 20px;
  }

  .llm-tool-grid,
  .llm-tool-row,
  .llm-tool-results,
  .llm-tool-hub-grid {
    grid-template-columns: 1fr;
  }

  .llm-tool-panel {
    padding: 18px;
    min-width: 0;
  }

  .llm-tool-field textarea {
    min-height: 240px;
  }

  .llm-tool-actions .llm-tool-button,
  .llm-tool-presets .llm-tool-button {
    flex: 1 1 96px;
  }
}
