.tools-workspace {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  min-width: 0;
}

.tools-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 660px;
  margin: 0 auto 22px;
  padding: 7px;
  border: 1px solid var(--pi-line);
  border-radius: 25px;
  background: var(--pi-surface);
  box-shadow: 0 10px 28px rgba(54, 70, 67, .08);
}

.tools-picker button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  color: var(--pi-muted);
  background: transparent;
  cursor: pointer;
}

.tools-picker button[aria-selected='true'] {
  color: #fff;
  background: var(--pi-sage);
  box-shadow: 0 8px 18px var(--pi-sage-soft);
}

.tools-picker .ph { font-size: 1.2rem; }

.tools-surface {
  min-height: 430px;
  padding: clamp(26px, 5vw, 50px);
  border: 1px solid var(--pi-line);
  border-radius: 38px 46px 40px 34px;
  background: var(--pi-surface);
  box-shadow: var(--pi-shadow);
  backdrop-filter: blur(18px) saturate(116%);
}

.tool-panel[hidden] { display: none; }
.tool-panel header { max-width: 660px; margin-bottom: 30px; }
.tool-panel h2 { margin: 11px 0 9px; font-size: clamp(1.5rem, 3vw, 2.3rem); letter-spacing: -.04em; }
.tool-panel header p, .tool-status { margin: 0; color: var(--pi-muted); line-height: 1.7; }
.tool-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0; }
.tool-panel label { display: grid; gap: 8px; min-width: 0; color: var(--pi-muted); font-size: .78rem; }
.tool-panel input:not([type='checkbox']):not([type='range']), .tool-panel select, .tool-file {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--pi-line);
  border-radius: 15px;
  color: var(--pi-text);
  background: var(--pi-solid);
}
.tool-file { padding-block: 12px; }
.tool-file input { color: var(--pi-muted); }
.tool-check { display: flex !important; align-items: center; min-height: 48px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.tool-actions button, .tool-actions a, [data-currency-form] button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--pi-sage);
  cursor: pointer;
}
.tool-actions a { background: var(--pi-sage-strong); }
.tool-actions [hidden] { display: none; }
.tool-status { min-height: 1.7em; margin-top: 16px; }
.tool-result { display: block; min-height: 1.5em; margin-top: 24px; font-size: 1.25rem; }
[data-currency-form] button:disabled { cursor: not-allowed; opacity: .5; }

@media (max-width: 700px) {
  .tools-workspace { max-width: calc(100vw - 28px); }
  .tools-picker { grid-template-columns: 1fr; }
  .tools-picker button { justify-content: flex-start; }
  .tools-surface { min-height: 0; padding: 24px 20px; border-radius: 30px; }
  .tool-fields { grid-template-columns: 1fr; }
}
