/* ==========================================================================
   UrduWord.com — modern design system
   Palette and typography follow the kirbylabs/urduword-nodejs prototype:
   warm off-white surfaces, emerald primary, Plus Jakarta Sans for Latin,
   Noto Nastaliq Urdu for Urdu script. Light + dark themes.
   ========================================================================== */

@import url('/css/fonts.css');

/* ---- Design tokens ---- */
:root {
  --background: hsl(40 30% 98%);
  --foreground: hsl(200 25% 12%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(200 25% 12%);
  --card-border: hsl(40 15% 89%);
  --border: hsl(40 15% 88%);
  --input: hsl(40 12% 78%);
  --primary: hsl(160 55% 38%);
  --primary-hover: hsl(160 55% 32%);
  --primary-foreground: hsl(0 0% 100%);
  --primary-soft: hsl(160 45% 94%);
  --secondary: hsl(40 18% 88%);
  --muted: hsl(40 12% 92%);
  --muted-foreground: hsl(200 10% 42%);
  --accent: hsl(35 60% 92%);
  --error: hsl(0 84% 45%);
  --error-soft: hsl(0 85% 96%);
  --shadow: 0 1px 2px rgba(20, 30, 30, .05), 0 4px 16px rgba(20, 30, 30, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', 'Amiri', serif;
  --header-bg: rgba(252, 251, 248, .92);
  color-scheme: light;
}

[data-theme="dark"] {
  --background: hsl(200 20% 8%);
  --foreground: hsl(40 15% 92%);
  --card: hsl(200 18% 11%);
  --card-foreground: hsl(40 15% 92%);
  --card-border: hsl(200 12% 16%);
  --border: hsl(200 12% 18%);
  --input: hsl(200 10% 28%);
  --primary: hsl(160 55% 45%);
  --primary-hover: hsl(160 55% 52%);
  --primary-foreground: hsl(200 30% 8%);
  --primary-soft: hsl(160 40% 14%);
  --secondary: hsl(200 10% 20%);
  --muted: hsl(200 8% 16%);
  --muted-foreground: hsl(40 8% 60%);
  --accent: hsl(35 30% 18%);
  --error: hsl(0 70% 58%);
  --error-soft: hsl(0 40% 14%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .35);
  --header-bg: rgba(18, 26, 30, .92);
  color-scheme: dark;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }

/* Urdu script — Nastaliq needs generous vertical room */
.urdutext {
  font-family: var(--font-urdu);
  font-size: 175%;
  line-height: 2.2;
  direction: rtl;
  unicode-bidi: embed;
}

input.urdutext_edit {
  font-family: var(--font-urdu) !important;
  direction: rtl;
}

.uw-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Header ---- */
.uw-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.uw-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.uw-brand { display: flex; flex-direction: column; line-height: 1.15; }
.uw-brand a { color: var(--foreground); }
.uw-brand a:hover { text-decoration: none; }
.uw-brand-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.uw-brand-name em { color: var(--primary); font-style: normal; }
.uw-brand-tag { font-size: .72rem; color: var(--muted-foreground); font-weight: 500; }

.uw-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }

.uw-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted-foreground);
}
.uw-nav a:hover { color: var(--foreground); background: var(--muted); text-decoration: none; }
.uw-nav a.is-active { color: var(--primary); background: var(--primary-soft); }

.uw-theme-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex: none;
}
.uw-theme-toggle:hover { background: var(--muted); }
.uw-theme-icon-dark { display: none; }
[data-theme="dark"] .uw-theme-icon-dark { display: inline; }
[data-theme="dark"] .uw-theme-icon-light { display: none; }

/* Collapse nav labels on small screens */
@media (max-width: 720px) {
  .uw-nav a { padding: 8px 10px; font-size: .85rem; }
  .uw-brand-tag { display: none; }
}

/* ---- Search hero ---- */
.uw-hero { padding: 40px 0 8px; text-align: center; }

.uw-hero h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.uw-hero h1 em { color: var(--primary); font-style: normal; }

.uw-hero-sub { color: var(--muted-foreground); margin: 0 0 24px; font-size: 1rem; }

.uw-search-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  max-width: 720px;
  margin: 0 auto;
}

/* Mode pills — classNames come from legacy showNav() JS */
.uw-search-modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.uw-search-modes a,
a.topnavOnL, a.topnavOffL {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted-foreground);
  background: transparent;
  cursor: pointer;
}
.uw-search-modes a:hover { text-decoration: none; color: var(--foreground); background: var(--muted); }
.uw-search-modes a.topnavOnL {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

.uw-search-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}

.uw-search-row label {
  align-self: center;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

.uw-search-input {
  flex: 1 1 260px;
  max-width: 420px;
  font-family: inherit;
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  outline: none;
}
.uw-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input.uw-search-input.urdutext_edit { font-size: 1.3rem; line-height: 1.4; }

.uw-search-btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}
.uw-search-btn:hover { background: var(--primary-hover); }

/* Legacy autocomplete popup */
.autocomplete { display: none; }

.uw-hero-compact { padding-top: 24px; }
/* On content pages (search results, lessons, etc.) the search card fills the
   container so it lines up with the content below instead of sitting as a
   narrow centered box with a blank right third. */
.uw-hero-compact .uw-search-card { max-width: none; }
.uw-hero-compact .uw-search-row { justify-content: flex-start; }

/* ---- Page title bar (non-home pages) ---- */
.uw-pagetitle-bar { padding: 26px 0 4px; }
.uw-pagetitle-bar h1 { font-size: 1.6rem; margin: 0; }
.uw-pagetitle-extra { color: var(--muted-foreground); font-size: .9rem; }

/* ---- Cards & grid ---- */
.uw-main { padding: 28px 0 48px; }

.uw-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.uw-col-4 { grid-column: span 4; }
.uw-col-6 { grid-column: span 6; }
.uw-col-8 { grid-column: span 8; }
.uw-col-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .uw-col-4, .uw-col-6, .uw-col-8 { grid-column: span 12; }
}

.uw-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.uw-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px 0;
}

.uw-card-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.uw-card-head h2 a { color: var(--card-foreground); }
.uw-card-link { font-size: .85rem; font-weight: 600; white-space: nowrap; }

.uw-card-body { padding: 12px 18px 18px; flex: 1; }

/* Lessons list */
.uw-lessons { list-style: none; margin: 0; padding: 0; }
.uw-lessons li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.uw-lessons li:last-child { border-bottom: 0; }
.uw-lessons a { font-weight: 600; }
.uw-lessons span { color: var(--muted-foreground); font-size: .88rem; text-align: right; }

/* Word of the day (legacy slideshow.js needs the fixed geometry) */
.uw-wotd-body { display: flex; justify-content: center; }

#slideshow-area, #slideshow-scroller, .slideshow-content, #slideshow-holder,
#slideshow-previous, #slideshow-next { height: 210px; }
#slideshow-area, #slideshow-scroller, .slideshow-content { width: 330px; }
#slideshow-area, #slideshow-scroller { position: relative; overflow: hidden; margin: 0 auto; }
#slideshow-area { text-align: center; }
#slideshow-area a { font-size: 1.25rem; font-weight: 700; }
#slideshow-area a:hover { text-decoration: none; color: var(--primary-hover); }
.slideshow-content p { margin: 6px 0; }
.slideshow-content .urdutext { font-size: 200%; }

#slideshow-previous, #slideshow-next {
  width: 44px;
  position: absolute;
  top: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  background: 50% 50% no-repeat;
}
#slideshow-previous {
  left: 0;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%236b7c78' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3C/svg%3E");
}
#slideshow-next {
  right: 0;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%236b7c78' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
}
#slideshow-area:hover #slideshow-previous,
#slideshow-area:hover #slideshow-next { opacity: 1; }

/* Browse A-Z chips (legacy class name) */
.uw-azgrid { display: flex; flex-wrap: wrap; gap: 8px; }

a.squarebutton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--background);
  font-weight: 700;
  color: var(--foreground);
}
a.squarebutton:hover {
  text-decoration: none;
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

/* Ads: never let slots stretch the layout */
.uw-ad { text-align: center; overflow: hidden; }
.uw-ad ins { max-width: 100%; }

/* Reserve height so a filling ad doesn't shove content down (CLS). Sized to
   the smallest unit AdSense serves into each slot, so a fill shrinks the gap
   at worst - never a content jump. */
.uw-ad-leaderboard { margin: 20px auto 0; max-width: 100%; min-height: 100px; }
.uw-ad-results     { min-height: 100px; }
.uw-ad-rect        { min-height: 250px; }
.uw-ad-incontent   { min-height: 280px; }
.uw-ad-inarticle   { min-height: 200px; margin: 22px 0; }

/* Desktop horizontals are 728x90 / 970x90; mobile serves 320x100 or 320x50. */
@media (min-width: 701px) {
  .uw-ad-leaderboard, .uw-ad-results { min-height: 90px; }
}

/* Collapse slots that never load (blocked, or AdSense reports unfilled).
   Keeping :empty here is what makes the reservation above work: an
   unprocessed <ins> stays invisible while the WRAPPER holds the space, and
   :empty stops matching the moment adsbygoogle.js injects the ad iframe - so
   the ad lands in already-reserved space with no shift. */
ins.adsbygoogle:empty,
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* Release the reservation when there is nothing to show. :has() is the fast
   path; .uw-ad-collapsed is set by the sweep in page_standard.en.htm and also
   covers ad blockers, where the tag never runs at all. */
.uw-ad.uw-ad-collapsed,
.uw-ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  min-height: 0;
  margin-top: 0;
  margin-bottom: 0;
}

/* Error banner (legacy $strMessage) */
.uw-error-banner {
  background: var(--error-soft);
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-weight: 600;
}

/* ---- Results table (search) ---- */
.uw-results-wrap {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

table.uw-results {
  width: 100%;
  border-collapse: collapse;
  font-size: .96rem;
}

.uw-results th {
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-foreground);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.uw-results td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.uw-results tr:last-child td { border-bottom: 0; }
.uw-results tr:hover td { background: var(--primary-soft); }

.uw-results .uw-result-word { font-weight: 700; font-size: 1.02rem; }
.uw-results .uw-result-details { color: var(--muted-foreground); font-size: .82rem; }
.uw-results td.uw-result-urdu { text-align: right; }
.uw-results td.uw-result-urdu .urdutext { font-size: 150%; line-height: 2; }
.uw-results .uw-tool-link { font-size: .82rem; font-weight: 600; white-space: nowrap; }

/* On narrow screens each result becomes a full-width dictionary-style entry:
   English / Roman / correction stack on the left, the Urdu script sits to the
   right on the same row, so the whole width is used and nothing is cropped. */
@media (max-width: 640px) {
  .uw-results, .uw-results tbody, .uw-results tr, .uw-results td {
    display: block;
    width: 100% !important;
  }
  .uw-results tr:first-child, .uw-results tr:has(th) { display: none; }
  .uw-results tr {
    position: relative;
    padding: 12px 16px;
    padding-right: 38%;            /* reserve the right side for the Urdu */
    border-bottom: 1px solid var(--border);
  }
  .uw-results tr:last-child { border-bottom: 0; }
  .uw-results tr:hover td { background: transparent; }
  .uw-results td { padding: 2px 0; border-bottom: 0; }
  .uw-results td.uw-result-urdu {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 34% !important;
    transform: translateY(-50%);
    text-align: right;
  }
  .uw-results td.uw-result-urdu .urdutext { font-size: 165%; }
}

/* ---- Pagination & letter bar ---- */
.uw-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
  font-size: .95rem;
}
.uw-pagination-pages { flex: 1; text-align: center; color: var(--muted-foreground); }

.uw-pagination a, .uw-letterbar a {
  display: inline-block;
  min-width: 30px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
}
.uw-pagination a:hover, .uw-letterbar a:hover { background: var(--muted); text-decoration: none; }

.uw-pagination .pageCurrent, .uw-letterbar .pageCurrent {
  display: inline-block;
  min-width: 30px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 700;
  background: var(--primary);
  color: var(--primary-foreground);
}

.uw-letterbar {
  text-align: center;
  margin: 0 0 16px;
  line-height: 2.1;
}

/* ---- Forms ---- */
.uw-form-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  max-width: 640px;
}

.uw-form-card h2 { font-size: 1.15rem; margin: 0 0 16px; }

.uw-form-row { margin-bottom: 14px; }

.uw-form-row label,
.uw-form-label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 5px;
}

.uw-input, .uw-textarea, .uw-select,
.uw-form-card input[type="text"],
.uw-form-card input[type="email"],
.uw-form-card input[type="password"],
.uw-form-card textarea,
.uw-form-card select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  outline: none;
}
.uw-form-card input:focus, .uw-form-card textarea:focus, .uw-form-card select:focus,
.uw-input:focus, .uw-textarea:focus, .uw-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.uw-btn,
.uw-form-card input[type="submit"], .uw-form-card button[type="submit"] {
  display: inline-block;
  width: auto;
  font-family: inherit;
  font-size: .98rem;
  font-weight: 600;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}
.uw-btn:hover,
.uw-form-card input[type="submit"]:hover { background: var(--primary-hover); text-decoration: none; }

.uw-btn-secondary {
  background: var(--secondary);
  color: var(--foreground);
}
.uw-btn-secondary:hover { background: var(--muted); }

/* Generic form controls anywhere in page bodies or dialogs (covers legacy
   forms that keep their original markup, incl. the correction popup) */
.uw-main input[type="text"], .uw-main input[type="password"], .uw-main input[type="email"],
.uw-main textarea, .uw-main select,
#modal_dialog input[type="text"], #modal_dialog textarea, #modal_dialog select {
  font-family: inherit;
  font-size: .98rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--input);
  background: var(--background);
  color: var(--foreground);
  outline: none;
  max-width: 100%;
}
.uw-main input[type="text"]:focus, .uw-main textarea:focus, .uw-main select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.uw-main input[type="submit"], .uw-main button[type="submit"],
#modal_dialog input[type="submit"] {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}
.uw-main input[type="submit"]:hover { background: var(--primary-hover); }

/* ---- Prose (info/lesson pages) ---- */
.uw-prose { max-width: 760px; }
.uw-prose h2 { font-size: 1.3rem; margin: 1.4em 0 .5em; }
.uw-prose h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
.uw-prose p, .uw-prose li { color: var(--foreground); }

/* Phrase tables in lessons */
table.uw-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0 22px;
  font-size: .96rem;
}
.uw-table th {
  text-align: left;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.uw-table td { padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* legacy header cells converted by class swap (td or th) */
.uw-th {
  text-align: left;
  font-size: .78rem !important;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.uw-table tr:last-child td { border-bottom: 0; }
.uw-table td .urdutext { font-size: 145%; line-height: 2; }

/* Lesson pages use a legacy floated layout (a float:left wrapper div with
   float:left tables inside) to place phrase tables side by side. Turn that
   into a responsive flex row: tables share the full container width on
   desktop and stack on small screens. */
.uw-main div[style*="float"] {
  float: none !important;
  width: 100% !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  align-items: flex-start;
}
.uw-main table[style*="float"] {
  float: none !important;
  flex: 1 1 340px;
  min-width: 0;
  max-width: 100%;
}
.uw-main table[style*="float"] > tbody > tr > td { display: block; width: 100%; }
.uw-main table[style*="float"] .uw-table { width: 100%; }

/* Explicit responsive replacement for legacy side-by-side layout tables */
table.uw-layout { width: 100%; border: 0; background: transparent; border-collapse: collapse; }
table.uw-layout > tbody > tr { display: flex; flex-wrap: wrap; gap: 0 28px; align-items: flex-start; }
table.uw-layout > tbody > tr > td {
  display: block;
  flex: 1 1 340px;
  min-width: 0;
  width: auto !important;
  padding: 0;
  border: 0;
}
table.uw-layout > tbody > tr > td[width="50"],
table.uw-layout > tbody > tr > td[width="30"],
table.uw-layout > tbody > tr > td[width="20"] { display: none; }
table.uw-layout .uw-table { width: 100%; }

/* Contain legacy floats (lesson pages) so they can't push the footer aside */
.uw-main .uw-container { overflow: hidden; }

/* ---- Footer ---- */
.uw-footer {
  clear: both;
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  color: var(--muted-foreground);
  font-size: .9rem;
}
.uw-footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; }
.uw-footer-links a { font-weight: 600; }
.uw-footer p { margin: 4px 0; }

/* ---- Legacy bridge ----
   Pages not yet reskinned still render their old table-based bodies inside
   the new shell; keep them presentable. */
.tableframe { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); }
.tablehead, .tablehead a { font-weight: 700; color: var(--card-foreground); }
.tablehead { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.tablerow, .tablerow2 { padding: 8px 14px; }
.tablerow2 { background: var(--muted); }
.uw_error_box { background: var(--error-soft); color: var(--error); padding: 10px 14px; border-radius: var(--radius-sm); }

/* jQuery-UI dialog minimal harmonization */
.ui-widget { font-family: var(--font-sans) !important; }

/* Loading overlay (legacy) */
.loading { display: none; }

/* Word-variation notices ------------------------------------------------- */
/* Shown when a search only matched after morphological analysis            */
/* ("Liking" -> "Like"), and when we can only offer related words.          */

.uw-resolved-note {
  margin: 0 0 1rem;
  padding: .6rem .9rem;
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 4px;
  font-size: .95rem;
}

.uw-suggestions {
  margin: .8rem 0;
  padding: .6rem .9rem;
  background: var(--muted);
  border-radius: 4px;
}

.uw-suggestions a { font-weight: 600; }


/* Editor review queue ---------------------------------------------------- */

.uw-queue-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.uw-queue-tab {
  padding: .45rem .85rem; border: 1px solid var(--border);
  border-radius: 6px; text-decoration: none; font-size: .95rem;
  background: var(--card);
}
.uw-queue-tab.is-active { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.uw-queue-count { opacity: .75; font-variant-numeric: tabular-nums; margin-left: .3rem; }

.uw-queue-origin { font-size: .9rem; margin: 0 0 1rem; color: var(--muted-foreground); }
.uw-queue-pill {
  display: inline-block; padding: .2rem .6rem; margin: 0 .15rem;
  border: 1px solid var(--border); border-radius: 999px; text-decoration: none;
}
.uw-queue-pill.is-active { background: var(--primary-soft); border-color: var(--primary); font-weight: 600; }


.uw-queue-help { font-size: .9rem; margin: 0 0 1rem; color: var(--muted-foreground); }
.uw-queue-help kbd {
  display: inline-block; padding: .05em .4em; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; font-family: inherit; font-size: .85em;
}
.uw-queue-progress { float: right; font-variant-numeric: tabular-nums; }

.uw-queue-bulk { margin: 0 0 1rem; }
.uw-btn-bulk {
  padding: .5rem 1rem; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--primary); color: var(--primary-foreground); font-size: .95rem;
}
.uw-queue-note { font-size: .85rem; color: var(--muted-foreground); margin-left: .6rem; }

.uw-queue { list-style: none; margin: 0; padding: 0; }
.uw-queue-item {
  border: 1px solid var(--border); border-radius: 8px;
  padding: .9rem 1rem; margin: 0 0 .8rem; outline: none;
}
.uw-queue-item.is-current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.uw-queue-item.is-done { opacity: .5; }
.uw-queue-item.is-editing { background: var(--muted); }

.uw-queue-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.uw-queue-english { font-size: 1.2rem; font-weight: 700; }
.uw-queue-demand {
  font-size: .8rem; padding: .1rem .45rem; border-radius: 999px;
  background: var(--muted); font-variant-numeric: tabular-nums;
}
.uw-queue-status { margin-left: auto; font-size: .85rem; }
.uw-queue-status.is-accept  { color: #15803d; }
.uw-queue-status.is-decline { color: #b91c1c; }
.uw-queue-status.is-error   { color: #b91c1c; font-weight: 600; }

.uw-queue-body { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .6rem 0; }
.uw-queue-fields { flex: 1 1 260px; max-width: 30rem; display: grid; grid-template-columns: 4.5rem 1fr; gap: .3rem .8rem; align-items: baseline; }
.uw-queue-fields label { font-size: .8rem; color: var(--muted-foreground); }
.uw-queue-urdu { font-family: var(--font-urdu); font-size: 1.35rem; line-height: 2; direction: rtl; text-align: right; }
.uw-queue-fields [contenteditable="true"] {
  background: var(--card); border: 1px solid var(--primary); border-radius: 4px; padding: .1rem .3rem;
}

.uw-queue-evidence { flex: 1 1 300px; font-size: .85rem; }
.uw-sig { padding: .15rem 0; line-height: 1.45; }
.uw-sig-dot {
  display: inline-block; width: .55em; height: .55em; border-radius: 50%;
  margin-right: .45em; vertical-align: middle;
}
.uw-sig-label { font-weight: 500; }
.uw-sig-good .uw-sig-dot { background: #16a34a; }
.uw-sig-warn .uw-sig-dot { background: #d97706; }
.uw-sig-bad  .uw-sig-dot { background: #dc2626; }
.uw-sig-detail { color: var(--muted-foreground); }
/* "The sources instead say ..." - shown as context to judge with, never as a
   verdict; see scripts/enrich_contributions.php for why. */
.uw-sig-warn .uw-sig-detail .urdutext { font-family: var(--font-urdu); font-size: 1.05em; }

.uw-queue-existing { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.uw-queue-existing ul { margin: .2rem 0 0; padding-left: 1.1rem; }

.uw-queue-actions { display: flex; gap: .4rem; }
.uw-queue-actions button {
  padding: .35rem .8rem; border-radius: 5px; cursor: pointer; font-size: .9rem;
  border: 1px solid var(--border); background: var(--card);
}
.uw-btn-accept  { border-color: #16a34a; color: #15803d; }
.uw-btn-decline { border-color: #dc2626; color: #b91c1c; }

/* The fixed greens/reds above are legible on the light background but sink
   into the dark one, so lift them rather than re-tinting the whole palette. */
[data-theme="dark"] .uw-btn-accept        { color: #4ade80; border-color: #4ade80; }
[data-theme="dark"] .uw-btn-decline       { color: #f87171; border-color: #f87171; }
[data-theme="dark"] .uw-queue-status.is-accept  { color: #4ade80; }
[data-theme="dark"] .uw-queue-status.is-decline,
[data-theme="dark"] .uw-queue-status.is-error   { color: #f87171; }
[data-theme="dark"] .uw-sig-good .uw-sig-dot { background: #4ade80; }
[data-theme="dark"] .uw-sig-warn .uw-sig-dot { background: #fbbf24; }
[data-theme="dark"] .uw-sig-bad  .uw-sig-dot { background: #f87171; }

@media (max-width: 640px) {
  .uw-queue-body { flex-direction: column; gap: .8rem; }
  .uw-queue-progress { float: none; display: block; margin-top: .3rem; }
}


/* Print */
@media print {
  .uw-header, .uw-footer, .uw-ad, .noprint { display: none !important; }
}
