/* ================================================================
   URL ENCODER / DECODER — COMPONENT STYLESHEET
   webeasier.com/tools/url-encoder-decoder/
   ================================================================ */

/* ── Hero ──────────────────────────────────────────────────────── */
.ue-hero {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 45%, #eff6ff 100%);
  padding: 3rem 0 2.25rem;
  position: relative;
  overflow: hidden;
}
.ue-hero::before {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(37,99,235,.09) 0%, transparent 70%);
  top: -170px; right: -120px;
  pointer-events: none;
}
.ue-hero::after {
  content: "";
  position: absolute;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(99,102,241,.07) 0%, transparent 70%);
  bottom: -100px; left: -80px;
  pointer-events: none;
}
.ue-breadcrumb {
  list-style: none; padding: 0; margin: 0 0 .9rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  font-size: .8125rem; color: #94a3b8;
}
.ue-breadcrumb a { color: #64748b; text-decoration: none; }
.ue-breadcrumb a:hover { color: var(--color-primary); }
.ue-breadcrumb .sep { color: #cbd5e1; font-size: .6rem; }
.ue-headline { color: #0f172a; font-weight: 800; line-height: 1.18; }
.ue-gradient-text {
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ue-subhead { color: #475569; font-size: 1.05rem; max-width: 640px; margin: .7rem 0 1.2rem; }
.ue-badges { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; }
.ue-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 99px;
  padding: .28rem .75rem; font-size: .775rem; font-weight: 600; color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.ue-badge .bi { color: #22c55e; font-size: .75rem; }

/* Hero Visual */
.ue-hero-visual {
  position: relative; width: 220px; height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.ue-hero-icon-box {
  width: 180px; height: 180px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-radius: 40px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 60px rgba(37,99,235,.3);
}
.ue-hero-icon-box .bi { font-size: 4rem; color: #fff; }
.ue-hero-tag {
  position: absolute; background: #fff; border: 2px solid #e2e8f0;
  border-radius: 12px; padding: .4rem .7rem;
  font-size: .72rem; font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.ue-hero-tag-1 { top: 10px; right: 5px; color: #2563eb; }
.ue-hero-tag-2 { bottom: 20px; left: 0; color: #0ea5e9; }
.ue-hero-tag-3 { top: 50px; left: -10px; color: #7c3aed; }

/* ── Tool Section ──────────────────────────────────────────────── */
.ue-tool-section {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  padding: 2rem 0 4rem;
}

/* ── Top Bar ───────────────────────────────────────────────────── */
.ue-topbar {
  display: flex; justify-content: flex-end; gap: .5rem;
  margin-bottom: 1rem;
}
.ue-topbar-btn {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #475569; font-size: 1rem;
  transition: all .15s; font-family: inherit;
}
.ue-topbar-btn:hover { border-color: #0ea5e9; color: #0284c7; background: #f0f9ff; }
.ue-topbar-btn.danger:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }

/* ── Tabs ──────────────────────────────────────────────────────── */
.ue-tabs {
  display: flex; flex-wrap: wrap; gap: .35rem;
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 14px;
  padding: .35rem; margin-bottom: 1.25rem;
}
.ue-tab {
  background: transparent; border: none; border-radius: 10px;
  padding: .55rem 1.1rem; font-size: .8125rem; font-weight: 600;
  color: #64748b; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: .4rem;
  transition: all .15s; white-space: nowrap;
}
.ue-tab:hover { color: #0284c7; background: #f0f9ff; }
.ue-tab.active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff; box-shadow: 0 2px 8px rgba(14,165,233,.3);
}
.ue-tab .bi { font-size: .85rem; }

/* ── Panels ────────────────────────────────────────────────────── */
.ue-panel { display: none; }
.ue-panel.active { display: block; }

/* ── Controls Row ──────────────────────────────────────────────── */
.ue-controls-row {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.ue-control-group { display: flex; flex-direction: column; gap: .3rem; }
.ue-control-label {
  font-size: .68rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .07em;
}
.ue-select {
  border: 1.5px solid #e2e8f0; border-radius: 9px;
  padding: .45rem .65rem; font-size: .8125rem; font-weight: 600;
  color: #1e293b; cursor: pointer; outline: none;
  font-family: inherit; background: #fff; transition: border-color .14s;
  min-width: 220px;
}
.ue-select:focus { border-color: #0ea5e9; }

/* Toggle Inline */
.ue-toggle-inline {
  display: inline-flex; align-items: center; gap: .5rem;
  cursor: pointer; font-size: .8rem; font-weight: 600; color: #475569;
  user-select: none;
}
.ue-toggle-inline input { display: none; }
.ue-toggle-track {
  width: 36px; height: 20px; background: #cbd5e1; border-radius: 99px;
  position: relative; transition: background .2s; flex-shrink: 0;
}
.ue-toggle-track::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ue-toggle-inline input:checked ~ .ue-toggle-track { background: #0ea5e9; }
.ue-toggle-inline input:checked ~ .ue-toggle-track::after { left: 19px; }

/* ── IO Wrap ───────────────────────────────────────────────────── */
.ue-io-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ue-io-col {
  display: flex; flex-direction: column;
}
.ue-io-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .5rem;
}
.ue-io-label {
  font-size: .775rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: .35rem;
}
.ue-io-label .bi { color: #0ea5e9; font-size: .85rem; }
.ue-io-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.ue-mini-btn {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: .28rem .6rem; font-size: .72rem; font-weight: 600; color: #475569;
  cursor: pointer; font-family: inherit; transition: all .15s;
  display: inline-flex; align-items: center; gap: .25rem;
  white-space: nowrap;
}
.ue-mini-btn:hover { border-color: #0ea5e9; color: #0284c7; background: #f0f9ff; }
.ue-mini-btn.danger { border-color: #fecaca; color: #ef4444; }
.ue-mini-btn.danger:hover { background: #fef2f2; }

.ue-textarea {
  width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: .85rem 1rem; font-size: .85rem; font-weight: 500;
  color: #1e293b; font-family: 'Courier New', Consolas, monospace;
  background: #fff; outline: none; resize: vertical;
  transition: border-color .15s; line-height: 1.6;
  min-height: 180px;
}
.ue-textarea:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.08); }
.ue-textarea[readonly] { background: #f8fafc; }

/* Drop Zone */
.ue-drop-zone { position: relative; }
.ue-drop-overlay {
  display: none; position: absolute; inset: 0;
  background: rgba(14,165,233,.08); border: 2.5px dashed #0ea5e9;
  border-radius: 12px; z-index: 5;
  flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; font-size: .9rem; font-weight: 700; color: #0284c7;
}
.ue-drop-overlay .bi { font-size: 2rem; }
.ue-drop-zone.dragging .ue-drop-overlay { display: flex; }

.ue-io-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: .4rem; padding: 0 .25rem;
}
.ue-counter { font-size: .72rem; font-weight: 600; color: #94a3b8; }
.ue-auto-badge {
  font-size: .68rem; font-weight: 700; border-radius: 6px;
  padding: .15rem .5rem;
}
.ue-auto-badge.encode { background: #eff6ff; color: #2563eb; }
.ue-auto-badge.decode { background: #f0fdf4; color: #16a34a; }
.ue-size-diff {
  font-size: .72rem; font-weight: 700; border-radius: 6px;
  padding: .15rem .5rem;
}
.ue-size-diff.smaller { background: #f0fdf4; color: #16a34a; }
.ue-size-diff.larger { background: #fef2f2; color: #ef4444; }
.ue-size-diff.same { background: #f8fafc; color: #94a3b8; }

/* ── Center Actions ────────────────────────────────────────────── */
.ue-center-actions {
  display: flex; flex-direction: column; gap: .6rem;
  justify-content: center; align-items: center;
  padding: 1rem 0;
}
.ue-btn-encode {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff; border: none; border-radius: 11px;
  padding: .65rem 1.4rem; font-size: .85rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: .45rem;
  transition: opacity .15s, transform .15s; font-family: inherit;
  box-shadow: 0 4px 16px rgba(14,165,233,.3); white-space: nowrap;
}
.ue-btn-encode:hover { opacity: .88; transform: translateY(-1px); }
.ue-btn-decode {
  background: #fff; color: #2563eb; border: 1.5px solid #bfdbfe; border-radius: 11px;
  padding: .6rem 1.4rem; font-size: .85rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: .45rem;
  transition: all .15s; font-family: inherit; white-space: nowrap;
}
.ue-btn-decode:hover { border-color: #2563eb; background: #eff6ff; }
.ue-btn-swap {
  background: transparent; color: #64748b; border: 1.5px solid #e2e8f0; border-radius: 11px;
  padding: .5rem 1rem; font-size: .8rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
  transition: all .15s; font-family: inherit; white-space: nowrap;
}
.ue-btn-swap:hover { border-color: #0ea5e9; color: #0284c7; }

/* ── Highlight Panel ───────────────────────────────────────────── */
.ue-highlight-panel {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 14px;
  padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.ue-highlight-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .75rem; font-size: .8rem; font-weight: 700; color: #0f172a;
}
.ue-highlight-header .bi { margin-right: .3rem; color: #0ea5e9; }
.ue-highlight-body {
  font-family: 'Courier New', Consolas, monospace;
  font-size: .85rem; line-height: 1.8; word-break: break-all;
}
.ue-hl-encoded {
  background: #fef3c7; color: #92400e; border-radius: 3px;
  padding: .05rem .2rem; font-weight: 700;
}
.ue-hl-normal { color: #1e293b; }

/* ── Warnings ──────────────────────────────────────────────────── */
.ue-warnings { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }
.ue-warn-item {
  display: flex; align-items: flex-start; gap: .5rem;
  background: #fefce8; border: 1px solid #fef08a; border-radius: 9px;
  padding: .55rem .75rem; font-size: .79rem; color: #854d0e;
}
.ue-warn-item .bi { color: #ca8a04; font-size: .9rem; flex-shrink: 0; margin-top: .05rem; }
.ue-warn-item.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ue-warn-item.error .bi { color: #ef4444; }
.ue-warn-item.info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.ue-warn-item.info .bi { color: #0ea5e9; }

/* ── Quick Actions Row ─────────────────────────────────────────── */
.ue-quick-row {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .75rem 0;
}
.ue-quick-btn {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 9px;
  padding: .38rem .8rem; font-size: .75rem; font-weight: 600; color: #475569;
  cursor: pointer; font-family: inherit; transition: all .15s;
  display: inline-flex; align-items: center; gap: .3rem;
}
.ue-quick-btn:hover { border-color: #0ea5e9; color: #0284c7; background: #f0f9ff; }
.ue-export-group { margin-left: auto; display: flex; gap: .4rem; }

/* ── Inspector Tab ─────────────────────────────────────────────── */
.ue-inspector-input { margin-bottom: 1.25rem; }
.ue-inspector-row {
  display: flex; gap: .5rem; margin-top: .4rem;
}
.ue-input-full {
  flex: 1; border: 1.5px solid #e2e8f0; border-radius: 9px;
  padding: .5rem .75rem; font-size: .85rem; font-weight: 500;
  color: #1e293b; outline: none; font-family: inherit; background: #fff;
  transition: border-color .14s;
}
.ue-input-full:focus { border-color: #0ea5e9; }
.ue-input-half {
  flex: 1; border: 1.5px solid #e2e8f0; border-radius: 9px;
  padding: .45rem .65rem; font-size: .8125rem; font-weight: 500;
  color: #1e293b; outline: none; font-family: inherit; background: #fff;
  transition: border-color .14s;
}
.ue-input-half:focus { border-color: #0ea5e9; }

.ue-btn-inspect {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff; border: none; border-radius: 9px;
  padding: .5rem 1.2rem; font-size: .85rem; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .4rem;
  transition: opacity .15s;
}
.ue-btn-inspect:hover { opacity: .88; }

.ue-result-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 1.25rem; margin-bottom: 1rem;
}
.ue-result-title {
  font-size: .875rem; font-weight: 700; color: #0f172a;
  margin-bottom: .85rem; display: flex; align-items: center; gap: .4rem;
}
.ue-result-title .bi { color: #0ea5e9; }

/* URL Structure */
.ue-structure-grid {
  display: grid; grid-template-columns: auto 1fr;
  gap: .3rem .75rem; font-size: .82rem;
}
.ue-struct-label {
  font-weight: 700; color: #64748b; text-transform: uppercase;
  font-size: .7rem; letter-spacing: .05em; padding-top: .2rem;
}
.ue-struct-value {
  color: #1e293b; font-family: 'Courier New', monospace; word-break: break-all;
  padding: .15rem .5rem; background: #f8fafc; border-radius: 6px;
}

/* Param Count */
.ue-param-count {
  background: #eff6ff; color: #2563eb; font-size: .7rem; font-weight: 700;
  border-radius: 99px; padding: .1rem .5rem; margin-left: .4rem;
}

/* Param Table */
.ue-param-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.ue-param-table th {
  background: #f8fafc; padding: .5rem .65rem; text-align: left;
  font-size: .7rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 2px solid #e2e8f0;
}
.ue-param-table td {
  padding: .5rem .65rem; border-bottom: 1px solid #f1f5f9;
  color: #334155; vertical-align: middle; word-break: break-all;
}
.ue-param-table tr:last-child td { border-bottom: none; }
.ue-param-tracking { background: #fef3c7; }

/* Clean URL */
.ue-clean-url-wrap { margin-top: .85rem; }
.ue-clean-url-row { display: flex; gap: .5rem; margin-top: .35rem; }

/* Validation badges */
.ue-validation-list { display: flex; flex-direction: column; gap: .4rem; }
.ue-valid-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .65rem; border-radius: 8px; font-size: .8rem; font-weight: 600;
}
.ue-valid-item.pass { background: #f0fdf4; color: #16a34a; }
.ue-valid-item.fail { background: #fef2f2; color: #ef4444; }
.ue-valid-item.warn { background: #fefce8; color: #ca8a04; }

/* Metrics */
.ue-metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .65rem;
}
.ue-metric-card {
  background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 10px;
  padding: .75rem; text-align: center;
}
.ue-metric-num { font-size: 1.2rem; font-weight: 800; color: #0f172a; line-height: 1.2; }
.ue-metric-lbl { font-size: .68rem; font-weight: 600; color: #94a3b8; margin-top: .1rem; }

/* ── Developer Tab ─────────────────────────────────────────────── */
.ue-dev-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 1.25rem; margin-bottom: 1rem;
}
.ue-desc {
  font-size: .82rem; color: #64748b; margin-bottom: .75rem;
}
.ue-btn-small {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 9px;
  padding: .4rem .85rem; font-size: .8rem; font-weight: 600; color: #475569;
  cursor: pointer; font-family: inherit; transition: all .15s;
  display: inline-flex; align-items: center; gap: .35rem;
}
.ue-btn-small:hover { border-color: #0ea5e9; color: #0284c7; background: #f0f9ff; }
.ue-btn-small.primary {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff; border-color: transparent;
}
.ue-btn-small.primary:hover { opacity: .88; }
.ue-btn-small.danger { border-color: #fecaca; color: #ef4444; }
.ue-btn-small.danger:hover { background: #fef2f2; }

/* Compare Table */
.ue-compare-table-wrap { overflow-x: auto; }
.ue-compare-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ue-compare-table th {
  background: #f8fafc; padding: .55rem .75rem; text-align: left;
  font-size: .7rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 2px solid #e2e8f0;
}
.ue-compare-table td {
  padding: .55rem .75rem; border-bottom: 1px solid #f1f5f9;
  color: #334155; word-break: break-all;
}
.ue-compare-table tr:last-child td { border-bottom: none; }

/* API Builder */
.ue-api-row { margin-bottom: .5rem; }
.ue-api-param-row {
  display: flex; gap: .4rem; margin-bottom: .4rem; align-items: center;
}
.ue-api-param-row .api-remove-btn { flex-shrink: 0; }
.ue-api-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Encoding Reference */
.ue-encoding-ref {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
}
.ue-ref-item {
  background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 8px;
  padding: .5rem .75rem; font-size: .78rem;
}
.ue-ref-char {
  font-weight: 800; color: #0f172a; font-family: monospace; font-size: 1rem;
  margin-right: .4rem;
}
.ue-ref-code { color: #2563eb; font-family: monospace; font-weight: 600; }
.ue-ref-name { color: #94a3b8; font-size: .7rem; display: block; margin-top: .1rem; }

/* ── UTM Builder Tab ───────────────────────────────────────────── */
.ue-utm-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 1.5rem;
}
.ue-utm-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin-bottom: 1rem;
}
.ue-utm-field { display: flex; flex-direction: column; gap: .25rem; }
.ue-utm-field:first-child { grid-column: 1 / -1; }
.ue-required { color: #ef4444; }
.ue-hint { font-size: .7rem; color: #94a3b8; }
.ue-utm-output {
  background: #f0fdf4; border: 1.5px solid #bbf7d0; border-radius: 12px;
  padding: 1rem 1.25rem; margin-top: 1rem;
}
.ue-utm-result-row { display: flex; gap: .5rem; margin-top: .35rem; }
.ue-utm-preview {
  margin-top: .75rem; font-size: .78rem; color: #475569; word-break: break-all;
  font-family: 'Courier New', monospace; line-height: 1.7;
}
.ue-utm-actions { display: flex; gap: .65rem; flex-wrap: wrap; }

/* ── Playground Tab ────────────────────────────────────────────── */
.ue-play-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 1.25rem; margin-bottom: 1rem;
}
.ue-play-input {
  width: 100%; border: 2px solid #e2e8f0; border-radius: 12px;
  padding: .85rem 1rem; font-size: 1.25rem; font-weight: 600;
  color: #1e293b; outline: none; font-family: inherit;
  background: #f8fafc; transition: border-color .15s;
  text-align: center; letter-spacing: .05em; margin-bottom: 1rem;
}
.ue-play-input:focus { border-color: #0ea5e9; background: #fff; }
.ue-play-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .65rem;
}
.ue-play-result-card {
  background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 10px;
  padding: .75rem 1rem;
}
.ue-play-method { font-size: .72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.ue-play-output {
  font-family: 'Courier New', monospace; font-size: .9rem;
  font-weight: 600; color: #1e293b; margin-top: .25rem; word-break: break-all;
}

/* Common Encodings Reference */
.ue-ref-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .5rem;
}
.ue-ref-card {
  background: #f8fafc; border: 1px solid #f1f5f9; border-radius: 8px;
  padding: .5rem; text-align: center;
}
.ue-ref-card-char {
  font-size: 1.1rem; font-weight: 800; color: #0f172a;
}
.ue-ref-card-enc {
  font-size: .75rem; font-weight: 700; color: #2563eb;
  font-family: monospace; margin-top: .15rem;
}
.ue-ref-card-name {
  font-size: .65rem; color: #94a3b8; margin-top: .1rem;
}

/* ── Modals ─────────────────────────────────────────────────────── */
.ue-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.ue-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.ue-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem 1.35rem; border-bottom: 1px solid #e2e8f0;
}
.ue-modal-header h3 {
  font-size: .95rem; font-weight: 700; color: #0f172a;
  display: flex; align-items: center; gap: .4rem; margin: 0;
}
.ue-modal-header h3 .bi { color: #0ea5e9; }
.ue-modal-close {
  background: none; border: none; font-size: 1.4rem; color: #94a3b8;
  cursor: pointer; padding: 0; line-height: 1;
}
.ue-modal-close:hover { color: #ef4444; }
.ue-modal-body {
  padding: 1.25rem 1.35rem; overflow-y: auto; flex: 1;
}
.ue-modal-footer {
  padding: .85rem 1.35rem; border-top: 1px solid #e2e8f0;
  display: flex; justify-content: flex-end;
}

/* Keyboard Shortcuts */
.ue-shortcut-list { display: flex; flex-direction: column; gap: .5rem; }
.ue-shortcut {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; color: #475569;
}
.ue-shortcut kbd {
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px;
  padding: .15rem .4rem; font-size: .75rem; font-weight: 700; color: #1e293b;
  font-family: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.ue-shortcut span { margin-left: auto; color: #94a3b8; font-weight: 500; }

/* History Items */
.ue-history-item {
  display: flex; flex-direction: column; gap: .25rem;
  background: #f8fafc; border-radius: 10px; padding: .75rem;
  margin-bottom: .5rem; cursor: pointer; transition: background .15s;
}
.ue-history-item:hover { background: #f0f9ff; }
.ue-history-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .7rem; color: #94a3b8;
}
.ue-history-type {
  font-size: .65rem; font-weight: 700; border-radius: 5px;
  padding: .1rem .4rem;
}
.ue-history-type.encode { background: #eff6ff; color: #2563eb; }
.ue-history-type.decode { background: #f0fdf4; color: #16a34a; }
.ue-history-text {
  font-size: .78rem; color: #1e293b; font-family: monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Toast ──────────────────────────────────────────────────────── */
.ue-toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .5rem; z-index: 10000;
}
.ue-toast {
  background: #0f172a; color: #fff; padding: .65rem 1.1rem;
  border-radius: 10px; font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: ue-slideIn .25s ease;
  max-width: 320px;
}
.ue-toast .bi { font-size: 1rem; }
.ue-toast.success .bi { color: #22c55e; }
.ue-toast.error .bi { color: #ef4444; }
.ue-toast.info .bi { color: #0ea5e9; }
@keyframes ue-slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── SEO Content Sections ──────────────────────────────────────── */
.ue-content-section { background: #fff; padding: 4rem 0; }
.ue-content-section:nth-child(even) { background: #f8fafc; }
.ue-section-badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: #2563eb;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 99px;
  padding: .22rem .75rem; margin-bottom: .65rem;
}
.ue-section-h2 { font-size: 1.6rem; font-weight: 800; color: #0f172a; margin-bottom: .6rem; }
.ue-section-lead { font-size: 1rem; color: #475569; line-height: 1.75; }

/* Steps */
.ue-step-card {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 16px;
  padding: 1.5rem; text-align: center; height: 100%;
  transition: box-shadow .2s;
}
.ue-step-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.ue-step-num {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-radius: 14px; color: #fff; font-size: 1.1rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .85rem;
}
.ue-step-title { font-size: .95rem; font-weight: 700; color: #0f172a; margin-bottom: .35rem; }
.ue-step-desc { font-size: .83rem; color: #64748b; margin: 0; }

/* Guide Table */
.ue-guide-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ue-guide-table th {
  background: #f8fafc; padding: .6rem .8rem; text-align: left;
  font-size: .72rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 2px solid #e2e8f0;
}
.ue-guide-table td {
  padding: .6rem .8rem; border-bottom: 1px solid #f1f5f9;
  color: #334155; font-family: 'Courier New', monospace; font-weight: 600;
}
.ue-guide-table td:first-child { font-family: 'Courier New', monospace; font-weight: 800; }
.ue-guide-table tr:last-child td { border-bottom: none; }
.ue-guide-table tr:hover td { background: #f8fafc; }

/* Tip Cards */
.ue-tip-card {
  border-radius: 14px; padding: 1.25rem; height: 100%;
}
.ue-tip-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .35rem; }
.ue-tip-card p { font-size: .83rem; margin: 0; }
.ue-tip-card.green { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.ue-tip-card.green h3 { color: #15803d; }
.ue-tip-card.blue { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.ue-tip-card.blue h3 { color: #1d4ed8; }
.ue-tip-card.purple { background: #f5f3ff; border: 1px solid #e9d5ff; color: #6d28d9; }
.ue-tip-card.purple h3 { color: #7c3aed; }

/* Trust */
.ue-trust-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.ue-trust-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
  padding: 1.25rem; text-align: center;
}
.ue-trust-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem; border-radius: 14px; font-size: 1.5rem;
}
.ue-trust-icon.blue { background: #eff6ff; color: #2563eb; }
.ue-trust-icon.green { background: #f0fdf4; color: #16a34a; }
.ue-trust-icon.purple { background: #f5f3ff; color: #7c3aed; }
.ue-trust-icon.orange { background: #fff7ed; color: #c2410c; }
.ue-trust-h { font-size: .875rem; font-weight: 700; color: #0f172a; margin-bottom: .3rem; }
.ue-trust-p { font-size: .8rem; color: #64748b; }

/* FAQ */
.ue-faq-item {
  border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
  margin-bottom: .65rem;
}
.ue-faq-q {
  width: 100%; background: #fff; border: none; padding: 1rem 1.25rem;
  text-align: left; font-size: .9rem; font-weight: 600; color: #1e293b;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-family: inherit; transition: background .15s;
}
.ue-faq-q:hover { background: #f8fafc; }
.ue-faq-q .bi { transition: transform .25s; color: #94a3b8; flex-shrink: 0; font-size: .85rem; }
.ue-faq-item.open .ue-faq-q .bi { transform: rotate(180deg); }
.ue-faq-a {
  max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s;
  background: #f8fafc; border-top: 1px solid transparent;
  font-size: .875rem; color: #475569; line-height: 1.75; padding: 0 1.25rem;
}
.ue-faq-item.open .ue-faq-a {
  max-height: 500px; padding: 1rem 1.25rem; border-top-color: #f1f5f9;
}

/* Related Tools Links */
.ue-ilinks-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem;
}
.ue-ilink-card {
  background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
  padding: .85rem 1rem; text-decoration: none; transition: all .2s;
  display: flex; align-items: center; gap: .6rem;
}
.ue-ilink-card:hover {
  border-color: #0ea5e9; background: #f0f9ff;
  box-shadow: 0 4px 16px rgba(14,165,233,.1); text-decoration: none;
}
.ue-ilink-icon {
  width: 36px; height: 36px; background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ue-ilink-icon .bi { font-size: .9rem; color: #fff; }
.ue-ilink-text strong { display: block; font-size: .8rem; font-weight: 700; color: #1e293b; }
.ue-ilink-text span { font-size: .72rem; color: #94a3b8; }

/* ── Dark Mode ─────────────────────────────────────────────────── */
body.ue-dark {
  --color-bg: #0f172a;
  --color-bg-soft: #1e293b;
  --color-text-main: #f1f5f9;
  --color-text-body: #cbd5e1;
  --color-border: #334155;
}
body.ue-dark { background: #0f172a; color: #cbd5e1; }
body.ue-dark .ue-hero { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); }
body.ue-dark .ue-headline { color: #f1f5f9; }
body.ue-dark .ue-subhead { color: #94a3b8; }
body.ue-dark .ue-badge { background: #1e293b; border-color: #334155; color: #cbd5e1; }
body.ue-dark .ue-tool-section { background: #0f172a; border-color: #1e293b; }
body.ue-dark .ue-tabs { background: #1e293b; border-color: #334155; }
body.ue-dark .ue-tab { color: #94a3b8; }
body.ue-dark .ue-tab:hover { background: #334155; color: #e2e8f0; }
body.ue-dark .ue-tab.active { color: #fff; }
body.ue-dark .ue-controls-row { background: #1e293b; border-color: #334155; }
body.ue-dark .ue-control-label { color: #64748b; }
body.ue-dark .ue-select { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.ue-dark .ue-toggle-inline { color: #94a3b8; }
body.ue-dark .ue-textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.ue-dark .ue-textarea[readonly] { background: #0f172a; }
body.ue-dark .ue-textarea:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
body.ue-dark .ue-io-label { color: #64748b; }
body.ue-dark .ue-mini-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.ue-dark .ue-mini-btn:hover { border-color: #0ea5e9; color: #0ea5e9; background: #0f3460; }
body.ue-dark .ue-btn-decode { background: #1e293b; color: #38bdf8; border-color: #334155; }
body.ue-dark .ue-btn-swap { border-color: #334155; color: #94a3b8; }
body.ue-dark .ue-highlight-panel { background: #1e293b; border-color: #334155; }
body.ue-dark .ue-highlight-header { color: #e2e8f0; }
body.ue-dark .ue-hl-normal { color: #e2e8f0; }
body.ue-dark .ue-quick-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.ue-dark .ue-quick-btn:hover { border-color: #0ea5e9; color: #0ea5e9; }
body.ue-dark .ue-result-card,
body.ue-dark .ue-dev-card,
body.ue-dark .ue-play-card,
body.ue-dark .ue-utm-card {
  background: #1e293b; border-color: #334155;
}
body.ue-dark .ue-result-title { color: #f1f5f9; }
body.ue-dark .ue-input-full,
body.ue-dark .ue-input-half {
  background: #0f172a; border-color: #334155; color: #e2e8f0;
}
body.ue-dark .ue-struct-value { background: #0f172a; color: #e2e8f0; }
body.ue-dark .ue-param-table th { background: #0f172a; color: #64748b; border-color: #334155; }
body.ue-dark .ue-param-table td { border-color: #334155; color: #cbd5e1; }
body.ue-dark .ue-compare-table th { background: #0f172a; color: #64748b; border-color: #334155; }
body.ue-dark .ue-compare-table td { border-color: #334155; color: #cbd5e1; }
body.ue-dark .ue-play-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.ue-dark .ue-play-result-card { background: #0f172a; border-color: #334155; }
body.ue-dark .ue-play-output { color: #e2e8f0; }
body.ue-dark .ue-ref-card { background: #0f172a; border-color: #334155; }
body.ue-dark .ue-ref-card-char { color: #e2e8f0; }
body.ue-dark .ue-metric-card { background: #0f172a; border-color: #334155; }
body.ue-dark .ue-metric-num { color: #e2e8f0; }
body.ue-dark .ue-topbar-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.ue-dark .ue-modal { background: #1e293b; }
body.ue-dark .ue-modal-header { border-color: #334155; }
body.ue-dark .ue-modal-header h3 { color: #f1f5f9; }
body.ue-dark .ue-modal-footer { border-color: #334155; }
body.ue-dark .ue-history-item { background: #0f172a; }
body.ue-dark .ue-history-item:hover { background: #334155; }
body.ue-dark .ue-history-text { color: #e2e8f0; }
body.ue-dark .ue-shortcut kbd { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.ue-dark .ue-shortcut span { color: #64748b; }
body.ue-dark .ue-utm-output { background: #0f3460; border-color: #1e40af; }
body.ue-dark .ue-content-section { background: #0f172a; }
body.ue-dark .ue-content-section:nth-child(even) { background: #1e293b; }
body.ue-dark .ue-section-h2 { color: #f1f5f9; }
body.ue-dark .ue-section-lead { color: #94a3b8; }
body.ue-dark .ue-step-card { background: #1e293b; border-color: #334155; }
body.ue-dark .ue-step-title { color: #f1f5f9; }
body.ue-dark .ue-step-desc { color: #94a3b8; }
body.ue-dark .ue-guide-table th { background: #0f172a; border-color: #334155; color: #64748b; }
body.ue-dark .ue-guide-table td { border-color: #334155; color: #cbd5e1; }
body.ue-dark .ue-trust-card { background: #1e293b; border-color: #334155; }
body.ue-dark .ue-trust-h { color: #f1f5f9; }
body.ue-dark .ue-faq-item { border-color: #334155; }
body.ue-dark .ue-faq-q { background: #1e293b; color: #e2e8f0; }
body.ue-dark .ue-faq-q:hover { background: #334155; }
body.ue-dark .ue-faq-a { background: #0f172a; border-color: #334155; color: #94a3b8; }
body.ue-dark .ue-ilink-card { background: #1e293b; border-color: #334155; }
body.ue-dark .ue-ilink-card:hover { background: #334155; border-color: #0ea5e9; }
body.ue-dark .ue-ilink-text strong { color: #e2e8f0; }
body.ue-dark .navbar { background: #0f172a !important; border-bottom: 1px solid #1e293b; }
body.ue-dark .navbar .nav-link { color: #94a3b8; }
body.ue-dark .navbar .navbar-brand { color: #fff; }
body.ue-dark .ue-desc { color: #94a3b8; }
body.ue-dark .ue-ref-item { background: #0f172a; border-color: #334155; }
body.ue-dark .ue-ref-name { color: #64748b; }
body.ue-dark .ue-encoding-ref .ue-ref-item { background: #0f172a; }
body.ue-dark .ue-warn-item { background: #422006; border-color: #854d0e; color: #fbbf24; }
body.ue-dark .ue-warn-item .bi { color: #fbbf24; }
body.ue-dark .ue-warn-item.error { background: #450a0a; border-color: #991b1b; color: #fca5a5; }
body.ue-dark .ue-warn-item.info { background: #0c4a6e; border-color: #075985; color: #7dd3fc; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .ue-io-wrap {
    grid-template-columns: 1fr;
  }
  .ue-center-actions {
    flex-direction: row; justify-content: center;
    padding: .5rem 0;
  }
  .ue-utm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .ue-hero { padding: 2rem 0 1.5rem; }
  .ue-tabs { gap: .25rem; }
  .ue-tab { font-size: .75rem; padding: .45rem .7rem; }
  .ue-controls-row { flex-direction: column; gap: .65rem; }
  .ue-select { min-width: 100%; }
  .ue-quick-row { gap: .35rem; }
  .ue-quick-btn { font-size: .7rem; padding: .3rem .6rem; }
  .ue-export-group { margin-left: 0; }
  .ue-structure-grid { grid-template-columns: 1fr; }
  .ue-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .ue-play-results { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ue-tab { font-size: .7rem; padding: .35rem .5rem; }
  .ue-tab .bi { display: none; }
}
