/* Dic_Ar — public styles. Logical properties are used so RTL/LTR mixing stays correct. */
/* Optional self-hosted Arabic font (OFL): place NotoNaskhArabic-Regular.woff2 in assets/fonts/
   and uncomment:
@font-face { font-family: "Dic Naskh"; src: url("../fonts/NotoNaskhArabic-Regular.woff2") format("woff2"); font-display: swap; }
*/
:root {
  /* Arabic School palette (from the school logo and site) */
  --ink: #2f3847;
  --muted: #646b7a;
  --line: #e2e6ee;
  --paper: #f7f8fb;
  --card: #ffffff;
  --brand: #254271;        /* navy: school footer */
  --brand-2: #435b89;      /* logo blue */
  --brand-ink: #ffffff;
  --accent: #f0ae12;       /* logo gold */
  --accent-dark: #b98200;
  --focus: #f0ae12;
  --radius: 10px;
  --ar-font: "Dic Naskh", "Noto Naskh Arabic", "Amiri", "Scheherazade New", "Traditional Arabic", "Arabic Typesetting", "Geeza Pro", "Times New Roman", serif;
  --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --a1: #254271; --a2: #f0ae12; --b1: #254271; --b2: #f0ae12; --c1: #254271; --c2: #f0ae12;  /* levels: x1 = school blue, x2 = school gold */
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--ui-font); color: var(--ink); background: var(--paper); line-height: 1.55; font-size: 16px; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1080px; margin-inline: auto; padding-inline: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--brand); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { inset-inline-start: 0; }
.muted { color: var(--muted); }
.small, small { font-size: .875rem; }
h1 { font-size: 1.75rem; line-height: 1.3; margin: 1.25rem 0 .75rem; }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .5rem; }

/* Arabic text */
.ar, [lang="ar"] { font-family: var(--ar-font); font-size: 1.22em; line-height: 1.9; unicode-bidi: isolate; }
.ar .ar, [lang="ar"] [lang="ar"] { font-size: 1em; }

/* Header */
.site-header { background: var(--card); border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 10px rgba(37,66,113,.06); }
.brand-logo { height: 52px; width: auto; display: block; }
.brand-title { color: var(--brand); font-size: 1.05rem; }
.brand-title [lang="ar"] { font-size: 1.1rem; color: var(--brand-2); margin-inline-start: .25rem; }
.nav-school { margin-inline-start: auto; color: var(--brand) !important; font-weight: 600; }
.header-row { display: flex; align-items: center; gap: 1rem; padding-block: .5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { background: var(--brand); color: var(--brand-ink); border-radius: 8px; padding: 0 .5rem; font-size: 1.3rem; line-height: 1.6; }
.brand-text { font-weight: 700; display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-weight: 400; color: var(--muted); font-size: .75rem; }
.tools { display: flex; gap: .4rem; margin-inline-start: auto; }
.tool { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: .2rem .7rem; cursor: pointer; font: inherit; display: flex; align-items: center; gap: .35rem; color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.tool:hover { border-color: var(--accent); }
.tool [lang="ar"] { font-size: 1rem; line-height: 1.4; }
.tool-label { font-size: .8rem; }
.main-nav { display: flex; gap: 1.25rem; padding-block: .25rem .5rem; font-size: .95rem; }
.main-nav a { text-decoration: none; color: var(--muted); }
.main-nav a:hover { color: var(--accent-dark); }

/* Search */
.search { position: relative; }
.search-compact { flex: 1 1 260px; max-width: 460px; }
.search-box { position: relative; display: flex; }
.search-box input { flex: 1; font: inherit; font-size: 1.05rem; padding: .6rem .9rem; border: 2px solid var(--line); border-radius: var(--radius); border-start-end-radius: 0; border-end-end-radius: 0; background: #fff; min-width: 0; }
.search-box input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(240,174,18,.2); }
.search-box input:dir(rtl) { font-family: var(--ar-font); font-size: 1.2rem; }
.search-btn { border: 0; background: var(--accent); color: var(--brand); padding-inline: 1rem; border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); cursor: pointer; }
.search-hero .search-box input { font-size: 1.2rem; padding: .9rem 1.1rem; }
.direction { border: 0; padding: 0; margin: .6rem 0 0; display: flex; gap: 1rem; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }
.direction [lang="ar"] { font-size: 1rem; }
.ac-list { position: absolute; top: 100%; inset-inline: 0; margin: .25rem 0 0; padding: .25rem; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.08); z-index: 20; max-height: 60vh; overflow: auto; }
.ac-list li a { display: flex; align-items: baseline; gap: .6rem; padding: .35rem .6rem; text-decoration: none; color: var(--ink); border-radius: 6px; }
.ac-list li a:hover, .ac-list li[aria-selected="true"] a { background: #fff6dc; }
.ac-list .ac-gloss { color: var(--muted); font-size: .9rem; }
.ac-list .ac-pos { font-size: .75rem; color: var(--muted); margin-inline-start: auto; }

/* Hero / home */
.hero { text-align: center; padding: 2rem 0 1rem; }
.hero h1 { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .5rem; }
.hero-ar { font-size: 2.3rem; color: var(--brand); }
.hero-en { color: var(--brand-2); }
.hero-school { display: inline-flex; align-items: center; gap: .5rem; background: #fff7e0; border: 1px solid #f6d98a; color: var(--brand); border-radius: 999px; padding: .2rem .9rem; font-size: .9rem; text-decoration: none; margin-bottom: .75rem; }
.hero-school:hover { border-color: var(--accent); color: var(--brand); }
.hero-en { font-size: 1.4rem; }
.hero .lead { color: var(--muted); max-width: 640px; margin: 0 auto 1.25rem; }
.hero .search { max-width: 680px; margin: 0 auto; text-align: start; }
.home-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin: 1.5rem 0 2rem; }
.topics-panel { grid-column: 1 / -1; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.panel h2 { margin-top: 0; font-size: 1.05rem; }
.wotd-word { font-size: 2rem; text-decoration: none; display: inline-block; }
.level-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.level-grid-lg { grid-template-columns: repeat(2, 1fr); max-width: 640px; }
.level-tile { display: flex; flex-direction: column; padding: .6rem .8rem; border-radius: 8px; text-decoration: none; color: #fff; }
.level-tile strong { font-size: 1.3rem; }
.level-tile small { opacity: .85; }
.level-a1 { background: var(--a1); } .level-a2 { background: var(--a2); } .level-b1 { background: var(--b1); }
.level-b2 { background: var(--b2); } .level-c1 { background: var(--c1); } .level-c2 { background: var(--c2); }
.chip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: baseline; gap: .35rem; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: .15rem .75rem; text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--brand); }
.chip [lang="ar"] { font-size: 1rem; line-height: 1.6; color: var(--muted); }
.chip-sm { font-size: .8rem; padding: 0 .55rem; }

/* Badges */
.badge { display: inline-block; font-size: .75rem; padding: .05rem .5rem; border-radius: 999px; background: #eceae4; color: var(--ink); vertical-align: middle; text-decoration: none; line-height: 1.6; }
.badge.level { color: #fff; font-weight: 600; }
.badge.pos { background: #e8edf6; color: var(--brand); }
.badge.register { background: #fbefe2; color: #7a4510; }
.badge.tier { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.badge [lang="ar"] { font-size: .95rem; line-height: 1; }
.badge.level-a1 { background: var(--a1); } .badge.level-a2 { background: var(--a2); } .badge.level-b1 { background: var(--b1); }
.badge.level-b2 { background: var(--b2); } .badge.level-c1 { background: var(--c1); } .badge.level-c2 { background: var(--c2); }
.level-tile.level-a2, .level-tile.level-b2, .level-tile.level-c2, .badge.level-a2, .badge.level-b2, .badge.level-c2 { color: var(--brand); }

/* Result cards */
.cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(37,66,113,.10); }
.card-link { display: block; padding: .8rem 1rem; color: inherit; text-decoration: none; }
.card-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-lemma { font-size: 1.7rem; color: var(--brand); margin-inline-end: .25rem; }
.card-forms { font-size: .85rem; color: var(--muted); display: flex; gap: 1rem; }
.card-senses { margin: .35rem 0 0; padding-inline-start: 1.2rem; }
.card-senses li { margin: .1rem 0; }
.card-senses li.matched::marker { color: var(--accent); font-weight: 700; }
.more { font-size: .8rem; color: var(--muted); }
.results-title small { font-size: .9rem; font-weight: 400; margin-inline-start: .5rem; }
.dir-switch a[aria-current] { font-weight: 700; text-decoration: none; color: var(--ink); }
.suggestions { margin-top: 1.5rem; }
.empty { background: var(--card); border: 1px dashed var(--line); padding: 1rem 1.25rem; border-radius: var(--radius); }

/* Entry page */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 2rem; grid-template-areas: "head head" "main side" "main side"; margin-bottom: 2rem; }
.entry-head { grid-area: head; border-bottom: 1px solid var(--line); padding-bottom: .75rem; margin-bottom: .5rem; }
.entry .forms, .entry .senses { grid-column: 1; }
.entry-side { grid-area: side; grid-row: 2 / span 2; display: flex; flex-direction: column; gap: .75rem; padding-top: 1rem; }
.headword-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.headword { margin: .5rem 0 0; }
.headword .lemma { font-size: 3.2rem; color: var(--brand); line-height: 1.5; }
.pron { margin: 0; color: var(--muted); display: flex; gap: 1rem; }
.ipa { font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Lucida Sans Unicode", serif; }
.meta-line { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin: .5rem 0 0; }
.notice { background: #fff8e6; border: 1px solid #f0d58c; border-radius: 8px; padding: .5rem .8rem; font-size: .9rem; }
.forms-table { border-collapse: collapse; min-width: 50%; }
.forms-table th, .forms-table td { text-align: start; padding: .3rem .8rem .3rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.forms-table th { font-weight: 500; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.sense-list { padding-inline-start: 1.5rem; margin: 0; }
.sense { padding: .75rem 0 .9rem; border-bottom: 1px solid var(--line); }
.sense::marker { font-weight: 700; color: var(--brand); font-size: 1.1rem; }
.sense-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.equiv { font-size: 1.15rem; }
.definition { margin: .25rem 0; }
.definition-ar { margin: .25rem 0; }
.constructions { list-style: none; padding: 0; margin: .35rem 0; }
.constructions li { background: #eef2f9; border-inline-start: 3px solid var(--brand); padding: .2rem .6rem; margin: .25rem 0; border-radius: 4px; }
.examples { list-style: none; padding: 0; margin: .5rem 0 0; }
.examples li { padding: .35rem .75rem; margin: .35rem 0; background: #fff8e8; border-inline-start: 3px solid var(--accent); border-radius: 8px; }
.example-ar { margin: 0; text-align: right; direction: rtl; display: flex; align-items: center; gap: .5rem; justify-content: flex-start; }
.example-ar .ar { font-size: 1.35rem; }
.example-en { margin: 0; color: var(--muted); font-style: italic; }
.usage-note { font-size: .92rem; background: #f4f4f8; padding: .35rem .6rem; border-radius: 6px; }
.relations .rel { margin-inline-end: 1rem; }
details.adv > summary { cursor: pointer; list-style: none; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary .sense-head::after { content: "▸ advanced — show details"; font-size: .8rem; color: var(--muted); }
details.adv[open] > summary .sense-head::after { content: "▾"; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .15rem 0; }
.root-family { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }

/* Audio */
.audio-btn { border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 999px; width: 2.1rem; height: 2.1rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; flex: none; }
.audio-btn:hover { background: #fff3d1; }
.audio-btn.playing { background: var(--brand); color: #fff; }
.tts-tag { position: absolute; bottom: -.6rem; font-size: .55rem; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 .2rem; }

/* Diacritics / transliteration toggles */
.translit { display: none; }
html.show-translit .translit { display: inline; }

/* Lists, pager, flash */
.pager { display: flex; gap: .4rem; justify-content: center; align-items: center; flex-wrap: wrap; margin: 1.5rem 0; }
.pager a, .pager .current { min-width: 2.2rem; text-align: center; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; }
.pager a:hover { border-color: var(--accent); }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .gap { color: var(--muted); }
.letter-bar { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 1rem; }
.letter-bar a { font-family: var(--ar-font); font-size: 1.3rem; line-height: 1.6; min-width: 2.4rem; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; color: var(--brand); }
.letter-bar a:hover { border-color: var(--accent); }
.letter-bar a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--brand); font-weight: 700; }
.btn-link { font-weight: 600; color: var(--brand); }
.browse-all-note { margin-top: 1.25rem; background: #fff8e8; border-inline-start: 3px solid var(--accent); padding: .6rem .9rem; border-radius: 8px; }
.flash { padding: .6rem 1rem; border-radius: 8px; margin: .75rem 0; }
.flash-success { background: #e6f4ea; } .flash-error { background: #fde8e8; } .flash-warning { background: #fff8e6; }
.prose { max-width: 720px; }
.error-page { padding: 2rem 0; max-width: 680px; }

.site-footer { background: var(--brand); color: #fff; margin-top: 2.5rem; font-size: .92rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; padding-block: 2.5rem 1.5rem; }
.footer-logo { height: 67px; width: auto; display: block; margin-bottom: .75rem; }
.footer-title { font-weight: 700; margin: 0 0 .5rem; }
.footer-about p { margin: 0 0 .5rem; line-height: 1.6; opacity: .92; }
.footer-col h2 { font-size: 1rem; margin: .25rem 0 .9rem; color: #fff; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 0 0 .6rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding-block: 1rem; font-size: .85rem; }
.footer-bottom p { margin: .2rem 0; opacity: .9; }
.footer-bottom a { color: var(--accent); }
.footer-bottom [lang="ar"] { font-size: 1rem; }

@media (max-width: 820px) {
  .entry { grid-template-columns: 1fr; grid-template-areas: "head" "main" "side"; }
  .entry-side { grid-row: auto; }
  .headword .lemma { font-size: 2.6rem; }
  .tool-label { display: none; }
  .search-compact { order: 3; flex-basis: 100%; max-width: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .brand-logo { height: 42px; }
  .nav-school { margin-inline-start: 0; }
}
@media print {
  .site-header, .site-footer, .audio-btn, .tools { display: none; }
  .entry { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* =====================================================================
   v2 design layer — larger type (especially Arabic), cards, mobile-first
   ===================================================================== */
body { font-size: 17px; line-height: 1.6; }
.ar, [lang="ar"] { font-size: 1.35em; line-height: 2; }
.ar .ar, [lang="ar"] [lang="ar"], .tool [lang="ar"], .badge [lang="ar"] { font-size: 1em; }
h1 { font-size: 2rem; }
main.wrap { padding-bottom: 1rem; }

/* header */
.header-row { min-height: 72px; }
.tool { min-height: 40px; padding: .25rem .85rem; }
.main-nav { gap: 1.5rem; font-size: 1rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { padding: .2rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { border-bottom-color: var(--accent); }

/* hero */
.hero { padding: 2.5rem 0 1.5rem; }
.hero-ar { font-size: 3.2rem; line-height: 1.6; }
.hero-en { font-size: 1.55rem; font-weight: 700; }
.hero .lead { font-size: 1.08rem; }
.search-hero .search-box input { font-size: 1.25rem; padding: 1rem 1.2rem; border-radius: 14px 0 0 14px; }
.search-hero .search-btn { padding-inline: 1.4rem; border-radius: 0 14px 14px 0; }
.search-box input:dir(rtl) { font-size: 1.4rem; }
.search-compact .search-box input { font-size: 1.05rem; }
.hero-meta { color: var(--muted); font-size: .95rem; margin-top: 1rem; }
.hero-meta a { margin-inline: .35rem; }
.hero-meta [lang="ar"] { font-size: 1.25rem; }

/* home layout */
.home-grid { display: grid; gap: 1.25rem; grid-template-columns: 1.15fr 1fr; grid-template-areas: "wotd az" "phrases phrases"; margin: 1.5rem 0 1.25rem; }
.phrases .phrase-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
.phrases .phrase-list li + li { border-top: 0; }
.phrases .phrase-list li { border-bottom: 1px solid #edf0f6; }
.home-grid .wotd { grid-area: wotd; }
.home-grid .phrases { grid-area: phrases; }
.panel { border-radius: 16px; padding: 1.4rem 1.5rem; box-shadow: 0 4px 18px rgba(37,66,113,.06); border-color: #e6eaf2; }
.panel-title { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; color: var(--brand); margin: 0 0 1rem; flex-wrap: wrap; }
.panel-icon { width: 2rem; height: 2rem; border-radius: 50%; background: #fff3d1; color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; font-family: var(--ar-font); }
.panel-sub { color: var(--muted); font-weight: 400; font-size: 1.05rem; }

/* word of the day */
.wotd-head { display: flex; align-items: center; gap: .75rem; }
.wotd-word { font-size: 2.9rem; line-height: 1.4; text-decoration: none; color: var(--brand); }
.wotd-pron { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; color: var(--muted); margin: .25rem 0 .75rem; }
.translit-always { font-style: italic; }
.wotd-meaning { font-size: 1.35rem; font-weight: 700; margin: .25rem 0 .9rem; color: var(--ink); }
.wotd-example { background: #fff8e8; border-inline-start: 4px solid var(--accent); border-radius: 10px; padding: .6rem 1rem; margin-bottom: 1.1rem; }
.wotd-example .example-ar .ar { font-size: 1.6rem; }

/* buttons */
.btn-primary, .btn-secondary, .btn-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .5rem 1.3rem; border-radius: 999px; font-weight: 700; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-secondary { border: 2px solid var(--brand); color: var(--brand); margin-top: 1rem; }
.btn-secondary:hover { background: var(--brand); color: #fff; }
.btn-cta { background: var(--accent); color: var(--brand); white-space: nowrap; }
.btn-cta:hover { background: #ffc233; color: var(--brand); }

/* A–Z grid */
.letter-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .45rem; }
.letter-grid a { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-family: var(--ar-font); font-size: 1.6rem; line-height: 1; border-radius: 12px; background: #f1f4fa; color: var(--brand); text-decoration: none; transition: background .15s, color .15s, transform .15s; }
.letter-grid a:hover, .letter-grid a:focus-visible { background: var(--accent); color: var(--brand); transform: translateY(-2px); }
.letter-bar a { font-size: 1.5rem; min-width: 2.7rem; min-height: 2.7rem; display: inline-flex; align-items: center; justify-content: center; }

/* phrases */
.phrase-list { list-style: none; margin: 0; padding: 0; }
.phrase-list li + li { border-top: 1px solid #edf0f6; }
.phrase-list a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem .25rem; text-decoration: none; color: var(--ink); flex-direction: row-reverse; }
.phrase-list a:hover { background: #f7f9fd; }
.phrase-ar { font-size: 1.5rem; color: var(--brand); }
.phrase-en { color: var(--muted); font-size: .95rem; text-align: start; }

/* call to action */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; border-radius: 18px; padding: 1.6rem 2rem; margin: 1.5rem 0 1rem; }
.cta h2 { margin: 0 0 .3rem; font-size: 1.4rem; color: #fff; }
.cta p { margin: 0; opacity: .9; }

/* results & lists */
.cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.card { border-radius: 14px; }
.card-link { padding: 1rem 1.15rem; }
.card-lemma { font-size: 2.1rem; }
.card-forms .ar { font-size: 1.3rem; }
.card-senses { font-size: 1rem; }
.results-title { font-size: 1.7rem; }

/* entry page */
.headword .lemma { font-size: 4rem; }
.equiv { font-size: 1.3rem; }
.definition { font-size: 1.05rem; }
.forms-table td .ar { font-size: 1.5rem; }
.forms-table th { font-size: .95rem; }
.example-ar .ar { font-size: 1.6rem; }
.example-en { font-size: 1.02rem; }
.constructions .ar { font-size: 1.45rem; }
.entry-side .panel .ar { font-size: 1.45rem; }
.sense { padding: 1rem 0 1.2rem; }
.audio-btn { width: 2.6rem; height: 2.6rem; }

/* mobile */
@media (max-width: 820px) {
  body { font-size: 16.5px; }
  .home-grid { grid-template-columns: 1fr; grid-template-areas: "wotd" "az" "phrases"; }
  .phrases .phrase-list { grid-template-columns: 1fr; }
  .hero { padding: 1.5rem 0 1rem; }
  .hero-ar { font-size: 2.4rem; }
  .hero-en { font-size: 1.2rem; }
  .hero .lead { font-size: 1rem; }
  .search-hero .search-box input { font-size: 1.1rem; padding: .85rem 1rem; }
  .direction { gap: .5rem 1rem; font-size: .9rem; }
  .header-row { min-height: 0; gap: .6rem; padding-block: .5rem; }
  .brand-text small { display: none; }
  .tools { gap: .3rem; }
  .tool { padding: .2rem .6rem; }
  .cards { grid-template-columns: 1fr; }
  .headword .lemma { font-size: 3.2rem; }
  .letter-grid { grid-template-columns: repeat(7, 1fr); gap: .35rem; }
  .letter-grid a { font-size: 1.4rem; border-radius: 10px; }
  .cta { flex-direction: column; align-items: flex-start; padding: 1.3rem 1.25rem; }
  .panel { padding: 1.15rem 1.1rem; }
  .wotd-word { font-size: 2.6rem; }
  .badge.tier { display: none; }
  .pager a, .pager .current { min-width: 2.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }
  .footer-grid { padding-block: 1.75rem 1rem; gap: 1.25rem; }
}
@media (max-width: 380px) {
  .letter-grid { grid-template-columns: repeat(6, 1fr); }
  .tool-label { display: none; }
}

/* synthetic-voice listen buttons */
.tts-btn { border: 1px dashed #c9d2e3; background: #fff; color: var(--brand-2); border-radius: 999px; width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; vertical-align: middle; }
.tts-btn[hidden] { display: none; }
.tts-btn:hover { background: #fff3d1; border-color: var(--accent); color: var(--brand); }
.tts-btn.playing { background: var(--accent); border-style: solid; border-color: var(--accent); color: var(--brand); }
.forms-table .tts-btn { width: 2rem; height: 2rem; margin-inline-start: .35rem; }
.phrase-list li { display: flex; align-items: center; gap: .5rem; }
.phrase-list li a { flex: 1; }

.tts-notice { position: fixed; inset-inline: 1rem; bottom: 1rem; max-width: 560px; margin-inline: auto; background: var(--brand); color: #fff; padding: .9rem 2.6rem .9rem 1.1rem; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50; font-size: .95rem; line-height: 1.5; }
.tts-notice strong { color: var(--accent); }
.tts-notice-close { position: absolute; top: .4rem; inset-inline-end: .5rem; background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; line-height: 1; }
