/* Wrapper for scoping */
.tool-url-encoder {
  display: grid;
  grid-template-rows: auto auto auto auto;
  row-gap: 1rem;
}

/* Header / steps */
.tool-url-encoder .tool-header {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.tool-url-encoder .tool-title {
  margin: 0 0 0.15rem;
  font-size: 1.12rem;
}

.tool-url-encoder .tool-steps {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

/* Inputs */
.tool-url-encoder .row-inputs textarea {
  min-height: 170px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
}

/* Modes / options */
.tool-url-encoder .tool-modes {
  margin-top: 0.5rem;
}

.tool-url-encoder .tool-modes fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.tool-url-encoder .tool-modes legend {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.tool-url-encoder .mode-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tool-url-encoder .mode-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition:
    border-color 0.15s ease-out,
    background-color 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.tool-url-encoder .mode-option:hover {
  border-color: color-mix(in oklab, var(--acc-url) 48%, var(--border));
  background: var(--elev);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--acc-url) 30%, transparent);
}

.tool-url-encoder .mode-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
}

.tool-url-encoder .mode-main input[type="radio"] {
  margin: 0.15rem 0 0;
}

.tool-url-encoder .mode-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.tool-url-encoder .mode-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.tool-url-encoder .mode-desc {
  color: var(--muted);
}

.tool-url-encoder .mode-example {
  color: var(--muted);
  font-size: 0.78rem;
}

.tool-url-encoder .mode-example strong {
  font-weight: 600;
}

/* Example buttons */
.tool-url-encoder .mode-option .mode-fill {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .tool-url-encoder .mode-option {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-url-encoder .mode-option .mode-fill {
    align-self: flex-start;
  }
}

/* Actions */
.tool-url-encoder .row-actions {
  align-items: flex-start;
}

.tool-url-encoder .action-main,
.tool-url-encoder .action-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Status line */
.tool-url-encoder #status {
  margin: 0.2rem 0 0;
}

.tool-url-encoder #status.is-error {
  color: #b91c1c;
}

/* Help details */
.tool-url-encoder .tool-help {
  margin-top: 0.6rem;
}

.tool-url-encoder .tool-help summary {
  cursor: pointer;
  font-size: 0.9rem;
}

.tool-url-encoder .tool-help-body {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.tool-url-encoder .tool-help-body ul {
  margin: 0.35rem 0 0.6rem;
  padding-left: 1.2rem;
}

.tool-url-encoder .tool-help-body pre {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.8rem;
  overflow-x: auto;
}

/* Bottom explainer section */
.tool-url-encoder-explainer {
  max-width: 720px;
}

/* Dark mode tweaks */
html[data-theme="dark"] .tool-url-encoder .mode-option {
  background: var(--card);
}

html[data-theme="dark"] .tool-url-encoder .mode-option:hover {
  background: var(--elev);
}

html[data-theme="dark"] .tool-url-encoder #status.is-error {
  color: #fecaca;
}
