body[data-tool="url-encode"] {
  --ue-ink: #16121c;
  --ue-muted: #6b6578;
  --ue-line: rgba(88, 60, 140, 0.12);
  --ue-soft: rgba(124, 58, 237, 0.07);
  --ue-ok: #059669;
  --ue-err: #dc2626;
}

body[data-tool="url-encode"] .tool-workspace {
  padding: 0 0 2rem !important;
  background:
    radial-gradient(ellipse 85% 50% at 8% -8%, rgba(6, 182, 212, 0.09), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 0%, rgba(124, 58, 237, 0.09), transparent 50%),
    linear-gradient(180deg, #f8f7fc 0%, #f2f4fa 100%) !important;
}

body[data-tool="url-encode"] .ue-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

body[data-tool="url-encode"] .ue-intro {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 1.5rem;
}

body[data-tool="url-encode"] .ue-intro h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ue-ink);
}

body[data-tool="url-encode"] .ue-intro p {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--ue-muted);
  line-height: 1.55;
}

body[data-tool="url-encode"] .ue-studio {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

body[data-tool="url-encode"] .ue-panel {
  display: flex;
  flex-direction: column;
  min-height: 480px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--ue-line);
  border-radius: 16px;
  box-shadow: 0 10px 36px rgba(70, 40, 120, 0.06);
  overflow: hidden;
}

body[data-tool="url-encode"] .ue-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ue-line);
  background: rgba(255, 255, 255, 0.98);
}

body[data-tool="url-encode"] .ue-panel-head h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ue-ink);
}

body[data-tool="url-encode"] .ue-mode {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--ue-soft);
  border: 1px solid var(--ue-line);
  gap: 0.15rem;
}

body[data-tool="url-encode"] .ue-mode button {
  border: none;
  background: transparent;
  color: var(--ue-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

body[data-tool="url-encode"] .ue-mode button.is-on {
  background: #fff;
  color: var(--primary-dark, #6d28d9);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.14);
}

body[data-tool="url-encode"] .ue-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem 1rem;
  min-height: 0;
}

body[data-tool="url-encode"] .ue-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--ue-muted);
}

body[data-tool="url-encode"] .ue-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  font-size: 0.78rem;
  color: var(--ue-muted);
}

body[data-tool="url-encode"] .ue-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}

body[data-tool="url-encode"] .ue-options input {
  accent-color: var(--primary, #7c3aed);
}

body[data-tool="url-encode"] .ue-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--ue-muted);
  line-height: 1.45;
  min-height: 2.1em;
}

body[data-tool="url-encode"] .ue-editor,
body[data-tool="url-encode"] .ue-out {
  flex: 1;
  min-height: 200px;
  width: 100%;
  resize: vertical;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--ue-line);
  border-radius: 12px;
  background: #fafafa;
  color: var(--ue-ink);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  word-break: break-all;
}

body[data-tool="url-encode"] .ue-editor:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
  background: #fff;
}

body[data-tool="url-encode"] .ue-out {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  resize: none;
}

body[data-tool="url-encode"] .ue-out.is-empty {
  color: var(--ue-muted);
}

body[data-tool="url-encode"] .ue-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

body[data-tool="url-encode"] .ue-text-btn {
  border: 0;
  background: transparent;
  color: var(--primary, #7c3aed);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0;
  cursor: pointer;
}

body[data-tool="url-encode"] .ue-text-btn:hover {
  text-decoration: underline;
}

body[data-tool="url-encode"] .ue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

body[data-tool="url-encode"] .ue-status {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ue-muted);
  min-height: 1.2em;
}

body[data-tool="url-encode"] .ue-status.is-ok { color: var(--ue-ok); }
body[data-tool="url-encode"] .ue-status.is-err { color: var(--ue-err); }

@media (max-width: 860px) {
  body[data-tool="url-encode"] .ue-page {
    padding: 0 1rem;
  }

  body[data-tool="url-encode"] .ue-studio {
    grid-template-columns: 1fr;
  }

  body[data-tool="url-encode"] .ue-panel {
    min-height: 0;
  }
}

html[data-theme="dark"] body[data-tool="url-encode"] {
  --ue-ink: #f1edf8;
  --ue-muted: #94a3b8;
  --ue-line: rgba(255, 255, 255, 0.08);
  --ue-soft: rgba(124, 58, 237, 0.16);
}

html[data-theme="dark"] body[data-tool="url-encode"] .tool-workspace {
  background:
    radial-gradient(ellipse 80% 45% at 10% -10%, rgba(124, 58, 237, 0.2), transparent 55%),
    var(--bg) !important;
}

html[data-theme="dark"] body[data-tool="url-encode"] .ue-panel,
html[data-theme="dark"] body[data-tool="url-encode"] .ue-panel-head,
html[data-theme="dark"] body[data-tool="url-encode"] .ue-mode button.is-on {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] body[data-tool="url-encode"] .ue-editor,
html[data-theme="dark"] body[data-tool="url-encode"] .ue-out {
  background: var(--tool-input-bg, #0f0d14);
  border-color: var(--border);
  color: var(--text);
}
