:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c1f24;
  --muted: #5f6672;
  --border: #d6dae1;
  --accent: #2456c4;
  --accent-text: #ffffff;
  --removed: #8a3b12;
  --removed-bg: #fff3ea;
  --error: #b3261e;
  --error-bg: #fdecec;
  --ok: #1e7b46;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1e2126;
    --text: #e8eaee;
    --muted: #9aa2ad;
    --border: #363b44;
    --accent: #6c95f2;
    --accent-text: #0e1220;
    --removed: #f0b48c;
    --removed-bg: #2b2119;
    --error: #f28b82;
    --error-bg: #2d1b1b;
    --ok: #7ed3a0;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
h1 { font-size: 1.75rem; margin: 0 0 0.25rem; }
.tagline { color: var(--muted); margin: 0 0 1.5rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
label { display: block; }
.field-label { font-weight: 600; margin-bottom: 0.35rem; }
input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.options { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 0.75rem; color: var(--muted); }
.options label { display: inline-flex; align-items: center; gap: 0.4rem; }
button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
button:hover { filter: brightness(1.05); }
.link-row { display: flex; gap: 0.5rem; align-items: stretch; }
.link-row output {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.link-row a { color: var(--accent); text-decoration: none; }
.link-row a:hover { text-decoration: underline; }
.stats { color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 0; }
.copied { color: var(--ok); }
.sub-title { margin: 1rem 0 0.35rem; font-weight: 600; }
.link-row output.stripped { font-size: 0.9rem; }
.stripped a { color: var(--text); text-decoration: none; }
.stripped a:hover { text-decoration: underline; }
#removed { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
#removed li {
  background: var(--removed-bg);
  color: var(--removed);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}
#error { background: var(--error-bg); color: var(--error); border-radius: 8px; padding: 0.75rem 1rem; }
.loading { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.spinner {
  width: 1rem; height: 1rem; flex: none;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }
#decoding a { color: var(--accent); overflow-wrap: anywhere; }
footer { color: var(--muted); font-size: 0.85rem; margin-top: 2rem; }
