/* Urdu Nastaliq Font (Mehr by Trivx). Font files: fonts/ (web) and files/ (downloads via api.php). */
@font-face {
  font-family: "Mehr by Trivx";
  src: url("fonts/MehrByTrivx-arabic.woff2?v=2.1") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0020, U+00A0, U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF,
                 U+200C-200F, U+2010, U+2013-2014, U+2018-2019, U+201C-201D, U+2026, U+25CC;
}
@font-face {
  font-family: "Mehr by Trivx";
  src: url("fonts/MehrByTrivx-latin.woff2?v=2.1") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0021-009F, U+00A1-024F, U+2030-206F, U+20AC, U+2122;
}

#tool { --ur: "Mehr by Trivx", "Noto Nastaliq Urdu", serif; }
#tool [lang="ur"] { font-family: var(--ur); font-weight: 400; }
.mk-k { font-feature-settings: "ss01" 1; }

.unf-sample { text-align: center; font-size: clamp(48px, 10vw, 96px); line-height: 1.9; margin: -6px 0 6px; }

.unf-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; }
.unf-size { display: flex; align-items: center; gap: 10px; min-width: 220px; flex: 0 1 280px; }
.unf-size .label { margin: 0; }
.unf-size input { flex: 1; accent-color: var(--brand); }
.unf-size b { font-weight: 500; font-size: .85rem; color: var(--muted); min-width: 40px; text-align: right; }

/* input and preview: the same box, side by side, both scroll inside */
.unf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.unf-grid > * { min-width: 0; }
@media (max-width: 760px) { .unf-grid { grid-template-columns: 1fr; } }
.unf-box {
  --fs: 28px;
  display: block; width: 100%; height: 320px; margin: 0; overflow-y: auto; resize: none;
  padding: 6px 16px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--fg);
  font-family: var(--ur); font-size: var(--fs); line-height: 2.3;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
@media (max-width: 760px) { .unf-box { height: 240px; } }
textarea.unf-box:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in oklab, var(--fg) 12%, transparent); }

.unf-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.unf-dl > * { min-width: 0; }
@media (max-width: 760px) { .unf-dl { grid-template-columns: 1fr; } }
.unf-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface-2); }
.unf-ai { background: linear-gradient(135deg, color-mix(in oklab, var(--brand) 14%, var(--surface-2)), var(--surface-2));
          border-color: color-mix(in oklab, var(--brand) 40%, var(--line)); }
.unf-small { font-size: .88rem; line-height: 1.55; }
.unf-small a { text-decoration: underline; text-underline-offset: 3px; }

.unf-glyphs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 22px; font-size: 34px; line-height: 2; }
.unf-glyphs span { padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.unf-glyphs .unf-bism { flex-basis: 100%; text-align: center; font-size: clamp(34px, 7vw, 56px); border: 0; background: none; }
