:root{
  --bg:#FBF6EE; --paper:#FFFDF9; --ink:#2B2118; --muted:#7A6A5C; --line:#E8DCCB; --line2:#D9C8B2;
  --accent:#C8674B; --accent-d:#A94F36; --accent-soft:#F8E6DE; --teal:#4F8482; --gold:#E2B25C;
  --shadow-s:0 1px 2px rgba(60,35,15,.06),0 3px 10px rgba(60,35,15,.07);
  --shadow-l:0 4px 10px rgba(60,35,15,.08),0 18px 44px rgba(60,35,15,.16);
  --r:18px;
  --display:"Lalezar","Tajawal",system-ui,sans-serif;
  --title:"El Messiri","Tajawal",system-ui,sans-serif;
  --body:"Tajawal",system-ui,"Segoe UI",Tahoma,sans-serif;
  /* Layout: one centred column for the header, the maker and the download bar. app.js replaces the three
     heights with measured ones; these are what they come to before it runs. */
  --wrap:1180px; --gut:14px;
  --top-h:60px; --tabs-h:72px; --bar-h:calc(77px + env(safe-area-inset-bottom,0px));
}
*{box-sizing:border-box}
[hidden]{display:none!important}
/* set for a moment by the script in the page's head while the text faces arrive (see index.html) */
.fw main{visibility:hidden}
/* The fanned hero covers are rotated past the page edge on purpose; never let them cause sideways scrolling. */
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;overflow-x:hidden;scroll-padding-top:var(--top-h);scroll-padding-bottom:calc(var(--bar-h) + 8px)}
@supports (overflow:clip){html{overflow-x:clip}}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--body);font-size:16px;line-height:1.7;-webkit-font-smoothing:antialiased;padding-bottom:calc(var(--bar-h) + 8px)}
h1,h2,h3{font-family:var(--title);line-height:1.3;margin:0}
a{color:inherit}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid rgba(200,103,75,.45);outline-offset:2px;border-radius:10px}
.muted{color:var(--muted)}

.top{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;padding:0 max(16px,env(safe-area-inset-right),calc((100% - var(--wrap))/2 + var(--gut))) 0 max(16px,env(safe-area-inset-left),calc((100% - var(--wrap))/2 + var(--gut)));background:var(--bg);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;font-family:var(--display);font-size:28px;line-height:1;color:var(--ink)}
.brand svg{width:34px;height:34px}
.top nav{display:flex;align-items:center;gap:16px;font-weight:500;font-size:15px}
.top nav a{text-decoration:none}
.top nav a:not(.btn){color:var(--muted)}
@media (max-width:520px){.top nav a:not(.btn){display:none}}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 20px;border-radius:14px;border:1.5px solid var(--line2);background:var(--paper);font-weight:700;text-decoration:none;white-space:nowrap;transition:transform .12s ease,box-shadow .12s ease,background .12s ease}
.btn:hover{border-color:var(--accent)}
.btn:active{transform:translateY(1px)}
.btn.pri{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 6px 16px rgba(200,103,75,.32)}
.btn.pri:hover{background:var(--accent-d);border-color:var(--accent-d)}
.btn.ghost{background:transparent;border-style:dashed}
.btn.sm{min-height:38px;padding:0 16px;border-radius:11px;font-size:15px}
.btn.lg{min-height:56px;padding:0 30px;font-size:19px;border-radius:16px}
.btn[disabled]{opacity:.55;pointer-events:none}
.icon{width:42px;height:42px;border-radius:12px;border:1px solid var(--line2);background:var(--paper);font-size:18px;line-height:1}

.hero{display:grid;gap:26px;align-items:center;padding:30px max(18px,calc((100% - var(--wrap))/2 + 18px)) 10px}
.hero-text{display:flex;flex-direction:column;align-items:flex-start;gap:14px}
.pill{display:inline-block;background:var(--accent-soft);color:var(--accent-d);font-weight:700;font-size:13.5px;padding:4px 14px;border-radius:99px}
.hero h1{font-family:var(--display);font-weight:400;font-size:clamp(34px,8.4vw,60px);line-height:1.22;text-wrap:balance}
.hero p{margin:0;font-size:clamp(16.5px,3.9vw,20px);color:var(--muted);max-width:34em}
.ticks{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px 18px;font-weight:500;font-size:15px}
/* (weight 700, the bold the page already has: at 800 the line was laid out taller until that file arrived, then jumped) */
.ticks li::before{content:"✓";color:var(--teal);font-weight:700;margin-inline-end:6px}
.hero-art{position:relative;height:clamp(250px,62vw,440px)}
.hero-art canvas{position:absolute;top:50%;left:50%;height:92%;width:auto;border-radius:10px;box-shadow:var(--shadow-l);background:#fff}
.hero-art canvas:nth-child(1){transform:translate(-112%,-50%) rotate(-9deg)}
.hero-art canvas:nth-child(2){transform:translate(12%,-50%) rotate(8deg)}
.hero-art canvas:nth-child(3){transform:translate(-50%,-52%) rotate(-1deg);z-index:2}
/* The three pictures take the shape of what the page sells, from the first paint: tall story cards (9:16),
   landscape certificates, A4 sheets otherwise. <html data-hero> is set by the script in the page's head,
   data-shape by app.js once it knows the real pages (a 5:7 card, say). */
:root[data-hero="card"] .hero-art:not([data-shape]) canvas,.hero-art[data-shape="story"] canvas{aspect-ratio:9/16}
:root[data-hero="cert"] .hero-art:not([data-shape]) canvas,.hero-art[data-shape="wide"] canvas{aspect-ratio:297/210;height:56%}
:root[data-hero="cert"] .hero-art:not([data-shape]) canvas:nth-child(1),.hero-art[data-shape="wide"] canvas:nth-child(1){transform:translate(-88%,-84%) rotate(-7deg)}
:root[data-hero="cert"] .hero-art:not([data-shape]) canvas:nth-child(2),.hero-art[data-shape="wide"] canvas:nth-child(2){transform:translate(-14%,-16%) rotate(6deg)}
:root[data-hero="cert"] .hero-art:not([data-shape]) canvas:nth-child(3),.hero-art[data-shape="wide"] canvas:nth-child(3){transform:translate(-50%,-50%) rotate(-1deg)}
/* On a phone the root alone does not stop the page growing sideways (the covers made it 4px too wide), so the
   hero spans the whole window and clips them itself. */
.hero{overflow:hidden}
@supports (overflow:clip){.hero{overflow:visible;overflow-x:clip}}
/* side by side: the covers grow with their own column, so they never slide over the headline */
@media (min-width:900px){.hero{grid-template-columns:1.05fr 1fr;padding:54px max(28px,calc((100% - var(--wrap))/2 + 28px)) 26px}.hero-art{height:clamp(280px,calc((100vw - 82px)*.37),440px)}.hero-art canvas{left:43%;height:88%}}

.maker{padding:10px 0 30px}
/* The tabs ride in a full-width band that parks right under the header (one pixel under it, so no seam
   can open between the two); together they read as one solid block and nothing scrolls past in between. */
.tabs-bar{position:sticky;top:calc(var(--top-h) - 1px);z-index:10;background:var(--bg);padding:7px max(var(--gut),env(safe-area-inset-right)) 6px max(var(--gut),env(safe-area-inset-left));margin-bottom:10px;border-bottom:1px solid transparent;transition:border-color .15s ease,box-shadow .15s ease}
.tabs-bar.stuck{border-bottom-color:var(--line);box-shadow:0 10px 18px -14px rgba(60,35,15,.3)}
.tabs{display:flex;gap:6px;max-width:calc(var(--wrap) - 2*var(--gut));margin:0 auto;background:#F1E7D9;border-radius:16px;padding:6px;box-shadow:var(--shadow-s);overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.tabs::-webkit-scrollbar{display:none}
.tabs button{flex:1 0 auto;border:0;background:transparent;border-radius:12px;min-height:46px;font-weight:700;font-size:15.5px;color:var(--muted);padding:0 14px;white-space:nowrap}
.tabs button[aria-selected="true"]{background:var(--paper);color:var(--ink);box-shadow:var(--shadow-s)}
@media (max-width:430px){.tabs button{font-size:14.5px;padding:0 12px}}
.maker-grid{display:grid;gap:18px;max-width:var(--wrap);margin:0 auto;padding:0 max(var(--gut),env(safe-area-inset-right)) 0 max(var(--gut),env(safe-area-inset-left))}
@media (min-width:980px){
  .maker-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);align-items:start}
  /* parks under the header and tabs, and stops short of the download bar; long files scroll inside it */
  .preview{position:sticky;top:calc(var(--top-h) + var(--tabs-h) + 9px);max-height:calc(100vh - var(--top-h) - var(--tabs-h) - var(--bar-h) - 21px);overflow-y:auto}
  @supports (height:100dvh){.preview{max-height:calc(100dvh - var(--top-h) - var(--tabs-h) - var(--bar-h) - 21px)}}
  .preview::-webkit-scrollbar{width:6px}
  .preview::-webkit-scrollbar-thumb{background:var(--line2);border-radius:99px}
  .preview::-webkit-scrollbar-track{background:transparent;margin:14px 0}
}
/* A very short window (a phone on its side): the tabs scroll away with the page instead of staying put. */
@media (max-height:520px){.tabs-bar{position:static}}
@media (max-height:520px) and (min-width:980px){.preview{top:calc(var(--top-h) + 10px)}}
.panel{display:grid;gap:16px;min-width:0}
.step,.preview{background:var(--paper);border:1px solid var(--line);border-radius:var(--r);padding:16px;box-shadow:var(--shadow-s);min-width:0}
.step h3,.preview h3{font-size:20px;display:flex;align-items:center;gap:10px;margin-bottom:12px}
.step h3 b{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--accent);color:#fff;font-family:var(--body);font-size:17px;font-weight:800;flex:none}
.preview-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.preview-head h3{margin:0}
.hint{margin:4px 0 12px;font-size:14px;color:var(--muted)}

.chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.chip{border:1.5px solid var(--line2);background:var(--paper);border-radius:99px;min-height:40px;padding:0 15px;font-weight:500;font-size:15px;display:inline-flex;align-items:center;gap:6px;user-select:none}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.chip.sel[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-d);font-weight:700}
.chip.sel[aria-pressed="true"]::before{content:"✓";font-weight:800}
.chip.add{border-style:dashed;color:var(--muted)}

.themes-wrap{position:relative}
.themes-more{display:none}
.themes{display:grid;grid-auto-flow:column;grid-auto-columns:138px;gap:12px;overflow-x:auto;padding:6px 6px 12px;scroll-padding-inline:6px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.themes.cert{grid-auto-columns:210px}
.theme{scroll-snap-align:start;border:0;background:none;padding:0;display:grid;gap:6px;text-align:center;font-weight:700;font-size:15px}
.theme canvas{width:100%;height:auto;border-radius:10px;background:#f3ece1;box-shadow:var(--shadow-s);outline:3px solid transparent;outline-offset:2px;transition:outline-color .12s ease,transform .12s ease}
.theme[aria-pressed="true"] canvas{outline-color:var(--accent);transform:translateY(-2px)}
.theme[aria-pressed="true"] span{color:var(--accent-d)}
/* Desktop: a compact grid with its own scroll, so the form is never thousands of pixels away. app.js sets
   --pick-h so that a part of the next row always shows; the fade and the round button say there is more. */
@media (min-width:980px){
  .themes{grid-auto-flow:row;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:14px 10px;overflow-x:hidden;overflow-y:auto;max-height:var(--pick-h,430px);padding:6px 6px 10px;scroll-snap-type:none}
  .themes.cert{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
  .themes::-webkit-scrollbar{width:6px}
  .themes::-webkit-scrollbar-thumb{background:var(--line2);border-radius:99px}
  .themes::-webkit-scrollbar-track{background:transparent}
  .theme{font-size:13.5px;gap:5px;align-content:start}
  .theme .pick{gap:5px}
  .ways{gap:6px}
  .way{width:18px;height:18px}
  .themes-wrap::before,.themes-wrap::after{content:"";position:absolute;left:10px;right:0;height:40px;pointer-events:none;opacity:0;transition:opacity .15s ease;z-index:1}
  .themes-wrap::before{top:0;height:22px;background:linear-gradient(var(--paper),rgba(255,253,249,0))}
  .themes-wrap::after{bottom:0;background:linear-gradient(rgba(255,253,249,0),var(--paper) 85%)}
  .themes-wrap.more-up::before,.themes-wrap.more-down::after{opacity:1}
  .themes-wrap.more-down .themes-more{display:grid}
  .themes-more{position:absolute;z-index:2;bottom:-12px;left:50%;transform:translateX(-50%);place-items:center;width:36px;height:36px;border-radius:50%;border:1px solid var(--line2);background:var(--paper);color:var(--accent-d);box-shadow:var(--shadow-s);padding:0}
  .themes-more:hover{border-color:var(--accent)}
  .themes-more svg{width:20px;height:20px}
}
@supports not selector(::-webkit-scrollbar){.themes,.preview{scrollbar-width:thin;scrollbar-color:var(--line2) transparent}}

.form{display:grid;gap:12px}
.form .two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.field{display:grid;gap:5px;min-width:0}
.field>span{font-weight:700;font-size:14.5px}
.field>span i{font-style:normal;font-weight:400;color:var(--muted);font-size:13px}
.field input,.field select,.field textarea{width:100%;min-height:48px;border:1.5px solid var(--line2);border-radius:12px;background:#fff;padding:10px 14px;font-size:16px}
.field textarea{min-height:150px;line-height:1.9;resize:vertical}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 4px rgba(200,103,75,.15)}
.field.err input{border-color:#d1343a;box-shadow:0 0 0 4px rgba(209,52,58,.12)}
.seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:6px;background:#F1E7D9;border-radius:12px;padding:5px}
.seg button{border:0;background:transparent;border-radius:9px;min-height:40px;font-weight:700;color:var(--muted)}
.seg button[aria-pressed="true"]{background:#fff;color:var(--ink);box-shadow:var(--shadow-s)}
details.more{border:1.5px dashed var(--line2);border-radius:12px;padding:10px 14px}
details.more summary{font-weight:700;cursor:pointer}
details.more[open] summary{margin-bottom:10px}
details.more .form{gap:10px}
.sub-h{font-weight:700;margin:14px 0 8px;font-size:15.5px}
.sub-h:first-child{margin-top:0}
/* in the form the grid's own gap already separates a heading from its chips */
.form .sub-h+.chips{margin-top:-8px;margin-bottom:0}
/* a small label over each group of chips (the planner's pages) */
.group-h{margin:10px 0 6px;font-size:13.5px;font-weight:500;color:var(--muted)}
.sub-h+.group-h{margin-top:0}
.addrow{display:flex;gap:8px;margin-top:10px}
.addrow input{flex:1;min-width:0;min-height:44px;border:1.5px solid var(--line2);border-radius:12px;padding:8px 12px;background:#fff}
.toggle{display:flex;align-items:center;gap:10px;margin-top:12px;font-weight:500}
.toggle input{width:22px;height:22px;accent-color:var(--accent)}

.pages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.pages.cert{grid-template-columns:repeat(2,minmax(0,1fr))}
.pages button{border:0;padding:0;background:none;display:block;position:relative}
.pages canvas{width:100%;height:auto;display:block;border-radius:6px;background:#f3ece1;box-shadow:var(--shadow-s)}
.pages button:first-child{grid-column:span 2;grid-row:span 2}
.pages.cert button:first-child{grid-column:span 2;grid-row:auto}
.pages small{position:absolute;inset-inline-start:6px;bottom:6px;background:rgba(43,33,24,.72);color:#fff;border-radius:99px;font-size:11.5px;padding:1px 8px;line-height:1.6}
@media (min-width:620px) and (max-width:979px){.pages{grid-template-columns:repeat(5,minmax(0,1fr))}}

.band{max-width:var(--wrap);margin:0 auto;padding:34px max(var(--gut),env(safe-area-inset-right)) 34px max(var(--gut),env(safe-area-inset-left));scroll-margin-top:6px}
.band h2{font-size:26px;margin-bottom:16px}
.how{list-style:none;margin:0;padding:0;display:grid;gap:12px;counter-reset:s}
.how li{counter-increment:s;background:var(--paper);border:1px solid var(--line);border-radius:var(--r);padding:16px 18px 16px 18px;display:grid;gap:2px;position:relative;padding-inline-start:70px}
.how li::before{content:counter(s,arabic-indic);position:absolute;inset-inline-start:16px;top:16px;width:40px;height:40px;border-radius:50%;background:var(--accent-soft);color:var(--accent-d);display:grid;place-items:center;font-weight:800;font-size:19px}
.how b{font-family:var(--title);font-size:19px}
.how span{color:var(--muted)}
@media (min-width:760px){.how{grid-template-columns:repeat(3,1fr)}}
#seo-copy{max-width:780px}
#seo-copy h2{font-size:24px;margin:26px 0 10px}
#seo-copy h2:first-child{margin-top:0}
#seo-copy h3{font-size:19px;margin:18px 0 6px}
#seo-copy p,#seo-copy li{color:#4a3d32}
#seo-copy details{background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:12px 16px;margin-bottom:8px}
#seo-copy summary{font-weight:700;cursor:pointer}
#seo-copy details p{margin:8px 0 0}
#seo-copy a{color:var(--accent-d);font-weight:500}
.foot{max-width:var(--wrap);margin:0 auto;padding:22px max(var(--gut),env(safe-area-inset-right)) 30px max(var(--gut),env(safe-area-inset-left));display:flex;flex-wrap:wrap;gap:8px 20px;color:var(--muted);font-size:14.5px;border-top:1px solid var(--line)}

/* Always on the bottom edge and solid, with its contents on the page column. When the host shows its own
   badge in a bottom corner, app.js measures it and picks one of three arrangements (data-badge on <html>):
   beside  a wide window: the row keeps clear of the badge (--badge-xr / --badge-xl) and lines up with it (--badge-pb)
   tuck    a phone: title and price on one line, the button on the badge's row next to it (--badge-free wide)
   above   no room next to it at all: the row sits above the badge (--badge-pb) */
.buybar{position:fixed;left:0;right:0;bottom:0;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px max(var(--gut),env(safe-area-inset-right),calc((100% - var(--wrap))/2 + var(--gut)),var(--badge-xr,0px)) max(calc(12px + env(safe-area-inset-bottom,0px)),var(--badge-pb,0px)) max(var(--gut),env(safe-area-inset-left),calc((100% - var(--wrap))/2 + var(--gut)),var(--badge-xl,0px));
  background:var(--paper);border-top:1px solid var(--line);box-shadow:0 -6px 24px rgba(60,35,15,.1)}
.buybar-info{display:grid;line-height:1.35;min-width:0}
.buybar-info strong{font-size:16.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.buybar-info span{font-size:14px}
/* the second line is always there, so the title does not move when the price arrives */
#bar-sub{display:block;min-height:1.35em}
#bar-sub .bar-price{font-weight:700;color:var(--ink);white-space:nowrap;margin-inline-start:10px}
.buybar .btn{min-height:52px;padding:0 22px;font-size:17px;flex:none}
@media (max-width:520px){.buybar{padding-top:10px}.buybar .btn{min-height:48px}}
:root[data-badge="tuck"] .buybar{display:grid;grid-template-columns:minmax(0,1fr);justify-items:end;gap:8px}
:root[data-badge="tuck"][data-badge-side="left"] .buybar{justify-items:start}
:root[data-badge="tuck"] .buybar-info{justify-self:stretch;display:flex;flex-wrap:wrap;align-items:baseline;gap:0 10px}
:root[data-badge="tuck"] .buybar .btn{width:var(--badge-free);min-height:46px;padding:0 6px;font-size:16px}
@media (max-width:380px){:root[data-badge="tuck"] .buybar-info strong{font-size:15.5px}:root[data-badge="tuck"] .buybar-info span{font-size:13px}}

.sheet{position:fixed;inset:0;z-index:50;background:#2a2622;color-scheme:dark;display:flex;flex-direction:column}
.sheet-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;color:#fff;font-weight:700}
.sheet-bar .icon{background:#3a342e;border-color:#4a433c;color:#fff}
.lb-nav{display:flex;gap:8px}
.sheet-body{flex:1;overflow:auto;display:grid;place-items:start center;padding:6px 10px calc(24px + var(--badge-y,0px))}
.sheet-body canvas{max-width:min(100%,860px);height:auto;border-radius:6px;box-shadow:0 10px 40px rgba(0,0,0,.5)}

.modal{position:fixed;inset:0;z-index:60;background:rgba(43,33,24,.55);display:grid;place-items:end center;padding:0}
@media (min-width:560px){.modal{place-items:center;padding:20px}}
.modal-card{position:relative;width:min(100%,460px);background:var(--paper);border-radius:22px 22px 0 0;padding:22px 18px max(calc(22px + env(safe-area-inset-bottom,0px)),calc(10px + var(--badge-y,0px)));display:grid;grid-template-columns:minmax(0,1fr);gap:12px;box-shadow:var(--shadow-l);max-height:92vh;overflow:auto}
@media (min-width:560px){.modal-card{border-radius:22px;padding:26px}}
/* a card in the middle of a narrow window can reach the badge's corner: keep it above */
@media (min-width:560px) and (max-width:940px){.modal{padding-bottom:max(20px,calc(var(--badge-y,0px) + 10px))}.modal-card{max-height:calc(100vh - 40px - var(--badge-y,0px))}}
.modal-card.small{text-align:center}
.modal-card>.btn{white-space:normal;padding-block:8px;line-height:1.45;text-align:center}
.modal-card h3{font-size:22px}
.modal-card p{margin:0}
.modal-card .close{position:absolute;inset-inline-end:14px;top:14px}
.price{display:flex;align-items:baseline;gap:8px;font-family:var(--title);font-weight:700}
.price b{font-size:38px;line-height:1}
.code summary{cursor:pointer;font-weight:700;color:var(--accent-d)}
.code .row{display:flex;gap:8px;margin-top:10px}
.code input{flex:1;min-width:0;min-height:48px;border:1.5px solid var(--line2);border-radius:12px;padding:8px 12px;background:#fff;font-size:16px;letter-spacing:.04em}
.msg{font-size:14.5px;min-height:1.2em;margin-top:6px!important}
.msg.ok{color:#1c7c54}.msg.bad{color:#c0303a}
.fine{font-size:13.5px;color:var(--muted);text-align:center}
.note{background:var(--accent-soft);border-radius:12px;padding:10px 14px;font-size:14.5px;color:#6b3a28}
.bar{height:12px;border-radius:99px;background:#F1E7D9;overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--accent);border-radius:99px;transition:width .15s linear}

.doc{max-width:760px;margin:0 auto;padding:30px 18px 60px}
.doc h1{font-family:var(--display);font-weight:400;font-size:36px;margin-bottom:10px}
.doc h2{font-size:21px;margin:24px 0 6px}
/* The policy page has no download bar and no script: leave the host's corner badge its own strip under the footer. */
.doc+.foot{padding:22px 18px 92px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Moyasar form sits inside the checkout sheet */
.mysr{min-height:120px}
.mysr form{max-width:none!important}
.price .pill{font-family:var(--body);font-size:12.5px;margin-inline-start:auto}

/* Cards: a single large preview */
.pages.card{grid-template-columns:1fr;max-width:440px;margin-inline:auto}
.pages.card button:first-child{grid-column:auto;grid-row:auto}
.pages.card small{display:none}
.field>span i[id],.field>span i{white-space:normal}

/* Tap-to-fill timetable */
.tt{display:grid;gap:4px;margin-top:14px;align-items:stretch}
.tt span{display:grid;place-items:center;font-size:12.5px;font-weight:700;color:var(--muted)}
.tt .tt-d{justify-items:start;padding-inline-end:6px;color:var(--ink);font-size:13px}
.tt-c{min-height:46px;border:1.5px solid var(--line2);border-radius:9px;background:#fff;font-size:10.5px;font-weight:700;line-height:1.25;padding:2px 3px;overflow:hidden;white-space:nowrap;text-align:start;color:#2b2b33}
.chip .dot{width:12px;height:12px;border-radius:50%;border:1px solid rgba(0,0,0,.18);flex:none}
.tt-c:active{transform:scale(.96)}

/* Previews are for looking, not saving or printing */
canvas{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
@media print{body>*{display:none!important}body::after{content:"حمّل ملفك من زر التحميل للحصول على نسخة الطباعة.";display:block;padding:40px;font-family:Tajawal,sans-serif;font-size:20px}}
/* wedding package: one row per inviter, and the set of cards side by side in the preview */
.invs{display:grid;gap:8px}
.inv{display:grid;grid-template-columns:minmax(118px,40%) 1fr auto;gap:8px;align-items:center}
.inv select,.inv input{width:100%;min-width:0;min-height:48px;border:1.5px solid var(--line2);border-radius:12px;background:#fff;padding:10px 12px;font-size:16px}
.inv select:focus,.inv input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 4px rgba(200,103,75,.15)}
.inv input:disabled{background:#f3ece1;color:var(--muted)}
.inv .icon{width:44px;height:48px}
/* on a phone the longest roles («والدا العروسين معًا») do not fit beside a name: the role and ✕ on one line, the name under them */
@media (max-width:520px){.invs{gap:16px}.inv{grid-template-columns:1fr auto}.inv input{grid-column:1/-1;grid-row:2}.inv select:nth-last-child(2){grid-column:1/-1}}
.pages.card.multi{grid-template-columns:repeat(2,minmax(0,1fr));max-width:none}
.pages.card.multi small{display:block;inset-inline:6px;bottom:6px;text-align:center;font-size:12.5px;font-weight:700;padding:3px 8px}
@media (min-width:620px) and (max-width:979px){.pages.card.multi{grid-template-columns:repeat(4,minmax(0,1fr))}}
/* card picker: one tile per design family, colour dots under it */
.chips.sub{margin-top:-4px}
.chip.sm{font-size:13.5px;padding:5px 12px;min-height:34px}
.theme.fam{align-content:start}
.theme .pick{border:0;background:none;padding:0;display:grid;gap:6px;font:inherit;color:inherit;text-align:center}
.theme.fam.on canvas{outline-color:var(--accent);transform:translateY(-2px)}
.theme.fam.on .pick span{color:var(--accent-d)}
.ways{display:flex;gap:7px;justify-content:center;flex-wrap:wrap;padding:2px 0 4px}
.way{width:22px;height:22px;border-radius:50%;padding:0;border:2px solid #fff;background:var(--c);box-shadow:0 0 0 1px var(--line2)}
.way[aria-pressed="true"]{box-shadow:0 0 0 2.5px var(--accent)}
.count{margin:2px 0 0;font-size:13px}

/* ---------- site navigation, breadcrumb and the copy-first block (filled in by tools/build-pages.mjs) ---------- */
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
.crumbs{max-width:var(--wrap);margin:0 auto;padding:12px max(18px,env(safe-area-inset-right)) 0 max(18px,env(safe-area-inset-left));font-size:13.5px;color:var(--muted)}
.crumbs:empty{display:none}
.crumbs ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:2px 6px}
.crumbs li+li::before{content:"‹";margin-inline-end:6px;color:var(--line2)}
.crumbs a{text-decoration:none;display:inline-block;padding:4px 0}
.crumbs a:hover{color:var(--accent-d);text-decoration:underline}
.crumbs [aria-current]{color:var(--ink);font-weight:500}
.crumbs:not(:empty)+.hero{padding-top:12px}
@media (min-width:900px){.crumbs{padding-inline:28px}.crumbs:not(:empty)+.hero{padding-top:30px}}

.price-line{max-width:var(--wrap);margin:14px auto 0;padding:0 var(--gut);text-align:center;color:var(--muted);font-size:14.5px}
.price-line b{color:var(--ink)}

/* greeting-phrase pages: the wording comes before the maker */
.wording{padding-top:10px;padding-bottom:6px}
.wording-lead{margin:0 0 4px;font-size:17px;max-width:44em}
.wording-cols{columns:2 330px;column-gap:34px}
.w-sec{break-inside:avoid;-webkit-column-break-inside:avoid;padding-top:14px}
.wording .w-sec h2{font-size:21px;margin:0 0 6px}
.wording p,.wording li{color:#4a3d32}
.wording .w-sec p{margin:0 0 6px}
.wording ul,.wording ol{margin:0;padding-inline-start:20px}
.wording .jump{margin:16px 0 4px}

/* links to the groups of pages: on the home page, the site map and the 404 page */
.browse-lead{margin:-8px 0 16px;color:var(--muted);max-width:44em}
.browse-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));align-items:start}
/* the site map lists every page: groups of very different lengths pack better in columns */
.browse-grid.cols{display:block;columns:4 240px;column-gap:12px}
.browse-grid.cols .browse-card{break-inside:avoid;-webkit-column-break-inside:avoid;margin-bottom:12px}
.browse-card{background:var(--paper);border:1px solid var(--line);border-radius:var(--r);padding:14px 16px}
.browse-card h2,.browse-card h3{font-size:18px;margin:0 0 6px}
.browse-card ul{list-style:none;margin:0;padding:0}
.browse-card a{display:block;padding:4px 0;color:var(--accent-d);font-weight:500;text-decoration:none;line-height:1.5}
.browse-card a:hover{text-decoration:underline}
.browse-more{margin:14px 0 0}
.browse-more a{color:var(--accent-d);font-weight:700}
#seo-copy .seo-links{columns:2 250px;column-gap:28px;padding-inline-start:20px;margin:0}
#seo-copy .seo-links li{break-inside:avoid;padding:2px 0}
.site-links{flex:1 0 100%;display:flex;flex-wrap:wrap;gap:0 18px;padding-bottom:10px;margin-bottom:4px;border-bottom:1px dashed var(--line)}
.site-links:empty{display:none}
.site-links a,.foot>a,.foot>span{padding:4px 0;text-decoration:none}
.site-links a:hover,.foot>a:hover{color:var(--accent-d);text-decoration:underline}
.lost{text-align:center;padding-top:44px}
.lost .btn{margin:14px 0 6px}
.doc.wide{max-width:var(--wrap)}

/* touch screens: the colour dots keep their look but take a 32px tap */
@media (pointer:coarse){
  .ways{gap:10px;padding:5px 0 7px}
  .way{position:relative;width:22px;height:22px}
  .way::after{content:"";position:absolute;inset:-5px;border-radius:50%}
}

/* ---------- space held before the maker is filled ----------
   The picker, the form, the contents and the preview are filled by app.js. Until then each empty box holds
   about the room its contents will take, so the steps under it do not jump when they arrive. <html> carries
   data-product (and data-kind for cards) from the first paint: the script in the page's head sets them from
   the page's preset or the tab the visitor left on, and app.js keeps them up to date.
   The numbers are what each product's boxes come to on a phone and on a desktop; a little off is fine. */
#filters:empty{display:none}
:root[data-product="student"] #filters:empty,:root[data-product="card"] #filters:empty{display:flex;min-height:40px}
:root[data-product="card"] #filters:empty{min-height:88px}
@media (max-width:436px){:root[data-product="student"] #filters:empty{min-height:88px}}
@media (max-width:520px){:root[data-product="card"] #filters:empty{min-height:136px}}
:root[data-product="cert"] #step-content,:root[data-product="card"] #step-content{display:none}
#themes:empty{min-height:245px}
:root[data-product="cert"] #themes:empty{min-height:198px}
:root[data-product="card"] #themes:empty{min-height:353px}
:root[data-product="card"][data-kind="wedding"] #themes:empty,:root[data-product="card"][data-kind="invite"] #themes:empty,:root[data-product="card"][data-kind="greet"] #themes:empty{min-height:396px}
#form:empty{min-height:380px}
:root[data-product="cert"] #form:empty{min-height:900px}
:root[data-product="planner"] #form:empty{min-height:800px}
:root[data-product="card"] #form:empty{min-height:290px}
:root[data-product="card"][data-kind="wedding"] #form:empty,:root[data-product="card"][data-kind="invite"] #form:empty{min-height:850px}
#content:empty{min-height:590px}
#pages:empty{min-height:460px}
:root[data-product="cert"] #pages:empty{min-height:230px}
:root[data-product="card"] #pages:empty{min-height:580px}
@media (min-width:980px){
  #themes:empty{min-height:450px}
  :root[data-product="cert"] #themes:empty{min-height:405px}
  :root[data-product="card"] #themes:empty{min-height:427px}
  :root[data-product="card"][data-kind="newborn"] #themes:empty{min-height:409px}
  :root[data-product="card"][data-kind="wedding"] #themes:empty,:root[data-product="card"][data-kind="invite"] #themes:empty,:root[data-product="card"][data-kind="greet"] #themes:empty{min-height:427px}
  #pages:empty{min-height:520px}
  :root[data-product="cert"] #pages:empty{min-height:380px}
}
