.tool-shell {
  --tl-card-bg: var(--background);
  --tl-card-border: color-mix(
    in srgb,
    var(--foreground) 16%,
    var(--background)
  );
  --tl-text-secondary: color-mix(
    in srgb,
    var(--foreground) 75%,
    var(--background)
  );
  --tl-text-tertiary: color-mix(
    in srgb,
    var(--foreground) 62%,
    var(--background)
  );
  --tl-inset-bg: color-mix(in srgb, var(--foreground) 3%, var(--background));
  --tl-inset-border: color-mix(
    in srgb,
    var(--foreground) 10%,
    var(--background)
  );
  max-width: 64rem;
  display: grid;
  gap: 1.5rem;
}
.tool-shell section {
  max-width: none;
  margin-inline: 0;
}
.tool-shell section:not(.tool-panel):not(.gif-card) {
  padding-inline: 0;
}
.tool-shell :where(form, article, section, div) {
  min-width: 0;
}
.tool-header {
  margin-top: 1.5rem;
}
.tool-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.tool-header h1 {
  margin-block: 0.65rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.035em;
}
.tool-header > p:last-child {
  max-width: 46rem;
  line-height: 1.8;
  font-size: 0.9375rem;
  color: var(--tl-text-secondary);
}
.tool-back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8125rem;
  color: var(--tl-text-secondary);
  transition: color 150ms ease;
}
.tool-back-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}
.tool-shell.file-dragover {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--accent) 6%, var(--background));
}
.file-drop-hint {
  font-size: 0.8125rem;
  color: var(--tl-text-secondary);
  line-height: 1.7;
}
.tool-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}
.tool-panel {
  padding: 1.5rem;
  border: 1px solid var(--tl-card-border);
  border-radius: 0.5rem;
  background: var(--tl-card-bg);
}
.tool-panel h2,
.tool-panel h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}
.tool-panel p {
  line-height: 1.8;
  font-size: 0.875rem;
}
.tool-panel-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.tool-panel-heading h2 {
  margin: 0;
}
.tool-panel-heading span {
  font-size: 0.75rem;
  color: var(--tl-text-tertiary);
}
.tool-form-grid {
  display: grid;
  gap: 1.1rem;
}
.tool-field {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}
.tool-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tl-text-secondary);
}
.tool-field input,
.tool-field select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--tl-card-border);
  border-radius: 0.375rem;
  background: var(--background);
  color: inherit;
  font: inherit;
  font-size: 1rem;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}
.tool-field input:focus,
.tool-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.tool-field input[aria-invalid="true"] {
  border-style: dashed;
  border-color: var(--accent);
}
.tool-field input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}
.tool-field input[readonly] {
  background: var(--tl-inset-bg);
}
.tool-caption {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--tl-text-secondary);
  line-height: 1.7;
}
.tool-result-list {
  display: grid;
  margin: 0;
}
.tool-result {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--tl-inset-border);
}
.tool-result:last-child {
  border-bottom: 0;
}
.tool-result dt {
  font-size: 0.8125rem;
  color: var(--tl-text-secondary);
}
.tool-result dd {
  margin: 0;
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tool-result:has(
  [data-output="vout"],
  [data-output="runtime"],
  [data-output="payloadRate"]
) {
  order: -1;
  flex-direction: column;
  align-items: start;
  gap: 0.25rem;
  padding-block: 0.25rem 1rem;
}
.tool-result
  :is(
    [data-output="vout"],
    [data-output="runtime"],
    [data-output="payloadRate"]
  ) {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--accent);
  line-height: 1.3;
  text-align: left;
}
.tool-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-left: 2px solid var(--accent);
  background: var(--tl-inset-bg);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--tl-text-secondary);
}
.tool-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--tl-text-secondary);
}
.tool-formula {
  margin-top: 0.85rem;
  border-left: 2px solid var(--tl-card-border);
  padding-left: 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--tl-text-secondary);
}
.tool-inline-code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.tool-grid:has(> article) {
  padding-top: 1.5rem;
  border-top: 1px solid var(--tl-card-border);
}
.tool-grid > article.tool-panel {
  border: 0;
  border-radius: 0;
  padding: 0;
}
@media (min-width: 768px) {
  .tool-grid[data-columns="wide"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-form-grid[data-split="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .tool-shell *,
  .tool-shell *::before,
  .tool-shell *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Native utility styles replacing the old blog's Tailwind dependency. */
.tool-shell {
  width: 100%;
  margin-inline: auto;
  padding: 0 24px 64px;
}
.tool-shell input,
.tool-shell select,
.tool-shell button {
  font: inherit;
}
.tool-shell .hidden,
[hidden] {
  display: none !important;
}
.tool-shell .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.tool-shell .text-sm {
  font-size: 0.875rem;
}
.tool-shell .font-semibold {
  font-weight: 600;
}
.tool-shell .text-xs {
  font-size: 0.75rem;
}
.tool-shell .text-base {
  font-size: 1rem;
}
.tool-shell .text-lg {
  font-size: 1.125rem;
}
.tool-shell .font-bold {
  font-weight: 700;
}
.tool-shell .opacity-70 {
  opacity: 0.7;
}
.tool-shell .underline {
  text-decoration: underline;
}
.tool-shell .mt-1\.5 {
  margin-top: 0.375rem;
}
.tool-shell .mt-3 {
  margin-top: 0.75rem;
}
.tool-shell .ml-2 {
  margin-left: 0.5rem;
}
.tool-shell .px-6 {
  padding-inline: 1.5rem;
}
.tool-shell .flex-grow {
  flex-grow: 1;
}
.tool-shell a:not(.tool-navigation a) {
  color: var(--accent);
  text-underline-offset: 3px;
}
.tool-shell input[type="checkbox"] {
  accent-color: var(--accent);
}
.tool-shell button:not(:disabled),
.tool-shell summary {
  cursor: pointer;
}
.tool-shell ul {
  margin-block: 1rem;
}
.tool-shell figure {
  margin: 0;
}
.toolbox-directory {
  max-width: 1024px;
  margin: 40px auto 64px;
  padding: 0 24px;
}
.toolbox-directory h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 12px;
}
.toolbox-directory .intro {
  color: var(--muted);
  margin-bottom: 32px;
}
.toolbox-directory h2 {
  font-size: 20px;
  margin: 32px 0 16px;
}
.toolbox-directory ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  list-style: none;
}
.toolbox-directory li a {
  display: block;
  height: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 24px;
  border-radius: 6px;
  transition: border-color 150ms;
}
.toolbox-directory li a:hover {
  border-color: var(--accent);
}
.toolbox-directory h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.toolbox-directory li p {
  font-size: 14px;
  color: var(--muted);
}
.toolbox-directory .tool-cta {
  display: block;
  margin-top: 20px;
  color: var(--accent);
}
@media (max-width: 640px) {
  .tool-shell {
    padding-inline: 16px;
  }
  .toolbox-directory ul {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toolbox-directory li a {
    transition: none;
  }
}
