/* =====================================================================
   pol69.css — v70 platform polish (loaded LAST).
   Scope: visual fit & calm only. No content/religious text changes here.
   Each block is independent and commented; delete a block to revert it.
   Not touched: «ذكر الآن» card (.h62-az / vz69.css), «المصحف العثماني»
   theme (uth69.css), header install button (owned by v69 work).
   ===================================================================== */

/* ---------- 1. No outlines: borders become transparent (layout unchanged),
   controls that relied on the border get a soft tinted fill instead. ---------- */
html .topbar .icon-btn:not(#installBtn),
html .nb-back,
html .chip, html a.chip, html button.chip,
html .btn.ghost, html .btn.sm.ghost,
html .card, html .note, html div.note,
html #app input:not([type=checkbox]):not([type=radio]):not([type=range]), html #app select, html #app textarea,
html .li, html a.li, html button.li, html .s-item, html a.s-item,
html .sira-tabs, html .ph-hero, html .sx-band, html .tw-tabs, html .tw-tab,
html .reader-bar .btn, html .reader-bar .chip, html .qtr68c, html .mp-foot .btn,
html .ayah-box, html .kids-hero, html .kv-c, html .lec-sc, html .lec-av,
html details.acc, html .p60e, html .p60e-i, html .pt, html .hero, html .dhikr, html .fadl-k,
html .r8-card, html .avatar, html .ny-pl, html .nya-sw, html .ps-tb, html .ny-yb, html .ax-row,
html .compass, html .h64-tr, html .pm-inst, html .m48-i, html .m48-l, html .ded-card{
  border-color:transparent!important;
}
html .btn.ghost, html .btn.sm.ghost, html .nb-back, html .reader-bar .btn.ghost, html .mp-foot .btn.ghost, html .qtr68c{
  background:color-mix(in srgb, currentColor 9%, transparent)!important;
}
html .topbar .icon-btn:not(#installBtn){background:color-mix(in srgb, currentColor 8%, transparent)!important}
html #app input:not([type=checkbox]):not([type=radio]):not([type=range]), html #app select, html #app textarea{
  background-color:color-mix(in srgb, currentColor 7%, transparent)!important;
}
html .chip:not(.on), html a.chip:not(.on), html button.chip:not(.on){
  background:color-mix(in srgb, currentColor 8%, transparent)!important;
}
/* keep a visible keyboard focus ring (accessibility, not decoration) */
html :focus-visible{outline:2px solid var(--gold2,#c9a24a)!important;outline-offset:2px}

/* ---------- 2. Native checkboxes/selects follow the theme (no white boxes in dark) ---------- */
html[data-theme=dark]{color-scheme:dark}
html[data-theme=light]{color-scheme:light}
html #app input[type=checkbox], html #app input[type=radio], html #app input[type=range]{accent-color:var(--gold,#c9a24a)}

/* ---------- 3. Phone header: back is an icon (no «رجوع» word) so the page title fits ---------- */
@media (max-width:999px){
  html.nb-inner .topbar .nb-back{padding:0!important;min-width:40px;width:40px;gap:0}
  html.nb-inner .topbar .nb-back span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  html.nb-inner .topbar .nb-title{font-size:16px!important;text-overflow:clip!important}
  html.nb-inner .topbar .top-actions{gap:6px}
  html.nb-inner .topbar .top-actions .icon-btn{min-width:40px;padding:0 8px}
}
/* desktop has the full top nav: the extra back pill is noise */
@media (min-width:1000px){html.nb-inner .topbar .nb-back{display:none!important}}

/* ---------- 4. Section titles: centred, one clear block (title, then its count/action) ---------- */
html #app .sec-title{flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:6px}
html #app .sec-title h2{justify-content:center;text-align:center}
html #app .sec-title > .row, html #app .sec-title > .muted, html #app .sec-title > span{justify-content:center}
html #app .a66-top{text-align:center;display:flex;flex-direction:column;align-items:center}
html .hx .hx-sec:not(.h62-az) > .hx-head{justify-content:center;text-align:center}
html .hx .hx-sec:not(.h62-az) > .hx-head h2{text-align:center}

/* ---------- 5. Chip rows: wrap & centre instead of being cut at the screen edge ---------- */
html #app .chips.scroll-x, html #app .ax-chips{flex-wrap:wrap!important;overflow:visible!important;justify-content:center;row-gap:8px}
html #app .chips.scroll-x > .muted{flex-basis:100%;text-align:center}
/* very long rows (tawashih artists, tasbeeh phrases) stay one swipeable line, with a soft edge
   instead of a hard mid-word cut */
html #app .tw-chips, html body[data-route=tasbeeh] #app .chips.scroll-x, html #app .kv-row{
  flex-wrap:nowrap!important;overflow-x:auto!important;justify-content:flex-start;scrollbar-width:none}
html[dir=rtl] #app .tw-chips, html[dir=rtl] body[data-route=tasbeeh] #app .chips.scroll-x, html[dir=rtl] #app .kv-row{
  -webkit-mask-image:linear-gradient(to right,transparent 0,#000 36px);mask-image:linear-gradient(to right,transparent 0,#000 36px)}
html[dir=ltr] #app .tw-chips, html[dir=ltr] body[data-route=tasbeeh] #app .chips.scroll-x, html[dir=ltr] #app .kv-row{
  -webkit-mask-image:linear-gradient(to left,transparent 0,#000 36px);mask-image:linear-gradient(to left,transparent 0,#000 36px)}
html #app .chip{white-space:nowrap}

/* ---------- 6. Reader bar fits 360: title moves to the footer info, tighter buttons ---------- */
@media (max-width:420px){
  html .reader-bar.mp-bar{gap:4px!important}
  html .reader-bar.mp-bar #mpTitle{display:none}
  html .reader-bar.mp-bar #fMinus, html .reader-bar.mp-bar #fPlus, html .reader-bar.mp-bar #mtBtn{min-width:36px!important;padding:0 6px!important}
  html .reader-bar.mp-bar .chips .chip{padding:7px 9px!important}
  html .mp-foot .mp-info{white-space:normal!important;text-overflow:clip!important;overflow:visible!important;text-align:center;font-size:12.5px;line-height:1.5}
}

/* ---------- 7. Waqf / share card: one calm slim row instead of a big promo block ---------- */
html .pm-inst{padding:12px 16px!important;border-radius:16px!important;box-shadow:none!important;gap:12px!important;min-height:0!important}
html .pm-inst b{font-size:15px!important}
html .pm-inst small{font-size:12.5px!important;line-height:1.6}
html .pm-inst span.go{padding:8px 14px!important;font-size:13px!important;border-radius:10px!important}
html .pm-inst:hover{transform:none!important}

/* ---------- 8. Settings: theme is already in the header and the «فاتح/داكن» switch — drop the 3rd control ---------- */
html .switch:has(#dk){display:none!important}

/* ---------- 9. Hero bands (السيرة، المحاضرات، الدروس…): smaller, no frame ---------- */
html .ph-hero.sx-band{padding:14px 14px 12px!important;gap:6px!important;box-shadow:none!important}
html .ph-hero.sx-band .sx-m{width:44px!important}
html .ph-hero.sx-band h2{font-size:clamp(21px,5.6vw,26px)!important}
html .ph-hero.sx-band p{font-size:13.5px;margin:0}

/* hero bands draw their frame with ::before/::after lines — remove the frame, keep the glow */
html .ph-hero::before, html .ph-hero::after{border-color:transparent!important}

/* header install button: same calm style as its neighbours (behaviour untouched) */
html .topbar #installBtn{border-color:transparent!important;background:color-mix(in srgb, currentColor 8%, transparent)!important}

/* EN: the home countdown reads days → seconds left-to-right */
html[dir=ltr] .h62-cd{direction:ltr}

/* frames drawn by a border-box gradient show through a transparent border: clip backgrounds to the padding box */
html .ph-hero, html .kids-hero, html .hero, html .card.ny-pl{background-clip:padding-box!important}
html .kids-hero::after, html .kids-hero::before{border-color:transparent!important}
/* kids page: row headings centred like every other section title */
html #app .kv-h{text-align:center;justify-content:center;align-items:center}
html #app .kv-h h2{text-align:center}

/* ---------- 10. Long text fits its box instead of «…» ---------- */
/* phone header title: up to two balanced lines, never cut mid-word */
@media (max-width:999px){
  html.nb-inner .topbar .nb-title{white-space:normal!important;overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;
    line-height:1.25;font-size:15px!important;text-wrap:balance;max-height:2.6em}
}
/* hadith reference chips under a dhikr (source text: shown whole, wrapped) */
html #app .fadl-r{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
/* list sub-lines (المزيد descriptions, salawat titles, anbiya presenters): wrap to 2 lines, no ellipsis */
html #app .m48-t small, html #app .m48-t b, html #app .r8-card small, html #app .r8-card b, html #app .ax-row small,
html body[data-route=anbiya] #app b, html body[data-route=anbiya] #app small{
  white-space:normal!important;text-overflow:clip!important;overflow:visible!important}
/* only phones swipe the long rows; wide screens wrap them */
@media (min-width:700px){
  html #app .tw-chips, html body[data-route=tasbeeh] #app .chips.scroll-x{flex-wrap:wrap!important;overflow:visible!important;justify-content:center;-webkit-mask-image:none!important;mask-image:none!important}
}

/* ---------- 1b. More outlined boxes found in the second pass (same treatment as block 1) ---------- */
html .reader-bar.mp-bar, html .hx-btn.pm-mag, html .r8-voice, html .rf, html .rf-search, html .rf-cbtn, html .rf-sort,
html #app .name, html .rm-seg, html .rm-card, html .rm-u, html .a63-o, html .mt-opt, html .p60chip, html .hx-card,
html .sira-tabs a, html .sira-tabs [role=tab], html .a66-pa button, html .nt-main{border-color:transparent!important}
html .a63-o:not(.on), html .mt-opt:not(.on), html .r8-voice:not(.on), html .p60chip, html .rf-cbtn{background:color-mix(in srgb, currentColor 8%, transparent)!important}

/* active tabs drew a 1px inset ring: the filled background already marks them */
html .sira-tabs a.on, html .sira-tabs [aria-selected=true], html .tw-tab.on, html .chip.on{box-shadow:none!important}
/* reader bar on phones: tighter so the play button never touches the edge */
@media (max-width:420px){html .reader-bar.mp-bar{padding-inline:6px!important}}

/* salawat voice rows: the track line wraps (max 2 lines) instead of «…» */
html #app .r8-voice small, html #app .r8-card small{white-space:normal!important;text-overflow:clip!important;overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.6}

/* ---------- 11. Sources table on phones: each row stacks (what → source) instead of two squeezed columns ---------- */
@media (max-width:600px){
  html #app table.tbl, html #app table.tbl tbody{display:block;width:100%}
  html #app table.tbl tr{display:block;padding:10px 0}
  html #app table.tbl th, html #app table.tbl td{display:block;width:auto!important;padding:2px 4px!important;text-align:start;border:0!important}
  html #app table.tbl td:first-child, html #app table.tbl th:first-child{font-weight:700}
  html #app table.tbl a{word-break:break-word}
}

html .pm-inst{background-clip:padding-box!important}
