:root{color-scheme:light}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-padding-top:calc(var(--header) + 20px)}
body{margin:0;background:var(--paper);color:var(--ink);font:400 1rem/1.6 var(--font)}
button,input{font:inherit;color:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
img{display:block;width:100%;height:auto}
svg{width:1.25rem;height:1.25rem;display:block;flex:none}
:focus-visible{outline:2px solid #a74b64;outline-offset:4px}
:where(h1,h2,h3,p,figure){margin:0}
:where(h1,h2,h3){line-height:1.24;text-wrap:balance}
::selection{background:#f0c1b9;color:var(--wine)}
.sr-only,.skip:not(:focus){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip:focus{position:fixed;z-index:20;inset:8px auto auto 8px;background:white;padding:12px}
.frame{width:min(calc(100% - 96px),var(--wide));margin-inline:auto}
.topbar{position:sticky;inset-block-start:0;z-index:5;background:color-mix(in srgb,var(--paper) 95%, transparent);backdrop-filter:blur(12px);border-block-end:1px solid var(--line)}
.bar-layout{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px;min-height:var(--header)}
.wordmark{display:inline-flex;align-items:center;gap:.7rem;width:max-content;min-height:44px}
.wordmark b,.mini-header b{font-family:var(--font);letter-spacing:.13em;line-height:1}
.wordmark b{font-size:1.35rem;font-weight:700}
.wordmark span{border-inline-start:1px solid var(--line);padding-inline-start:.7rem;color:var(--muted);font-size:.71rem}
.top-nav,.top-actions{display:flex;align-items:center;gap:clamp(12px,2.4vw,36px)}
.top-nav a,.footer-link{font-size:.8rem}
.top-nav a:hover,.footer-link:hover,.language:hover,.text-link:hover{text-decoration:underline;text-underline-offset:.32em}
.top-actions{justify-content:end;gap:14px}
.search-trigger,.language,.icon-button{display:inline-flex;min-height:40px;align-items:center;justify-content:center;gap:.55rem;padding:.4rem .65rem;border:1px solid var(--line);background:none;font-size:.75rem}
.language{border-color:transparent;padding-inline:.2rem}
.search-trigger svg{width:16px;height:16px}
kbd{min-width:17px;text-align:center;font-size:.7rem;border:1px solid var(--line);border-radius:2px;color:var(--muted)}
.hero{margin-block-start:24px;min-height:min(585px,66vw);display:grid;grid-template-columns:39% 61%;overflow:hidden;background:var(--wine-deep);color:var(--cream)}
.hero-content{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;background:radial-gradient(ellipse at 0 100%,#4f2333 0%,transparent 72%),var(--wine-deep);padding:clamp(26px,4.2vw,76px);position:relative}
.hero-content::after{content:'';position:absolute;inset:15px;border:1px solid #ffd3c72b;pointer-events:none}
.hero-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.eyebrow{font-size:.73rem;font-weight:600;letter-spacing:.09em;text-transform:uppercase}
:lang(ar) .eyebrow{letter-spacing:0}
.hero .eyebrow{color:#f3d5d1}
.version{font-size:.69rem;line-height:1;background:#f5c1ba23;color:#ffe1dc;padding:6px 8px;white-space:nowrap}
.hero h1{font:400 clamp(2.7rem,5.45vw,6rem)/.99 var(--display);letter-spacing:-.06em;margin-block:clamp(16px,2vw,38px);text-wrap:unset}
.hero h1 span,.hero h1 em{display:block}
.hero h1 em{color:var(--rose);font-weight:400}
:lang(ar) .hero h1{font-size:clamp(2.1rem,4.5vw,5rem);font-weight:550;letter-spacing:-.035em;line-height:1.29}
:lang(ar) .hero h1 em{font-style:normal;font-weight:400}
.hero-description{color:#eededb;font-size:clamp(.88rem,1.18vw,1.12rem);max-width:32ch;line-height:1.8}
.hero-actions{display:flex;flex-wrap:wrap;align-items:center;gap:clamp(10px,1.55vw,24px);margin-block-start:clamp(18px,2.3vw,35px)}
.button{min-height:48px;display:inline-flex;align-items:center;gap:1rem;padding:.6rem .9rem;font-size:.83rem;font-weight:600;border:1px solid transparent}
.button-light{background:#ffe0d8;color:var(--wine)}
.button-light:hover{background:white}
.hero-link,.text-link,.footer-link{display:inline-flex;align-items:center;gap:.55rem;font-size:.74rem;font-weight:600;min-height:40px}
.hero-link:hover{text-decoration:underline;text-underline-offset:.25em}
.hero-link svg,.footer-link svg{width:14px;height:14px}
.hero-image{position:relative;min-height:100%;background:#8a6b58;isolation:isolate}
.hero-image picture,.hero-image img{position:absolute;inset:0;width:100%;height:100%}
.hero-image img{object-fit:cover;object-position:36% 46%;animation:arrive-image .95s ease-out both}
.hero-image figcaption{position:absolute;inset-block-end:15px;inset-inline-end:17px;background:#281a1de8;padding:.5rem .72rem;display:flex;align-items:center;gap:.5rem;font-size:.66rem;color:#ffe2d8}
.hero-content>*{animation:arrive .65s cubic-bezier(.2,.7,.3,1) both}
.hero-content>h1{animation-delay:.06s}.hero-description{animation-delay:.13s}.hero-actions{animation-delay:.18s}
@keyframes arrive{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@keyframes arrive-image{from{opacity:.65;transform:scale(1.025)}to{opacity:1;transform:scale(1)}}
.library{padding-block:64px 72px}
.section-heading{display:flex;align-items:end;justify-content:space-between;flex-wrap:wrap;gap:16px;margin-block-end:24px}
.section-heading h2,.studio-intro h2{font:400 clamp(2rem,4vw,4rem)/1.25 var(--display);letter-spacing:-.045em}
:lang(ar) .section-heading h2,:lang(ar) .studio-intro h2{font-size:clamp(1.55rem,3vw,3rem);font-weight:550;letter-spacing:-.02em}
.section-heading p{color:var(--muted);font-size:.91rem;margin-block-start:6px}
.updated{font-size:.75rem;color:var(--muted)}
.chapter-grid{display:grid;grid-template-columns:repeat(3,1fr);border-inline-start:1px solid var(--line);border-block-start:1px solid var(--line)}
.chapter-link{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-content:start;align-items:start;gap:.85rem;padding:clamp(13px,1.9vw,27px);min-height:126px;border-inline-end:1px solid var(--line);border-block-end:1px solid var(--line);transition:background .2s}
.chapter-link:hover,.chapter-link:focus-visible{background:#f2e5dd;z-index:1}
.chapter-link>.tile-icon{display:grid;place-items:center;width:34px;height:34px;border:1px solid #e3c5bd;color:var(--wine)}
.chapter-link .arrow{margin-block-start:.36rem;color:var(--wine)}
.chapter-link .arrow svg{width:15px;height:15px}
.chapter-link h3{font-size:1rem;margin-block:.14rem .4rem;font-weight:620;text-wrap:wrap}
.chapter-link p{font-size:.8rem;color:var(--muted);line-height:1.65}
[dir=rtl] [data-icon=arrow] svg,[dir=rtl] .arrow svg{transform:scaleX(-1)}
.studio{margin-block-end:76px;display:grid;grid-template-columns:minmax(220px,.62fr) minmax(0,1.5fr);gap:clamp(18px,4.3vw,65px);padding:clamp(20px,4vw,58px);background:#ecdcd4}
.studio-intro{align-self:center}
.studio-intro .eyebrow{color:#743545}
.studio-intro h2{margin-block:12px 14px}
.studio-intro>p:not(.eyebrow){font-size:.9rem;color:#59474e;max-width:34ch}
.studio-intro .text-link{margin-block-start:14px;text-decoration:underline;text-underline-offset:.35em}
.studio-body{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1fr);background:var(--cream);border:1px solid var(--line);min-height:340px}
.studio-panel,.studio-stage{padding:clamp(10px,1.8vw,25px);min-width:0}
.studio-stage{border-inline-start:1px solid var(--line);background:#e4d7ce}
.studio-panel-head{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:34px;margin-block-end:9px}
.studio-panel-head h3{font-size:.79rem;text-wrap:wrap}
.reset{background:none;border:none;color:#763947;text-decoration:underline;min-height:34px;padding:3px;font-size:.67rem}
.layout-rows{padding:0;margin:0;list-style:none;display:grid;gap:.55rem}
.layout-rows li{min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:.45rem;border:1px solid var(--line);padding:.35rem .45rem;font-size:.73rem;font-weight:530}
.row-actions,.switch{display:flex;gap:3px}
.row-actions button,.switch button{background:var(--cream);border:1px solid var(--line);width:30px;height:32px;display:grid;place-items:center;padding:0}
.row-actions svg,.switch svg{width:15px;height:15px}
.row-actions button:disabled{opacity:.4;cursor:default}
.switch [aria-pressed=true],.row-actions button:not(:disabled):hover{color:white;background:var(--wine);border-color:var(--wine)}
.stage-area{display:grid;justify-items:center}
.mini-store{background:var(--cream);width:100%;min-width:105px;border:1px solid #c7b5a7;max-width:340px;transition:width .35s cubic-bezier(.2,.7,.3,1);box-shadow:0 8px 20px #341b1f20}
.mini-store[data-device=phone]{width:60%}
.mini-header{display:flex;align-items:center;justify-content:space-between;padding:.48rem;gap:3px;color:var(--wine);font-size:.73rem}
.mini-header svg{width:12px;height:12px}
.mini-tile{display:flex;min-height:50px;aspect-ratio:3/1;align-items:end;padding:.3rem .45rem;background:#4f3238 center/cover no-repeat;border-block-start:2px solid var(--cream);color:white;font-size:.67rem;text-shadow:0 1px 4px black}
.mini-tile span{background:#2c1720e8;padding:.1rem .3rem;line-height:1.45}
.mini-store[data-device=phone] .mini-tile{aspect-ratio:2/1}
.mini-tile[data-tile=benefits]{background:#6c3a48}
.mini-tile.moved{animation:placed .45s ease-out both}
@keyframes placed{from{opacity:.55}to{opacity:1}}
.reader{display:grid;grid-template-columns:minmax(170px,.63fr) minmax(0,2fr);gap:clamp(20px,5vw,90px);padding-block:44px 75px;min-height:73vh}
.reader-nav{align-self:start;position:sticky;inset-block-start:calc(var(--header) + 20px);max-height:calc(100vh - var(--header) - 45px);overflow:auto;padding:.4rem;padding-inline-start:0}
.reader-nav a{display:flex;gap:.6rem;align-items:center;padding:.63rem .65rem;font-size:.83rem;border-inline-start:2px solid var(--line);min-height:42px}
.reader-nav a:first-child{margin-block-end:.55rem;font-weight:650;border-color:transparent}
.reader-nav svg{width:16px;height:16px}
.reader-nav a:hover{background:#eee3d9}
.reader-nav a[aria-current=page]{background:#efded6;color:var(--wine);border-color:var(--wine);font-weight:650}
.chapter-article{min-width:0}
.article-head{background:var(--wine-deep);color:var(--cream);padding:clamp(20px,4vw,51px);position:relative}
.article-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-block-end:16px}
.article-meta time{color:#efdbd7;font-size:.71rem}
.article-head .tile-icon{color:var(--rose);display:block;margin-inline-end:.25rem}
.article-head .tile-icon svg{width:31px;height:31px}
.article-head h1{font:400 clamp(2rem,4vw,4.1rem)/1.2 var(--display);letter-spacing:-.04em}
:lang(ar) .article-head h1{font-size:clamp(1.64rem,3vw,3.1rem);letter-spacing:-.025em;font-weight:570}
.article-head p{max-width:58ch;color:#f0dedb;margin-block-start:.65rem;font-size:.94rem}
.topic-jump{display:flex;flex-wrap:wrap;gap:.5rem;padding-block:16px;border-block-end:1px solid var(--line)}
.topic-jump a{border:1px solid var(--line);padding:.35rem .55rem;font-size:.73rem;color:var(--wine)}
.topic-jump a:hover{background:#f2e3dc}
.topic{padding-block:clamp(20px,3.3vw,46px);border-block-end:1px solid var(--line);font-size:.93rem;line-height:1.85}
.topic h2{font-size:clamp(1.16rem,2vw,1.55rem);max-width:52ch;margin-block-end:.8rem}
.topic p,.topic li{max-width:78ch;overflow-wrap:anywhere}
.topic ul,.topic ol{padding-inline-start:1.55rem;margin:.85rem 0}
.topic li{padding-inline-start:.25rem;margin-block:.3rem}
.topic li::marker{color:#863d54;font-weight:700}
.result{background:#f0e4dc;border-inline-start:2px solid #8a4b5e;padding:.65rem .9rem;margin-block-start:.85rem;color:#493139}
.result b{display:block;font-size:.74rem}
.topic-links{display:flex;flex-wrap:wrap;gap:.4rem 1.1rem;margin-block-start:1rem}
.topic-links a{color:var(--wine);text-decoration:underline;text-underline-offset:.25em;overflow-wrap:anywhere}
.data-table{overflow:auto;margin-block-start:1rem}
.data-table table{border-collapse:collapse;width:100%;font-size:.8rem;background:#fff9f3;text-align:start}
.data-table :is(td,th){border:1px solid var(--line);text-align:start;padding:.5rem .65rem;vertical-align:top}
.data-table th{background:#ecdcd4}
.data-table th[scope=row]{width:31%;min-width:82px}
.gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding-block:20px;border-block-end:1px solid var(--line)}
.gallery button{display:block;width:100%;text-align:start;background:var(--cream);border:1px solid var(--line);padding:0}
.gallery button img{aspect-ratio:16/10;object-fit:contain;background:#e6d9d0}
.gallery button:hover{border-color:#965568}
.gallery button span{display:flex;align-items:center;justify-content:space-between;gap:.4rem;padding:.65rem;font-size:.75rem}
.gallery button span svg{width:16px;height:16px}
.crop-demo{display:grid;grid-template-columns:minmax(0,1fr) minmax(180px,1.4fr);gap:clamp(14px,3vw,42px);align-items:center}
.crop-controls{display:flex;gap:7px;flex-wrap:wrap;margin-block-start:13px}
.crop-controls button{min-height:44px;padding:.45rem .7rem;border:1px solid var(--line);background:var(--cream);display:inline-flex;align-items:center;gap:.45rem;font-size:.73rem}
.crop-controls button svg{width:16px;height:16px}
.crop-controls button[aria-pressed=true]{background:var(--wine);color:var(--cream);border-color:var(--wine)}
.crop-stage{display:grid;place-items:center;background:#e9d9d0;min-height:clamp(180px,30vw,275px);padding:12px;overflow:hidden}
.crop-stage figure{width:100%;max-width:540px;height:clamp(142px,24vw,250px);transition:width .35s cubic-bezier(.2,.7,.3,1)}
.crop-stage figure[data-crop-view=tall]{width:40%}
.crop-stage img{height:100%;object-fit:cover;object-position:41% 50%}
.article-next{display:flex;justify-content:space-between;flex-wrap:wrap;gap:7px 20px;padding-block:15px}
.article-next .prev svg{transform:scaleX(-1)}
[dir=rtl] .article-next .prev svg{transform:none}
.footer{border-block-start:1px solid var(--line);background:#ede1d8}
.footer-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;min-height:80px;padding-block:12px}
.footer p{font-size:.75rem;color:var(--muted)}
body:has(dialog:modal){overflow:hidden}
.dialog{border:1px solid var(--line);color:var(--ink);background:var(--cream);width:min(90vw,680px);max-height:85dvh;padding:0;box-shadow:0 24px 70px #26172155}
.dialog::backdrop{background:#22151bc4;backdrop-filter:blur(3px)}
.dialog-inner{padding:clamp(12px,3vw,30px)}
.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-block-end:12px}
.dialog-head h2{font-size:1.08rem;text-wrap:wrap}
.icon-button{min-width:42px}
.search-input{display:flex;align-items:center;gap:.55rem;min-height:48px;border:1px solid #af838a;padding:.5rem .67rem}
.search-input input{border:0;background:none;flex:auto;width:100%;min-width:0}
.search-input:focus-within{outline:2px solid #9c4e67;outline-offset:2px}
.search-input input:focus{outline:none}
.search-results{display:grid;padding-block-start:.6rem}
.search-results a{display:flex;justify-content:space-between;align-items:center;gap:.8rem;padding:.55rem .35rem;border-block-end:1px solid var(--line);font-size:.82rem}
.search-results a:hover{background:#f4e5dc}
.search-results small{display:block;color:var(--muted);font-size:.72rem}
.search-results p{font-size:.84rem;color:var(--muted);padding:.7rem 0}
.image-dialog{width:min(94vw,1180px)}
.image-dialog img{max-height:70dvh;object-fit:contain}
.failure{margin-block:44px;padding:20px;background:#efdcd4}
@media(max-width:1150px){.hero{min-height:460px;grid-template-columns:44% 56%}.frame{width:calc(100% - 64px)}.hero-content{padding:clamp(24px,3.6vw,50px)}.studio{grid-template-columns:1fr}.studio-intro>p:not(.eyebrow){max-width:62ch}}
@media(max-width:820px){:root{--header:62px}.frame{width:calc(100% - 38px)}.bar-layout{grid-template-columns:1fr auto}.top-nav{display:none}.hero{margin-block-start:14px}.chapter-grid{grid-template-columns:repeat(2,1fr)}.reader{grid-template-columns:minmax(130px,.6fr) minmax(0,1.65fr);gap:18px}.reader-nav a{gap:.45rem;font-size:.75rem}}
@media(max-width:560px){.frame{width:calc(100% - 28px)}.wordmark span,kbd,.search-trigger span[data-text]{display:none}.top-actions{gap:8px}.search-trigger,.language{min-height:44px}.search-trigger{min-width:44px}.hero{min-height:auto;grid-template-columns:1fr}.hero-content{padding:30px 24px 33px}.hero-content::after{inset:9px}.hero h1{font-size:clamp(2.65rem,11vw,4.8rem);margin-block:13px}:lang(ar) .hero h1{font-size:clamp(2.1rem,9vw,3.4rem)}.hero-image{aspect-ratio:1.28}.hero-image img{object-position:50% 43%}.hero-actions{margin-block-start:15px}.library{padding-block:35px 44px}.section-heading{align-items:start;margin-block-end:15px}.chapter-grid{grid-template-columns:1fr}.chapter-link{min-height:0;padding:13px 11px}.studio{padding:14px;gap:13px;margin-block-end:38px}.studio-body{grid-template-columns:minmax(0,1fr);min-height:0}.studio-stage{border-inline-start:0;border-block-start:1px solid var(--line)}.reset{min-height:44px}.switch button,.row-actions button{width:44px;height:44px}.layout-rows li{padding:.25rem .45rem}.reader{display:flex;flex-direction:column;padding-block:13px 36px;gap:12px}.reader-nav{padding:4px;position:static;max-height:none;overflow:auto;display:flex;border-block-end:1px solid var(--line);align-self:stretch}.reader-nav a,.reader-nav a:first-child{flex:none;white-space:nowrap;min-height:44px;padding:.4rem .55rem;border-inline-start:0;border-block-end:2px solid transparent;margin:0}.reader-nav a[aria-current=page]{border-color:var(--wine)}.reader-nav a svg{display:none}.gallery{grid-template-columns:1fr}.footer-inner{justify-content:start;gap:8px 16px}.footer p{order:3;flex-basis:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:560px){.crop-demo{grid-template-columns:minmax(0,1fr)}}

:root {
  --paper:#f7f0e7;
  --cream:#fffbf5;
  --wine:#55182b;
  --wine-deep:#321421;
  --rose:#f0cbbf;
  --line:#dbcbc1;
  --header:76px;
}
body {
  background:radial-gradient(ellipse at 18% 4%,#fff9ee 0%,transparent 49rem),var(--paper);
}
.topbar {
  background:#fffaf2f2;
  border-block-end-color:#dfcfc4;
}
.top-nav {gap:.35rem}
.top-nav > a,.contents-trigger {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  min-height:44px;
  padding:.55rem .95rem;
  border:1px solid transparent;
  border-radius:100px;
  font-size:.79rem;
  font-weight:550;
  white-space:nowrap;
}
.top-nav > a:hover,.top-nav > a[aria-current],.contents-trigger {
  color:var(--wine);
  background:#f1e1d8;
  text-decoration:none;
}
.contents-trigger:is(:hover,[aria-expanded=true]) {background:#ead4c9}
.contents-trigger[aria-expanded=true] svg {transform:rotate(180deg)}
.contents-trigger svg,.language svg {width:16px;height:16px}
.search-trigger,.language {
  min-height:44px;
  border-radius:100px;
  padding-inline:.75rem;
}
.search-trigger:hover,.language:hover {background:#f4e7df;text-decoration:none}
.language {gap:.35rem;white-space:nowrap}
.hero {
  position:relative;
  isolation:isolate;
  align-items:stretch;
  margin-block-start:23px;
  min-height:clamp(435px,43vw,608px);
  grid-template-columns:minmax(0,43fr) minmax(0,57fr);
  border-radius:25px;
  background:var(--wine-deep);
  box-shadow:0 20px 44px -30px #3c1b27b8;
}
.hero-content {
  z-index:1;
  padding:clamp(34px,4.8vw,76px);
  background:
    radial-gradient(ellipse at 0 85%,#6d253b 0%,transparent 72%),
    linear-gradient(143deg,#2a161d,#441929);
}
.hero-content::after {
  inset:14px;
  border-color:#ffdecb3b;
  border-radius:14px;
}
.hero .hero-meta {gap:10px}
.hero .eyebrow {color:#ffe1d6;font-weight:500}
.hero .version {border-radius:100px;border:1px solid #ffffff30}
.hero h1 {
  font-size:clamp(2.8rem,5.25vw,5.65rem);
  letter-spacing:-.055em;
  line-height:1;
  margin-block:22px 19px;
}
:lang(ar) .hero h1 {font-size:clamp(2.4rem,4.75vw,5rem);line-height:1.27}
.hero h1 em {color:#ffd4c5}
.hero-description {max-width:38ch}
.hero-actions {gap:10px 19px}
.button-light {border-radius:100px;background:#fff0e3;padding-inline:1.05rem}
.hero-link {color:#fff0e6}
.hero-image img {object-position:37% 47%}
.hero-image::after {
  content:'';
  position:absolute;
  inset:55% 0 0;
  background:linear-gradient(transparent,#24161778);
  pointer-events:none;
}
.hero-image figcaption {
  z-index:1;
  inset-block-end:19px;
  inset-inline-end:19px;
  padding:0;
  border:1px solid #fff3e371;
  border-radius:100px;
  background:#29191fc9;
  backdrop-filter:blur(10px);
}
.demo-link {display:flex;align-items:center;gap:.6rem;min-height:42px;padding-inline:.9rem;font-size:.76rem}
.demo-link:hover {background:#15101768;border-radius:inherit}
.demo-link svg {width:15px;height:15px}
.hero h1:focus:not(:focus-visible),.chapter-article:focus:not(:focus-visible),.topic:focus:not(:focus-visible) {outline:none}

.library {padding-block:60px 73px}
.section-heading {gap:14px;margin-block-end:20px}
.section-heading h2 {color:var(--wine-deep)}
.chapter-grid {
  border:0;
  gap:12px;
}
.chapter-link {
  min-height:151px;
  padding:clamp(15px,1.65vw,25px);
  border:1px solid var(--line);
  border-radius:15px;
  background:var(--cream);
  box-shadow:0 5px 15px #3d231509;
  transition:background .2s, border-color .2s, transform .2s;
}
.chapter-link:is(:hover,:focus-visible) {
  background:#f8e8de;
  border-color:#b88084;
  transform:translateY(-3px);
}
.tile-icon,.chapter-link > .tile-icon {display:grid;place-items:center;width:39px;height:39px;border:1px solid #e5c8bd;border-radius:11px;background:#f6e7dc;color:var(--wine)}
.chapter-link h3 {font-size:1.02rem;color:var(--wine-deep)}
.chapter-link:first-child {background:#f2dfd4;border-color:#d5b1a4}
.chapter-link:first-child:hover {background:#edcfc2}
.chapter-link:first-child > .tile-icon {background:#673044;color:#fff1e7;border-color:transparent}
.chapter-link .arrow {margin-block-start:.48rem}
.studio {
  border-radius:25px;
  background:radial-gradient(ellipse at 100% 100%,#71364a,transparent 70%),#3c1928;
  color:var(--cream);
}
.studio-intro .eyebrow,.studio-intro > p:not(.eyebrow) {color:#f3d8cb}
.studio-body {border-color:#e4c5b9;color:var(--ink);border-radius:17px;overflow:hidden}
.studio-stage {background:linear-gradient(155deg,#f2e3d8,#e2c6ba)}
.layout-rows li,.switch button,.row-actions button {border-radius:8px}
.mini-store {border-radius:8px;overflow:hidden}
.footer {background:#efe2d7}

.reader {
  grid-template-columns:minmax(160px,.82fr) minmax(0,3.3fr) minmax(155px,.82fr);
  gap:clamp(18px,3vw,50px);
  align-items:start;
}
.reader-nav,.reader-index {
  position:sticky;
  inset-block-start:calc(var(--header) + 20px);
  max-height:calc(100dvh - var(--header) - 42px);
  overflow:auto;
  scrollbar-width:thin;
}
.reader-nav {padding:4px;display:grid;gap:3px}
.reader-nav a,.reader-nav a:first-child {border:0;border-radius:9px;padding:.56rem;min-height:44px}
.reader-nav a[aria-current] {background:#ead2c6;box-shadow:inset 0 0 0 1px #d9b4a7}
.reader-index {padding:6px 1px}
.reader-index h2 {font-size:.81rem;color:var(--wine);margin-block-end:10px}
.topic-jump {display:grid;gap:3px;padding:0;border:0}
.topic-jump a {
  border:0;
  border-inline-start:1px solid #d6bbb0;
  padding:.45rem .63rem;
  color:var(--muted);
  font-size:.76rem;
  line-height:1.5;
}
.topic-jump a:hover,.topic-jump a[aria-current] {background:#f0ded5;color:var(--wine);border-inline-color:var(--wine)}
.inline-index {display:none}
.article-head {
  overflow:hidden;
  border-radius:20px;
  background:radial-gradient(ellipse at 100% 100%,#70283f 0%,transparent 80%),var(--wine-deep);
}
.article-head .tile-icon {display:grid;width:38px;height:38px;background:#ffddcb19;border-color:#eab6a453}
.article-head .tile-icon svg {width:23px;height:23px}
.article-meta .version {border-radius:100px}
.topic {padding-block:clamp(22px,3.15vw,47px);font-size:.95rem}
.topic h2 {color:var(--wine-deep);font-weight:650}
.topic .task-steps {padding:0;margin:1.05rem 0;list-style:none;counter-reset:steps;display:grid;gap:6px}
.task-steps li {
  counter-increment:steps;
  display:grid;
  grid-template-columns:30px minmax(0,1fr);
  align-items:center;
  gap:.7rem;
  margin:0;
  padding:.55rem;
  min-height:46px;
  border:1px solid #e8d9d0;
  border-radius:9px;
  background:var(--cream);
}
.task-steps li::before {
  content:counter(steps);
  display:grid;
  place-items:center;
  min-height:30px;
  border-radius:8px;
  background:#f1e0d6;
  color:var(--wine);
  font-size:.78rem;
  font-weight:650;
  font-variant-numeric:tabular-nums;
}
.result {display:flex;align-items:flex-start;gap:.62rem;border:1px solid #dfc6ba;border-radius:10px;background:#f0e1d7}
.result svg {width:19px;height:19px;margin-block-start:3px;color:var(--wine)}
.data-table {border:1px solid var(--line);border-radius:10px}
.data-table :is(td,th) {border:0;border-block-end:1px solid var(--line)}
.data-table tr:last-child :is(td,th) {border-block-end:0}
.gallery button {border-radius:11px;overflow:hidden}
.article-next a {min-height:44px}

.dialog {border-radius:20px}
.dialog[open] {animation:dialog-appear .23s cubic-bezier(.2,.75,.25,1) both}
@keyframes dialog-appear {from{opacity:0;transform:translateY(9px) scale(.985)} to{opacity:1;transform:none}}
.dialog .icon-button {border-radius:50%;min-width:44px;min-height:44px;background:var(--paper)}
.dialog .icon-button:hover {background:#eddbce}
.dialog-head h2 {font-size:clamp(1.2rem,3vw,1.85rem);color:var(--wine-deep)}
.contents-dialog {width:min(950px,calc(100% - 42px));max-height:min(760px,85dvh)}
.contents-inner {padding:clamp(17px,3vw,36px)}
.contents-dialog .dialog-head {margin-block-end:21px}
#contents-menu {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.menu-group {padding:12px;border:1px solid var(--line);border-radius:14px;background:#f9f0e8}
.menu-group h3 {padding:.3rem .28rem .7rem;color:var(--wine);font-size:.78rem}
.menu-chapter {
  display:grid;
  grid-template-columns:32px minmax(0,1fr) 14px;
  align-items:center;
  gap:.52rem;
  min-height:54px;
  padding:.4rem;
  border-radius:8px;
  font-size:.85rem;
  font-weight:550;
}
.menu-chapter .tile-icon {width:32px;height:32px;border-radius:8px}
.menu-chapter .tile-icon svg,.menu-chapter .arrow svg {width:15px;height:15px}
.menu-chapter .arrow {color:var(--wine)}
.menu-chapter:is(:hover,[aria-current]) {background:#ead0c3;color:var(--wine)}
.contents-footer {display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 18px;margin-block-start:14px}
.contents-footer a {min-height:44px;color:var(--wine)}
.search-input {border-radius:11px}
.search-shortcuts h3 {font-size:.82rem;margin-block:8px;color:var(--wine)}
.search-shortcuts > div {display:flex;flex-wrap:wrap;gap:7px}
.search-shortcuts button {border:1px solid var(--line);border-radius:100px;background:#f2e4da;padding:.5rem .85rem;min-height:44px;font-size:.8rem}
.search-shortcuts button:hover {background:#ead2c6}
.mobile-nav {display:none}

@media(max-width:1060px) {
  .reader {grid-template-columns:minmax(155px,.75fr) minmax(0,3fr);gap:25px}
  .reader-index {display:none}
  .inline-index {display:block;margin-block-start:9px;border:1px solid var(--line);border-radius:11px;background:var(--cream)}
  .inline-index summary {display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;min-height:48px;padding:.45rem .75rem;font-size:.86rem;font-weight:620;color:var(--wine);cursor:pointer}
  .inline-index summary::-webkit-details-marker {display:none}
  .inline-index[open] summary svg {transform:rotate(180deg)}
  .inline-index .topic-jump {padding:0 .75rem .6rem}
  .inline-index .topic-jump a {min-height:40px;display:flex;align-items:center}
}
@media(max-width:820px) {
  :root {--header:64px}
  body {padding-block-end:calc(65px + env(safe-area-inset-bottom))}
  .mobile-nav {
    position:fixed;
    inset:auto 0 0;
    z-index:8;
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:3px;
    padding:4px max(10px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
    background:#fffaf3f5;
    border-block-start:1px solid var(--line);
    box-shadow:0 -5px 20px #34182412;
    backdrop-filter:blur(12px);
  }
  .mobile-nav :is(button,a) {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    min-height:54px;
    padding:0 .15rem;
    border:0;
    border-radius:9px;
    background:none;
    font-size:.69rem;
    font-weight:550;
    color:var(--wine);
  }
  .mobile-nav svg {width:20px;height:20px}
  .mobile-nav :is([aria-current],[aria-expanded=true]),.mobile-nav :is(button,a):hover {background:#f0e0d6}
  .top-actions .search-trigger {display:none}
  .reader {display:block;padding-block:15px 42px}
  .reader-nav {display:none}
  .hero {margin-block-start:12px}
  .hero-content {padding:32px 25px}
  .hero-content::after {inset:10px}
  .hero h1 {font-size:clamp(2.45rem,6.1vw,3.6rem)}
  :lang(ar) .hero h1 {font-size:clamp(2.1rem,5.2vw,3.2rem)}
  .contents-dialog {margin:auto auto 0;width:min(100%,620px);max-height:calc(90dvh - env(safe-area-inset-top));border-radius:23px 23px 0 0}
  .contents-inner {padding-block-end:calc(14px + env(safe-area-inset-bottom))}
  #contents-menu {grid-template-columns:1fr;gap:8px}
  .menu-group {padding:7px}
  .menu-group h3 {padding:.26rem .4rem}
  .menu-chapter {min-height:44px;padding:.32rem}
  .task-steps li {min-height:44px}
}
@media(max-width:560px) {
  .hero {grid-template-columns:minmax(0,1fr);border-radius:18px;min-height:0}
  .hero-content {padding:30px 24px 28px}
  .hero-content::after {inset:9px;border-radius:11px}
  .hero h1 {font-size:clamp(2.4rem,11vw,3.85rem);margin-block:12px 9px}
  :lang(ar) .hero h1 {font-size:clamp(2rem,8.75vw,3.18rem)}
  .hero-actions {gap:7px 15px;margin-block-start:12px}
  .hero-link {font-size:.72rem}
  .hero-image {aspect-ratio:1.48}
  .hero-image img {object-position:50% 23%}
  .hero-image figcaption {inset-block-end:10px;inset-inline-end:11px}
  .library {padding-block:27px 42px}
  .chapter-grid {gap:8px}
  .chapter-link {min-height:auto;gap:.65rem;padding:12px}
  .studio {border-radius:17px}
}

@media print{.topbar,.footer,.reader-nav,.article-next,.studio,.topic-jump,.hero-image,.hero-actions{display:none!important}.frame{width:100%}.reader,.hero{display:block;min-height:0;padding:0}.article-head,.hero-content{color:#000;background:#fff;padding:0}.article-head p,.hero-description,.hero .eyebrow,.hero h1 em{color:#000}.topic{break-inside:avoid}.gallery button img{max-height:160px}.gallery button{break-inside:avoid}}
@media print {.mobile-nav,.reader-index,.inline-index {display:none!important}body {padding:0}}
