/* PHL Tools design system. Light first, optional dark theme. No third-party resources. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("../fonts/noto-nastaliq-urdu-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC;
}

:root {
  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-nastaliq: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", "Segoe UI", serif;
  --font-naskh: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma, Arial, sans-serif;

  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --text: #0e2238;
  --text-2: #43566d;
  --line: #d5dee9;
  --line-strong: #b4c3d6;
  --primary: #1f5fd0;
  --primary-hover: #164aa6;
  --primary-wash: #e6effd;
  --on-primary: #ffffff;
  --accent: #0a7564;
  --accent-wash: #e2f4f0;
  --danger: #b42318;
  --danger-wash: #fdecea;
  --focus: #1f5fd0;
  --header-bg: #0e2238;
  --header-text: #f3f7fc;
  --header-muted: #aebfd3;
  --hero-bg: #dde8f6;
  --hero-line: rgba(14, 34, 56, 0.06);
  --shadow: 0 1px 2px rgba(14, 34, 56, 0.06), 0 6px 20px -8px rgba(14, 34, 56, 0.18);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --gap: 16px;
  --header-h: 64px;
}

:root[data-theme="dark"] {
  --bg: #0b1522;
  --surface: #122033;
  --surface-2: #172a41;
  --text: #e6edf6;
  --text-2: #a9b9cc;
  --line: #263a54;
  --line-strong: #37506f;
  --primary: #79a8ff;
  --primary-hover: #a4c3ff;
  --primary-wash: #16335f;
  --on-primary: #0b1522;
  --accent: #4cc9b0;
  --accent-wash: #11332f;
  --danger: #ff9a90;
  --danger-wash: #3a1a18;
  --focus: #9dc0ff;
  --header-bg: #08111c;
  --header-text: #f3f7fc;
  --header-muted: #9fb2c9;
  --hero-bg: #0f1d2f;
  --hero-line: rgba(255, 255, 255, 0.045);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -10px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
kbd {
  font: 600 0.78rem/1 var(--font);
  padding: 0.18rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 700px) { .wrap { padding-inline: 24px; } }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sr-copy { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: var(--r-sm); border: 2px solid var(--primary); transition: top 0.15s; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-header { background: var(--header-bg); color: var(--header-text); position: relative; z-index: 30; }
.site-header .bar { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--header-text); text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; flex: none; display: block; }
.brand-mark img { width: 40px; height: 40px; display: block; border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-by { font-size: 0.72rem; color: var(--header-muted); }
.main-nav { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav a { color: var(--header-text); text-decoration: none; padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500; font-size: 0.95rem; display: block; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.1); color: #fff; }
@media (min-width: 1100px) { .main-nav { display: block; } }

.hdr-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; min-width: 40px; justify-content: center; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid rgba(255, 255, 255, 0.22); background: transparent; color: var(--header-text); font: 500 0.9rem var(--font); cursor: pointer; }
.hdr-btn:hover { background: rgba(255, 255, 255, 0.1); }
.hdr-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hdr-btn:focus-visible, .site-header a:focus-visible, .site-header input:focus-visible { outline-color: #fff; }
.search-toggle { display: inline-flex; }
@media (min-width: 1100px) { .search-toggle { display: none; } }
.theme-btn .moon { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .moon { display: block; }

.site-search { position: relative; order: 10; flex: 1 0 100%; display: none; }
.site-header.search-open .site-search { display: block; padding-bottom: 10px; }
@media (min-width: 1100px) { .site-search { display: block; order: 0; flex: 0 1 280px; padding-bottom: 0 !important; } }
.site-header .site-search input[type="search"] { width: 100%; min-height: 40px; border-radius: var(--r-sm); border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.09); color: #fff; padding: 0 12px 0 38px; font: 400 0.95rem var(--font); }
.site-header .site-search input[type="search"]::placeholder { color: var(--header-muted); }
.site-search .s-icon { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; stroke: var(--header-muted); fill: none; stroke-width: 1.9; stroke-linecap: round; pointer-events: none; }
.site-search .results { position: absolute; z-index: 50; left: 0; right: 0; top: 46px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow: auto; }
@media (max-width: 1099px) { .site-search .results { top: 44px; } }
.search-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.search-item span { color: var(--text-2); font-size: 0.85rem; }
.search-item:hover, .search-item.is-active { background: var(--primary-wash); color: var(--text); }
.search-empty { padding: 10px 12px; color: var(--text-2); }

/* ---------- buttons, fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 0.92rem var(--font); cursor: pointer; text-decoration: none; transition: background 0.12s, border-color 0.12s; }
.btn:hover { background: var(--surface-2); border-color: var(--text-2); color: var(--text); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; }
@media (pointer: coarse) { .btn { min-height: 44px; } }

label, .label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 6px; }
.hint { color: var(--text-2); font-size: 0.85rem; font-weight: 400; }
textarea, input[type="text"], input[type="number"], input[type="search"], select {
  width: 100%; font: 400 1rem/1.5 var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px;
}
textarea { min-height: 190px; resize: vertical; display: block; tab-size: 4; }
textarea[readonly] { background: var(--surface-2); }
select { min-height: 40px; padding-block: 6px; }
input[type="text"], input[type="number"], input[type="search"] { min-height: 40px; }
@media (pointer: coarse) { select, input[type="text"], input[type="number"], input[type="search"] { min-height: 44px; } }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin: 0; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; margin: 0; padding: 5px 0; cursor: pointer; }
.check small { display: block; color: var(--text-2); font-weight: 400; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.chips legend { font-weight: 600; font-size: 0.92rem; padding: 0; margin-bottom: 8px; }
.chip-radio { position: relative; margin: 0; font-weight: 600; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 0.9rem; }
.chip-radio input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-radio input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (pointer: coarse) { .chip-radio span { min-height: 44px; } }

.alert { border-radius: var(--r-sm); padding: 10px 12px; font-size: 0.92rem; margin: 0 0 12px; }
.alert-error { background: var(--danger-wash); color: var(--danger); border: 1px solid var(--danger); }
.status { color: var(--text-2); font-size: 0.9rem; min-height: 1.4em; margin: 8px 0 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 90; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 700px) { .toasts { left: 20px; right: auto; bottom: 20px; align-items: flex-start; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--header-bg); color: var(--header-text); border-radius: var(--r-md); padding: 10px 12px 10px 16px; box-shadow: var(--shadow); max-width: min(92vw, 460px); font-size: 0.93rem; border-left: 4px solid var(--primary); }
.toast-success { border-left-color: #2fb37a; }
.toast-error { border-left-color: #ff7b6e; }
.toast-action { background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; border-radius: var(--r-sm); padding: 4px 10px; font: 600 0.85rem var(--font); cursor: pointer; }
.toast-close { background: transparent; border: 0; color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; opacity: 0.8; }
.toast :focus-visible { outline-color: #fff; }

/* ---------- homepage ---------- */
.hero { background: var(--hero-bg); background-image: linear-gradient(var(--hero-line) 1px, transparent 1px), linear-gradient(90deg, var(--hero-line) 1px, transparent 1px); background-size: 28px 28px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 24px; padding-block: 28px 32px; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 44px 48px; } .hero-copy { order: 2; } .quick { order: 1; } }
.hero-copy p.lede { font-size: 1.08rem; color: var(--text-2); max-width: 36em; }
.hero-search { position: relative; margin: 18px 0 14px; }
.hero-search input { min-height: 54px; padding: 0 48px 0 46px; font-size: 1.05rem; border-radius: var(--r-md); border-color: var(--line-strong); box-shadow: var(--shadow); }
.hero-search .s-icon { position: absolute; left: 15px; top: 16px; width: 22px; height: 22px; stroke: var(--text-2); fill: none; stroke-width: 1.9; stroke-linecap: round; pointer-events: none; }
.hero-search .clear { position: absolute; right: 6px; top: 7px; min-height: 40px; min-width: 40px; border: 0; background: transparent; font-size: 1.4rem; color: var(--text-2); cursor: pointer; border-radius: var(--r-sm); }
.try-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.try-links a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 0.9rem; font-weight: 500; color: var(--text); }
.try-links a:hover { border-color: var(--primary); color: var(--primary); }

.quick { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.quick-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.quick-head h2 { margin: 0; font-size: 1rem; }
.quick-head a { font-size: 0.9rem; font-weight: 600; }
.quick-body { display: grid; gap: 0; }
@media (min-width: 560px) { .quick-body { grid-template-columns: 1fr 1fr; } }
.quick-pane { padding: 14px 16px 16px; }
.quick-pane + .quick-pane { border-top: 1px solid var(--line); }
@media (min-width: 560px) { .quick-pane + .quick-pane { border-top: 0; border-left: 1px solid var(--line); } }
.quick textarea { min-height: 150px; border: 0; padding: 0; background: transparent; resize: none; font-size: 1.1rem; }
.quick textarea:focus-visible { outline-offset: 6px; }
.quick-out { min-height: 150px; direction: rtl; unicode-bidi: isolate; text-align: right; font: 400 1.7rem/2.2 var(--font-nastaliq); white-space: pre-wrap; overflow-wrap: anywhere; }
.quick-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.quick-foot .hint { margin: 0; }

.section { padding-block: 40px; }
.section-head { max-width: 46em; margin-bottom: 20px; }
.section-head p { color: var(--text-2); margin: 0; }
.popular-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .popular-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .popular-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pop-card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--text); transition: border-color 0.12s, transform 0.12s; }
.pop-card:hover { border-color: var(--primary); color: var(--text); }
.pop-card .ico { width: 36px; height: 36px; color: var(--primary); }
.pop-card strong { font-size: 1.02rem; line-height: 1.25; }
.pop-card span { font-size: 0.85rem; color: var(--text-2); line-height: 1.4; }
.ico { display: block; width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.directory { background: var(--surface); border-block: 1px solid var(--line); }
.dir-grid { display: grid; gap: 28px 32px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .dir-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cat-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-wash); color: var(--primary); display: grid; place-items: center; flex: none; }
.cat-ico .ico { width: 26px; height: 26px; }
.cat-head h3 { margin: 0; font-size: 1.1rem; }
.cat-head h3 a { color: var(--text); text-decoration: none; }
.cat-head h3 a:hover { color: var(--primary); text-decoration: underline; }
.cat-intro { color: var(--text-2); font-size: 0.9rem; margin: 0 0 6px; }
.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li { border-top: 1px solid var(--line); }
.tool-list a { display: block; padding: 10px 2px; text-decoration: none; font-weight: 600; }
.tool-list a:hover { text-decoration: underline; }
.tool-list a span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--text-2); line-height: 1.4; }
.empty-state { text-align: center; padding: 36px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--text-2); }
.empty-state strong { display: block; color: var(--text); font-size: 1.1rem; margin-bottom: 4px; }

.privacy-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
@media (min-width: 800px) { .privacy-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.privacy-list li { border-top: 3px solid var(--primary); padding-top: 12px; }
.privacy-list h3 { margin-bottom: 4px; }
.privacy-list p { color: var(--text-2); margin: 0; font-size: 0.95rem; }
.prose { max-width: 46em; }
.prose p, .prose li { color: var(--text-2); }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose strong { color: var(--text); }

/* ---------- tool pages ---------- */
.breadcrumb { font-size: 0.88rem; color: var(--text-2); padding-block: 14px 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.breadcrumb a { color: var(--text-2); }
.tool-head { padding-block: 8px 18px; }
.tool-head h1 { margin-bottom: 6px; }
.tool-head .lede { color: var(--text-2); max-width: 52em; margin: 0 0 10px; font-size: 1.04rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-wash); color: var(--accent); border-radius: 999px; padding: 3px 12px; font-size: 0.82rem; font-weight: 700; }
.badge svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.tool-layout { display: grid; gap: 20px; align-items: start; padding-bottom: 36px; }
@media (min-width: 1100px) { .tool-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; } }
.workspace { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
@media (min-width: 700px) { .workspace { padding: 20px; } }
.workspace.is-pinned { position: sticky; top: 16px; }
.io { container-type: inline-size; display: grid; gap: 16px; margin-bottom: 14px; }
@container (min-width: 680px) { .io.two { grid-template-columns: 1fr 1fr; } }
.field { min-width: 0; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.options { display: grid; gap: 2px 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 0 0 14px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--line); }
.options.cols-1 { grid-template-columns: 1fr; }
.opt-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.opt-row .field { flex: 1 1 150px; }
.note { font-size: 0.88rem; color: var(--text-2); background: var(--primary-wash); border-radius: var(--r-sm); padding: 8px 12px; margin: 0 0 14px; }
.stats { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); margin: 0 0 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.stat strong { display: block; font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.stat span { font-size: 0.8rem; color: var(--text-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { background: var(--surface-2); font-size: 0.82rem; }
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; }
.h-sub { font-size: 1.1rem; margin: 18px 0 10px; }
.shortcuts { font-size: 0.85rem; color: var(--text-2); margin: 10px 0 0; }
.matches { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); max-height: 180px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
.matches li { padding: 6px 12px; border-bottom: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.matches li:last-child { border-bottom: 0; }
.matches mark { background: #ffe58a; color: #3b2d00; border-radius: 3px; padding: 0 2px; }
.matches .more { color: var(--text-2); font-style: italic; }
.slug-preview { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; color: var(--text-2); overflow-wrap: anywhere; margin: 0 0 14px; }

/* supporting content */
.support { min-width: 0; }
.support-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tab { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: var(--r-sm); font: 600 0.9rem var(--font); cursor: pointer; }
.tab:hover { background: var(--surface-2); }
.tab[aria-expanded="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
@media (pointer: coarse) { .tab { min-height: 44px; } }
html.js .panel { display: none; }
html.js .panel.is-open { display: block; animation: panel-in 0.16s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; font-size: 1.2rem; }
.panel h3 { margin-top: 1.2em; }
.panel p, .panel li { color: var(--text-2); }
.panel li { margin-bottom: 6px; }
.panel strong { color: var(--text); }
.panel code, .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--text); }
.example { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin: 0 0 12px; }
.example > div { padding: 8px 12px; }
.example .ex-label { font-size: 0.75rem; font-weight: 700; color: var(--text-2); background: var(--surface-2); padding: 4px 12px; }
.example pre { margin: 0; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: 0.88rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }
.example pre[lang="ur"], .example pre.urdu { direction: rtl; unicode-bidi: isolate; text-align: right; font: 1.3rem/2.1 var(--font-nastaliq); }
details.faq { border-top: 1px solid var(--line); padding: 10px 0; }
details.faq:first-of-type { border-top: 0; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
details.faq p { margin: 8px 0 0; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 16px; }
.side-card h2 { font-size: 1rem; margin-bottom: 8px; }
.side-card ul { list-style: none; padding: 0; margin: 0; }
.side-card li { padding: 6px 0; border-top: 1px solid var(--line); font-size: 0.93rem; }
.side-card li:first-child { border-top: 0; }
.side-card li a { font-weight: 600; text-decoration: none; }
.side-card li a:hover { text-decoration: underline; }
.side-card li span { display: block; color: var(--text-2); font-size: 0.83rem; }
.side-card dl { margin: 0; font-size: 0.9rem; }
.side-card dt { font-weight: 600; margin-top: 8px; }
.side-card dd { margin: 2px 0 0; color: var(--text-2); }

/* advertising: only rendered when enabled in the site config */
.ad-slot { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-md); min-height: 100px; margin: 16px 0; display: grid; place-items: center; color: var(--text-2); font-size: 0.8rem; overflow: hidden; }

/* ---------- Urdu converter ---------- */
.ur-out { min-height: 190px; max-height: 520px; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); padding: 10px 14px; direction: rtl; unicode-bidi: isolate; text-align: right; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 28px; }
.font-nastaliq { font-family: var(--font-nastaliq); line-height: 2.3; }
.font-naskh { font-family: var(--font-naskh); line-height: 1.9; }
textarea.font-nastaliq, textarea.font-naskh { direction: rtl; unicode-bidi: isolate; text-align: right; }
.ur-w { border-radius: 4px; cursor: pointer; }
.ur-w:hover, .ur-w:focus-visible { background: var(--primary-wash); }
.ur-w.is-guess { text-decoration: underline dotted var(--accent) 2px; text-underline-offset: 0.35em; }
.look { display: grid; gap: 12px 20px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; margin-bottom: 14px; }
.review { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 14px; background: var(--surface-2); }
.review summary { cursor: pointer; padding: 10px 14px; font-weight: 600; }
.review-body { padding: 0 14px 14px; }
.review-body p { font-size: 0.88rem; color: var(--text-2); margin: 0 0 10px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font: 500 0.88rem var(--font); color: var(--text); }
.chip:hover { border-color: var(--primary); }
.chip-ur { font: 400 1.2rem/1.9 var(--font-nastaliq); }
.chip-src { color: var(--text-2); }
.chooser { position: absolute; z-index: 80; width: min(300px, calc(100vw - 16px)); background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 12px; }
.chooser-title { font-weight: 700; margin: 0 0 8px; font-size: 0.92rem; overflow-wrap: anywhere; }
.chooser-list { display: grid; gap: 6px; }
.chooser-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 2px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; font: 500 0.95rem var(--font); }
.chooser-opt:hover { border-color: var(--primary); background: var(--primary-wash); }
.chooser-opt.is-current { border-color: var(--primary); }
.opt-urdu { font: 400 1.3rem/2.1 var(--font-nastaliq); direction: rtl; unicode-bidi: isolate; }
.chooser-opt small { color: var(--text-2); }
.chooser-hint { font-size: 0.78rem; color: var(--text-2); margin: 8px 0 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--header-bg); color: var(--header-muted); margin-top: 0; flex-shrink: 0; }
.footer-grid { display: grid; gap: 28px; padding-block: 36px 24px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { color: var(--header-text); font-size: 0.95rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--header-muted); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer a:focus-visible { outline-color: #fff; }
.site-footer p { font-size: 0.92rem; max-width: 34em; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.12); padding-block: 14px 20px; font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .chip-radio input:checked + span { outline: 2px solid Highlight; }
}

/* ---- PHL EDU tools: homepage table + guide page ---- */
.ext-wrap { background: var(--surface); }
.ext-table { width: 100%; }
.ext-table th, .ext-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.ext-table thead th { background: var(--surface-2); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); border-top: 0; }
.ext-table tbody:first-of-type tr:first-child td, .ext-table tbody:first-of-type tr:first-child th { border-top: 0; }
.ext-table tbody + tbody tr:first-child > * { border-top: 2px solid var(--line-strong); }
.ext-table .ext-group { width: 190px; background: var(--surface-2); }
.ext-table .ext-group a { display: flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; color: var(--text); }
.ext-table .ext-group .ico { width: 22px; height: 22px; color: var(--primary); flex: none; }
.ext-table td:last-child { white-space: nowrap; width: 1%; }
@media (max-width: 760px) {
  .ext-table thead { position: absolute; left: -9999px; }
  .ext-table, .ext-table tbody, .ext-table tr, .ext-table th, .ext-table td { display: block; width: auto; }
  .ext-table .ext-group { width: auto; background: var(--surface-2); border-top: 2px solid var(--line-strong); }
  .ext-table td { border-top: 0; padding: 4px 14px; }
  .ext-table tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .ext-table td:last-child { white-space: normal; width: auto; padding-bottom: 10px; }
  .ext-table td[data-label]::before { content: attr(data-label) ": "; font-size: 0.78rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.03em; }
  .ext-table td[data-label="Tool"]::before, .ext-table td[data-label="Open"]::before { content: none; }
}
.ext-section { padding-top: 8px; }
.ext-tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin: 14px 0; max-width: 46em; }
.ext-tool h3 { margin-top: 0; }
.ext-tool h4 { margin: 12px 0 6px; font-size: 0.95rem; }
.ext-tool ol { margin: 0 0 12px; padding-left: 1.3em; }
.ext-tool li { margin: 4px 0; }

/* keep the header on one row on laptop widths now that there are five nav links */
@media (min-width: 1100px) and (max-width: 1799px) {
  .main-nav { flex: 1 1 auto; min-width: 0; }
  .main-nav ul { gap: 0; justify-content: flex-end; }
  .main-nav a { padding: 8px 8px; font-size: 0.86rem; white-space: nowrap; }
  .site-search { flex: 0 1 190px; min-width: 150px; }
  .theme-label { display: none; }
}

/* ---- Optional AI improve + voice typing panels (Roman Urdu tool) ---- */
.ai { border: 1px solid var(--line); border-radius: var(--r-md); margin: 14px 0; background: var(--surface-2); }
.ai > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai .tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 999px; background: var(--primary-wash); color: var(--primary); }
.ai-body { padding: 2px 14px 16px; }
.ai-lead { margin: 0 0 10px; }
.ai-note { margin: 0 0 14px; font-size: 0.9rem; color: var(--text-2); border-left: 3px solid var(--primary); padding: 6px 12px; background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.ai-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
.ai-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .ai-grid, .ai-grid.two { grid-template-columns: 1fr; } }
.ai-grid label a { font-weight: 500; font-size: 0.85rem; margin-left: 6px; }
.ai-grid input[type="text"], .ai-grid input[type="password"], .ai-grid select { width: 100%; }
.ai-state, .ai .status { margin: 10px 0 0; font-size: 0.9rem; color: var(--text-2); overflow-wrap: anywhere; }
.ai .status.is-error { color: var(--danger, #b42318); font-weight: 600; }
.ai-progress { width: 100%; height: 10px; margin: 12px 0 0; accent-color: var(--primary); }
.ai-foot { margin: 14px 0 0; font-size: 0.82rem; color: var(--text-2); }
.ai textarea[dir="rtl"] { font-size: 1.25rem; line-height: 2; }
