:root {
  --bg: #f6f7f9; --surface: #ffffff; --ink: #0f172a; --muted: #5b6474; --line: #e3e6eb;
  --accent: #0e7c66; --accent-ink: #ffffff; --accent-soft: #e3f3ef; --danger: #b42318;
  --radius: 12px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --surface: #161b22; --ink: #e6edf3; --muted: #9aa4b2; --line: #2a313c;
          --accent: #3fb68f; --accent-ink: #0d1117; --accent-soft: #15302a; --danger: #f97066; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; }
.wrap { max-width: 880px; margin: 0 auto; padding: 48px 20px 64px; }
.center { min-height: 100vh; display: grid; place-items: center; }
header.top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
header.top h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.01em; }
header.top nav a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: .95rem; }
header.top nav a:hover { color: var(--ink); }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 60ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
form.shorten { display: flex; gap: 10px; }
form.shorten input { flex: 1; min-width: 0; font: inherit; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
form.shorten input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 12px 18px; border-radius: 10px; border: 1px solid transparent; background: var(--accent);
  color: var(--accent-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); padding: 8px 12px; font-weight: 500; font-size: .92rem; }
.btn.ghost:hover { border-color: var(--accent); }
.error { color: var(--danger); margin: 12px 0 0; min-height: 1.4em; }
.result { margin-top: 20px; display: none; }
.result.show { display: block; }
.short-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px;
  border-radius: 10px; background: var(--accent-soft); }
.short-row a { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; word-break: break-all; flex: 1; }
.meta { color: var(--muted); font-size: .9rem; margin: 10px 2px 0; }
.meta .orig { word-break: break-all; }
.qrs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.qr { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.qr h3 { margin: 0 0 4px; font-size: 1rem; }
.qr p { margin: 0 0 12px; color: var(--muted); font-size: .85rem; }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; border-radius: 8px; padding: 6px; }
.qr .actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
footer { color: var(--muted); font-size: .85rem; margin-top: 32px; }
@media (max-width: 560px) { form.shorten { flex-direction: column; } }
