@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700 800;
  font-display: optional;
  src: url("/static/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700 800;
  font-display: optional;
  src: url("/static/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #eef1f6;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #8a93a6;
  --line: #e2e6ee;
  --accent: #2f6fed;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px;
  flex: 1 0 auto;
}
.wrap.center { text-align: center; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.brand span {
  background: linear-gradient(90deg, #2f6fed 0%, #5a92ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.wrap.center .brand { justify-content: center; }
.lead {
  color: var(--muted);
  margin: 0 0 22px;
  /* max-width: 520px; */
}
.row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
input[type="url"] {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 15px;
  outline: none;
}
input[type="url"]:focus { border-color: var(--accent); }
button {
  padding: 13px 20px;
  border: 0;
  border-radius: var(--radius);
  background: #dfe4ee;
  color: #5b6478;
  font-size: 15px;
  cursor: pointer;
}
button:focus { outline: none; }
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.row button {
  background: #e7ebf3;
  color: #8a93a6;
  min-width: 132px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.row button.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 111, 237, .28);
}
.row button.is-active:hover { filter: brightness(1.04); }
.row button.is-active:active { transform: translateY(1px); }
.row button:disabled {
  cursor: not-allowed;
  filter: none;
}
.row button.is-loading {
  background: #cdd7ef;
  color: transparent;
  box-shadow: none;
}
.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(47, 111, 237, .35);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
button:hover { filter: brightness(0.97); }
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 6px 24px rgba(31, 36, 48, .06);
}
.card.hidden { display: none; }
.result-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.result-main { flex: 1; min-width: 0; }
.link-line { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; min-width: 0; }
.link-line a.short {
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.link-line a.short:hover { color: var(--accent); }
.chain { color: var(--accent); flex: none; }
.actions { display: flex; align-items: center; gap: 10px; }
.btn-copy {
  background: #eef1f6;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.btn-copy .kbd { color: var(--muted); font-weight: 500; margin-left: 6px; }
.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef1f6;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #5b6478;
}
.btn-copy:hover, .icon-btn:hover { background: #e4e9f1; filter: none; }
.qr { border-radius: 10px; flex: none; }
.error { color: #c0392b; margin: 0 0 16px; }
.home { color: var(--accent); text-decoration: none; }
.spinner {
  width: 34px; height: 34px; margin: 20px auto;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.site-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 32px;
}
.site-footer hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 16px;
}
.site-footer .copy {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

/* Friendly toast notification (replaces native alert). */
.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translate(-50%, -16px);
  max-width: min(92vw, 420px);
  padding: 13px 18px;
  border-radius: 12px;
  background: #1f2430;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(31, 36, 48, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast--error { background: #c0392b; }

/* QR preview modal (shown on phones where the inline QR is hidden). */
body.modal-open { overflow: hidden; }
.qr-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 36, 48, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 60;
}
.qr-modal.is-visible { opacity: 1; pointer-events: auto; }
.qr-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(31, 36, 48, .3);
  transform: translateY(8px) scale(.98);
  transition: transform .2s ease;
}
.qr-modal.is-visible .qr-modal__panel { transform: translateY(0) scale(1); }
.qr-modal__img {
  width: 240px;
  height: 240px;
  border-radius: 10px;
  image-rendering: pixelated;
}
.qr-modal__download {
  padding: 11px 20px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.qr-modal__download:hover { filter: brightness(1.04); }
.qr-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  border-radius: 10px;
}
.qr-modal__close:hover { background: #eef1f6; filter: none; }

@media (max-width: 560px) {
  .wrap { padding: 32px 16px; }
  .brand { font-size: 26px; }
  .row { flex-wrap: wrap; }
  .row input[type="url"] { flex: 1 1 100%; }
  .row button { flex: 1 1 100%; min-width: 0; }
  .card { padding: 18px; }
  .result-inner { gap: 16px; }
  .qr { display: none; }
  .actions { flex-wrap: wrap; }
  .btn-copy { flex: 1 1 auto; text-align: center; }
  .link-line a.short { font-size: 18px; }

  /* Full-width toast bar on mobile so text isn't squeezed into a narrow column. */
  .toast {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
    transform: translateY(-16px);
    text-align: center;
  }
  .toast.is-visible { transform: translateY(0); }
}
