.site-header .bar {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:"brand tools" "sections sections";
  align-items:center;
  min-height:0;
  row-gap:0;
  padding-block:.5rem 0;
}
.site-header .brand {grid-area:brand;justify-self:start;min-width:0;line-height:1.3}
.site-header .nav-tools {grid-area:tools;flex-wrap:wrap;justify-content:flex-end}
.site-header .main-nav {
  grid-area:sections;
  display:flex;
  width:100%;
  min-width:0;
  align-items:stretch;
  justify-content:flex-start;
  gap:clamp(.85rem,3.8vw,3rem);
  margin-top:.35rem;
  border-top:1px solid #e4ebe7;
  flex-wrap:wrap;
  overflow:visible;
}
.site-header .main-nav a {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  min-height:44px;
  max-width:none;
  padding-inline:.12rem;
  white-space:nowrap;
}
.site-header .main-nav a:focus-visible {outline-offset:-3px}
.main-nav [data-short-section] {display:none}
#home .discovery-layout {
  grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);
  padding-block:clamp(1.25rem,3vw,2.3rem);
}
#home .hero-intro {margin:0}
#home .hero-deck {max-width:34em}
#home .manuscript picture {min-height:9rem;width:100%;margin:0}
#home .enter-chat {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  margin:1rem 0 0;
  padding:.45rem 1.1rem;
  border-radius:.65rem;
  color:#153c34;
  background:#f5e8c9;
  text-decoration:none;
  font-weight:700;
}
#home .enter-chat:hover {background:#fff5dc}
.home-sections>section {margin-block-start:clamp(1.75rem,4vw,3.2rem)}
.home-sections .sectionhead {flex-wrap:wrap;align-items:baseline;gap:.4rem 1rem}
.home-sections .sectionhead h2 {margin:0;line-height:1.45}
.home-sections .sectionhead a,.home-links a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  color:#265d51;
  text-decoration:underline;
  text-decoration-color:#a3bcb2;
  text-underline-offset:.24em;
}
.home-sections .home-meaning {padding-block:.65rem 0}
.home-links {display:flex;flex-wrap:wrap;gap:0 1.3rem;margin-block-start:.3rem}
.home-study-grid,.home-fiqh-grid {display:grid;gap:clamp(.7rem,1.8vw,1.3rem)}
.home-study-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
.home-study-link {
  display:flex;
  align-items:center;
  gap:1rem;
  padding:clamp(1rem,2.5vw,1.6rem);
  border:1px solid #d0ded4;
  border-inline-start:.25rem solid #4a7766;
  border-radius:.9rem;
  color:#214b41;
  background:#f3f7f3;
  font-size:clamp(1.13rem,1.95vw,1.48rem);
  font-weight:700;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.home-study-link+.home-study-link {border-inline-start-color:#ad9361;background:#f8f6ef;color:#56482e}
.home-study-link .icon {flex:none;width:1.65rem;height:1.65rem}
.home-fiqh-grid {align-items:start;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.home-topic-index .topics {grid-template-columns:repeat(auto-fit,minmax(min(6.3rem,100%),1fr))}
.home-fiqh #searchForm {box-shadow:var(--surface-shadow)}
.home-fiqh #searchForm .searchhead {grid-template-columns:1fr;gap:.3rem}
@media(max-width:850px) {
  .site-header .main-nav {
    display:grid;
    grid-template-columns:repeat(6,minmax(0,auto));
    justify-content:stretch;
    gap:0;
  }
  .site-header .main-nav a {
    min-width:0;
    justify-content:center;
    padding:.25rem .1rem;
    white-space:normal;
    overflow-wrap:anywhere;
    hyphens:auto;
    text-align:center;
    line-height:1.4;
  }
  .main-nav [data-msg] {display:none}
  .main-nav [data-short-section] {display:block;min-width:0}
  .home-fiqh-grid {grid-template-columns:1fr}
}
@media(max-width:700px) {
  .site-header .bar {display:flex;flex-flow:row wrap}
  .site-header .nav-tools {max-inline-size:100%}
  .site-header .brand img {width:32px;height:32px}
  #home .discovery-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.64fr);gap:.6rem}
  #home .hero-intro {min-height:0;width:auto;padding:0}
  #home .discovery h1 {font-size:clamp(1.8rem,7vw,3rem);overflow-wrap:anywhere}
  #home .manuscript {position:relative;display:grid;align-content:center;align-self:center}
  #home .manuscript picture {position:relative;inset:auto;width:100%;height:clamp(4.5rem,17vw,8rem);min-height:0;margin:0}
  #home .manuscript figcaption {font-size:clamp(1rem,3.5vw,1.45rem);line-height:1.5;margin:.15rem 0 0}
  #home .manuscript figcaption span {display:none}
  .home-sections .sectionhead {margin-bottom:.7rem}
}
@media(max-width:490px) {
  .site-header .nav-tools {gap:.15rem}
  .home-study-grid {grid-template-columns:1fr}
}
@media(max-width:375px) {
  .site-header .brand img {display:none}
  .site-header .nav-tools .saved {display:none}
}

.hero-actions,.library-access {display:flex;align-items:center;flex-wrap:wrap;gap:.55rem 1rem}
#home .hero-actions {margin-block-start:1rem}
#home .hero-actions .enter-chat {margin:0}
.hero-study {display:inline-flex;align-items:center;min-height:44px;padding:.35rem .25rem;color:#fff6db;font-weight:650;text-underline-offset:.32em}
.library-access {border-block:1px solid var(--line);padding:.5rem 0;margin:1rem 0 1.5rem}
.library-access a,.home-path-links a {display:inline-flex;align-items:center;gap:.55rem;min-height:44px}
.home-path-links {display:flex;flex-wrap:wrap;gap:.25rem 1.4rem}
.home-path-links .icon {width:1.15em;height:1.15em}
#study {padding-block-start:clamp(1rem,3vw,2.5rem)}
.study-masthead,.study-path-head {background:#123f3b;color:#faf6e9;border-radius:1rem;overflow:hidden}
.study-masthead {display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);align-items:center}
.study-masthead>div {padding:clamp(1rem,4vw,3.35rem)}
.study-masthead h1,.study-path-head h1 {margin:0 0 .4rem;color:inherit;font-size:clamp(1.85rem,4.8vw,3.3rem);line-height:1.22}
.study-masthead p,.study-path-head p {color:#e6eae2;line-height:1.65;max-inline-size:60ch;margin:0}
.study-masthead img {display:block;inline-size:100%;block-size:100%;max-block-size:15rem;object-fit:cover}
.study-search {display:block;margin-block:1.6rem .2rem;font-weight:650}
.study-search input {display:block;width:100%;margin-block-start:.4rem;min-block-size:44px}
.study-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin-block:1rem 2rem}
.study-card {display:grid;grid-template-columns:auto minmax(0,1fr);align-content:start;gap:1rem;padding:clamp(1rem,2.2vw,1.6rem);text-decoration:none;color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:.75rem}
.study-card:hover,.study-card:focus-visible {border-color:#477a66;background:#f0f5ed}
.study-card>.icon,.study-path-head>.icon {width:1.8rem;height:1.8rem;color:#387062;flex:none}
.study-card h2 {color:#154b41;font-size:clamp(1.13rem,2vw,1.45rem);line-height:1.4;margin:0}
.study-card p,.study-reading li p {color:#405653;line-height:1.65;margin:.4rem 0 0}
.study-path-head {display:flex;align-items:flex-start;gap:1.2rem;padding:clamp(1.25rem,3vw,2.7rem);margin-block:.6rem 1.4rem}
.study-path-head>.icon {color:#e1c889;width:2.1rem;height:2.1rem;margin-block-start:.35rem}
.study-detail {display:grid;grid-template-columns:minmax(0,1.65fr) minmax(15rem,.9fr);gap:clamp(1.2rem,3.6vw,3rem);align-items:start}
.study-detail h2 {margin:0 0 .85rem;font-size:1.45rem;line-height:1.45}
.study-reading ol {padding-inline-start:2rem;margin:0}
.study-reading li {padding:.2rem 0 1rem .1rem;margin-block-end:.85rem;border-bottom:1px solid var(--line)}
.study-reading li::marker {font-weight:700;color:#96753d}
.study-reading li a,.study-resume {font-weight:700;text-underline-offset:.18em}
.study-resume {display:inline-flex;align-items:center;min-height:44px;margin-block:0 .75rem}
.study-practice,.study-shelf {border:1px solid var(--line);border-radius:.75rem;padding:clamp(1rem,2vw,1.5rem);overflow-wrap:anywhere}
.study-practice {border-inline-start:4px solid #b28a4e;background:#faf5e9}
.study-practice p {margin:0;line-height:1.75}
.study-shelf {background:#f0f5f0}
.study-shelf ul {list-style:none;padding:0;margin:0 0 1rem}
.study-shelf li {margin-block:.35rem .8rem}
.study-shelf li small {display:block;color:#415950}
.study-shelf details {border-block-start:1px solid var(--line);padding-block:.45rem}
.study-shelf summary {cursor:pointer;font-weight:650;padding-block:.35rem}
.study-shelf details ul {padding-inline-start:.6rem;margin-block-start:.6rem}
.study-tools {display:grid;justify-items:start;gap:.4rem;border-block-start:1px solid var(--line);padding-block-start:1rem;margin-block-start:.4rem}
.study-tools h2 {margin:0}
.study-tools a,.study-shelf li a {text-underline-offset:.2em;line-height:1.6}
@media(max-width:720px){
  .study-detail {grid-template-columns:1fr}
  .study-grid {grid-template-columns:1fr}
  .study-masthead {grid-template-columns:minmax(0,1fr) minmax(0,.6fr)}
  .study-masthead img {max-block-size:none}
  .study-path-head {gap:.65rem}
}
@media(max-width:420px){
  .study-masthead {grid-template-columns:minmax(0,1fr)}
  .study-masthead img {display:none}
  #home .hero-actions {gap:.15rem .65rem}
}
