/* Cozy Coloring — cozy, cute, picture-book UI. Self-hosted fonts only (no third-party requests). */
@font-face { font-family: "Fredoka"; src: url("/static/fonts/fredoka.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/static/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Baloo Bhaijaan 2"; src: url("/static/fonts/baloo-bhaijaan-2-arabic.woff2") format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }

:root {
  --cream: #FFF8EE;
  --cream-2: #FCEFD9;
  --paper: #FFFFFF;
  --ink: #4A3428;
  --ink-soft: #7A6355;
  --line: #F0DFC6;
  --terracotta: #E07A5F;
  --terracotta-dk: #C25D42;
  --butter: #F7DCA4;
  --butter-dk: #E9A23B;
  --sage: #A9CF9B;
  --sage-dk: #5E9A55;
  --sky: #BFE3EC;
  --sky-dk: #4E9BBE;
  --pink: #F6C6D6;
  --pink-dk: #D2668E;
  --lilac: #DCCBEF;
  --lilac-dk: #8E66B8;
  --radius: 26px;
  --shadow: 0 3px 0 rgba(74, 52, 40, .08), 0 14px 28px -16px rgba(74, 52, 40, .35);
  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 17px/1.65 var(--font-body); font-weight: 500;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(224, 122, 95, .09) 1.6px, transparent 1.7px), radial-gradient(rgba(94, 154, 85, .08) 1.6px, transparent 1.7px);
  background-size: 34px 34px; background-position: 0 0, 17px 17px;
}
img { max-width: 100%; height: auto; display: block; }
.ui-img { mix-blend-mode: multiply; }          /* Codex art is drawn on white: blend the white away */
a { color: var(--terracotta-dk); text-underline-offset: 3px; text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -.005em; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: .3em 0 .35em; }
h2 { font-size: clamp(1.4rem, 3.2vw, 1.9rem); margin: 1.6em 0 .6em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.center { text-align: center; }
.center .ui-img { margin-inline: auto; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.lead { font-size: 1.14rem; color: var(--ink-soft); max-width: 62ch; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; background: var(--paper); padding: 8px 14px; border-radius: 12px; z-index: 99; }
:focus-visible { outline: 3px dashed var(--terracotta); outline-offset: 3px; border-radius: 8px; }

/* ---------- Brand ---------- */
.brand-link { text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand svg, .brand-mascot { width: 52px; height: 52px; object-fit: contain; flex: none; transition: transform .25s; }
.brand-mascot { mix-blend-mode: multiply; }
.brand-link:hover .brand-mascot, .brand-link:hover svg { transform: rotate(-8deg) scale(1.06); }
.wordmark { display: flex; flex-direction: column; line-height: .95; font-family: var(--font-display); }
.w-cozy { font-weight: 500; font-size: 1.02rem; color: var(--ink-soft); letter-spacing: .04em; }
.w-coloring { font-weight: 700; font-size: 1.55rem; letter-spacing: .01em; }
.w-coloring span { display: inline-block; text-shadow: 0 2px 0 rgba(74, 52, 40, .12); }
.w-coloring span:nth-child(odd) { transform: translateY(1px) rotate(-3deg); }
.w-coloring span:nth-child(even) { transform: translateY(-1px) rotate(3deg); }
.brand.small svg, .brand.small .brand-mascot { width: 40px; height: 40px; }
.brand.small .w-coloring { font-size: 1.2rem; }
.brand.small .w-cozy { font-size: .85rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255, 248, 238, .92); backdrop-filter: blur(8px); border-bottom: 3px dotted var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; }
.main-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill { color: var(--ink); text-decoration: none; font: 600 1rem var(--font-display); padding: 8px 16px; border-radius: 999px; border: 2px solid transparent; transition: transform .15s, background .15s; }
.pill:hover { transform: translateY(-2px) rotate(-1deg); }
.pill-1 { background: var(--butter); } .pill-2 { background: var(--sky); } .pill-3 { background: var(--pink); }
.nav-search { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.nav-search svg { width: 22px; height: 22px; }
@media (max-width: 720px) {
  .pill { font-size: .88rem; padding: 6px 11px; }
  .main-nav .nav-age { display: none; }
  .w-cozy { display: none; }
  .w-coloring { font-size: 1.25rem; }
  .brand svg, .brand-mascot { width: 42px; height: 42px; }
  .header-row, .main-nav { flex-wrap: nowrap; }
}
@media (max-width: 430px) { .wordmark { display: none; } .lang-menu summary span { display: none; } .lang-menu summary { padding: 0 11px; } }
@media (max-width: 560px) { .main-nav { gap: 6px; } .pill { padding: 6px 9px; font-size: .82rem; } .search input { min-width: 0; } }

/* ---------- Waves ---------- */
.wave { display: block; width: 100%; height: 34px; }
.wave-hero { position: absolute; left: 0; right: 0; bottom: -1px; fill: var(--cream); }
.wave-footer { fill: var(--cream-2); margin-top: 72px; transform: scaleY(-1); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
  font: 600 1.02rem var(--font-display); padding: 10px 20px; border-radius: 999px; text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn svg { width: 20px; height: 20px; }
.btn.big { font-size: 1.12rem; padding: 14px 24px; }
.btn.primary { background: var(--terracotta); color: #fff; }
.btn.ghost { box-shadow: none; border-color: transparent; background: transparent; }
.actions .btn:nth-child(2) { background: var(--sky); }
.actions .btn:nth-child(3) { background: var(--butter); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 28px 0 70px; overflow: hidden;
  background: radial-gradient(700px 360px at 85% 30%, #FFE7C2, transparent 70%), radial-gradient(500px 300px at 5% 90%, #E3F1DD, transparent 70%), var(--cream-2); }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; position: relative; z-index: 1; }
.kicker { display: inline-block; margin: 0; font: 600 1rem var(--font-display); color: var(--sage-dk); background: var(--paper); padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow); transform: rotate(-2deg); }
.squiggle { position: relative; white-space: nowrap; display: inline-block; max-width: 100%; color: var(--terracotta-dk); }
.squiggle::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.12em; height: .3em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M2 8 Q 12 2 22 8 T 42 8 T 62 8 T 82 8 T 102 8 T 118 8' fill='none' stroke='%23F2B33D' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x 0 0 / 60px 100%; }
.hero-illo { position: relative; }
.hero-illo img { width: 100%; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0)); }
.hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-art img { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 8px; }
.hero-art img:nth-child(1) { transform: rotate(-4deg); } .hero-art img:nth-child(2) { transform: translateY(-14px) rotate(2deg); } .hero-art img:nth-child(3) { transform: rotate(5deg); }
.deco { position: absolute; width: 64px; height: auto; z-index: 0; opacity: .9; animation: bob 6s ease-in-out infinite; }
.deco-1 { top: 18px; left: 3%; } .deco-2 { top: 54%; left: 44%; animation-delay: -2s; width: 46px; }
.deco-3 { top: 24px; right: 4%; width: 90px; animation-delay: -4s; } .deco-4 { bottom: 60px; left: 6%; width: 54px; animation-delay: -1s; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .deco { animation: none; } * { scroll-behavior: auto; } }
@media (max-width: 860px) { .hero-inner { grid-template-columns: minmax(0, 1fr); } .hero-art, .hero-illo { max-width: 520px; } .deco-2 { display: none; } }
.search { display: flex; gap: 8px; margin: 22px 0; max-width: 540px; padding: 6px; background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); border: 3px solid var(--ink); }
.search input { flex: 1; min-width: 0; font: 600 1.05rem var(--font-body); padding: 10px 16px; border: 0; background: transparent; color: var(--ink); }
.search input:focus { outline: none; }
.search .btn { box-shadow: none; border-width: 0; background: var(--terracotta); color: #fff; }

/* ---------- Shelves & grids ---------- */
.shelf { margin-top: 48px; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shelf-head h2 { display: flex; align-items: center; gap: 10px; margin-bottom: .55em; }
.h-icon { width: 52px; height: 52px; }
.see-all, .shelf-head > a { font: 600 1rem var(--font-display); white-space: nowrap; background: var(--paper); padding: 6px 14px; border-radius: 999px; text-decoration: none; box-shadow: var(--shadow); }
.grid, .cat-grid, .age-grid, .guide-list, .guide-links { list-style: none; padding: 0; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 22px; }
.card a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; text-decoration: none; color: var(--ink); background: var(--paper);
  border-radius: 22px; padding: 12px 12px 14px; box-shadow: var(--shadow); border: 3px solid var(--card-c, var(--butter)); transition: transform .18s; }
.card a::before { content: ""; position: absolute; top: -10px; left: 50%; width: 64px; height: 20px; transform: translateX(-50%) rotate(-3deg);
  background: var(--tape, rgba(247, 220, 164, .85)); border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.card:nth-child(4n+1) a { --card-c: var(--butter); --tape: rgba(246, 198, 214, .85); }
.card:nth-child(4n+2) a { --card-c: var(--sky); --tape: rgba(169, 207, 155, .85); }
.card:nth-child(4n+3) a { --card-c: var(--pink); --tape: rgba(191, 227, 236, .9); }
.card:nth-child(4n+4) a { --card-c: var(--sage); --tape: rgba(247, 220, 164, .85); }
.card:nth-child(odd) a:hover { transform: translateY(-5px) rotate(-1.2deg); }
.card:nth-child(even) a:hover { transform: translateY(-5px) rotate(1.2deg); }
.thumb { aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-title { font: 600 1.02rem/1.25 var(--font-display); }
.badge { align-self: flex-start; font: 600 .76rem var(--font-display); padding: 3px 10px; border-radius: 999px; }
.badge-easy { background: #E3F1DD; color: #3F7A37; } .badge-medium { background: #FDEBC8; color: #8A5A12; } .badge-detailed { background: #F9DCE6; color: #9A3A60; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.cat-grid.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.cat-tile a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; height: 100%; text-decoration: none; color: var(--ink);
  background: var(--paper); border-radius: 28px; padding: 14px 10px 16px; box-shadow: var(--shadow); transition: transform .18s; }
.cat-tile:nth-child(3n+1) a { background: #FFF4E0; } .cat-tile:nth-child(3n+2) a { background: #EEF7F1; } .cat-tile:nth-child(3n+3) a { background: #FDEFF4; }
.cat-tile a:hover { transform: translateY(-5px) scale(1.03) rotate(-1deg); }
.cat-tile .thumb { width: 100%; }
.sticker { display: grid; place-items: center; width: 100%; aspect-ratio: 1; }
.sticker img { width: 92%; height: auto; }
.cat-name { font: 600 1.08rem var(--font-display); }
.age-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.age-card { display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: 30px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); height: 100%; position: relative; transition: transform .18s; }
.age-card:hover { transform: translateY(-4px) rotate(-.6deg); }
.age-card b { font: 700 1.5rem var(--font-display); }
.age-card span { font: 600 1.05rem var(--font-display); }
.age-card small { color: var(--ink-soft); font-size: .95rem; }
.age-sticker { width: 96px; height: 96px; margin: -6px 0 4px -6px; }
.age-easy { background: #E6F3E1; } .age-medium { background: #FDF0D7; } .age-detailed { background: #F9E3EC; }

/* ---------- Page heads ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 20px 0 0; font-size: .9rem; color: var(--ink-soft); }
.crumbs li + li::before { content: "✿"; margin-right: 6px; color: var(--terracotta); }
.crumbs a { color: var(--ink-soft); }
.page-head { position: relative; }
.page-icon { float: right; width: 120px; height: 120px; margin: 0 0 8px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 26px; clear: both; }
.chip { font: 600 .95rem var(--font-display); border: 3px solid var(--line); background: #fff; color: var(--ink); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.chip.is-on { border-color: var(--ink); background: var(--butter); }
.card[hidden] { display: none; }

/* ---------- Detail page ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 16px; }
.detail-img { position: relative; display: block; background: #fff; border-radius: 28px; padding: 22px; box-shadow: var(--shadow); border: 3px solid var(--butter); transform: rotate(-1deg); transition: transform .2s; }
.detail-img::before, .detail-img::after { content: ""; position: absolute; top: -12px; width: 90px; height: 26px; background: rgba(246, 198, 214, .85); border-radius: 3px; }
.detail-img::before { left: 18px; transform: rotate(-8deg); } .detail-img::after { right: 18px; transform: rotate(7deg); background: rgba(191, 227, 236, .9); }
.detail-img:hover { transform: rotate(0) scale(1.01); }
.detail-info h1 { margin-top: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.facts div { background: #fff; border-radius: 18px; padding: 10px 14px; border: 2px dashed var(--line); }
.facts dt { font: 600 .78rem var(--font-display); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; font-weight: 800; }
.detail-more { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; }
.note { position: relative; border-radius: 28px; padding: 8px 24px 14px; box-shadow: var(--shadow); }
.note h2 { font-size: 1.3rem; margin: .7em 0 .25em; }
.note.fun { background: #E6F4F7; padding-left: 112px; } .note.try { background: #FDF0D7; padding-left: 92px; }
.note-pip { position: absolute; left: 10px; bottom: 8px; width: 92px; height: auto; }
.note-star { position: absolute; left: 16px; top: 18px; width: 58px; height: auto; }
.note.fun:not(:has(.note-pip)), .note.try:not(:has(.note-star)) { padding-left: 24px; }
.tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.tags a { color: var(--ink-soft); font-size: .92rem; background: #fff; padding: 2px 10px; border-radius: 999px; text-decoration: none; }
@media (max-width: 820px) { .detail, .detail-more { grid-template-columns: 1fr; } }

/* ---------- Ads (clearly separated from kid-facing controls) ---------- */
.ad { margin: 52px auto; padding: 10px 0; min-height: 300px; border-top: 2px dotted var(--line); border-bottom: 2px dotted var(--line); }
.ad-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); text-align: center; margin-bottom: 6px; }

/* ---------- FAQ / prose / guides ---------- */
.faq details { background: #fff; border-radius: 20px; padding: 14px 20px; margin: 12px 0; box-shadow: var(--shadow); }
.faq summary { font: 600 1.05rem var(--font-display); cursor: pointer; list-style: none; }
.faq summary::before { content: "🖍️"; margin-right: 8px; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: .6em 0 .2em; }
.prose { font-size: 1.06rem; }
.prose li { margin: .3em 0; }
.answer { font-size: 1.14rem; }
.guide-list { display: grid; gap: 14px; }
.guide-list a { display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 24px; padding: 18px 22px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border-left: 8px solid var(--sage); }
.guide-list li:nth-child(even) a { border-left-color: var(--pink); }
.guide-list b { font: 600 1.2rem var(--font-display); }
.guide-list span { color: var(--ink-soft); }
.guide-links { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.guide-links a { display: inline-block; background: var(--cream); padding: 6px 14px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.parents-note { position: relative; background: #fff; border-radius: 34px; padding: 10px 30px 28px; box-shadow: var(--shadow); overflow: hidden; }
.parents-illo { float: right; width: 260px; margin: 10px 0 0 20px; }
@media (max-width: 640px) { .parents-illo { float: none; width: 200px; margin: 10px auto 0; } .page-icon { width: 84px; height: 84px; } }
.search-head { display: flex; align-items: center; gap: 12px; }
.search-pip { width: 120px; height: auto; }
.pip-404 { width: 220px; height: auto; margin-top: 30px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; }
.footer-inner { background: var(--cream-2); padding: 18px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 8px; }
.footer-grid nav b { font: 600 1.05rem var(--font-display); }
.footer-grid nav a { color: var(--ink); text-decoration: none; }
.footer-grid nav a:hover { text-decoration: underline; }
.footer-brand p { color: var(--ink-soft); max-width: 40ch; }
.fine { font-size: .85rem; color: var(--ink-soft); margin-top: 24px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Print: only the line art ---------- */
.print-sheet, .print-out { display: none; }
@media print {
  @page { size: letter portrait; margin: 0.4in; }
  body { background: #fff; }
  body > *:not(.print-sheet):not(.print-out):not(main), main > *:not(.print-sheet):not(.print-out) { display: none !important; }
  .print-sheet, .print-out { display: block !important; text-align: center; }
  .print-sheet img, .print-out { width: 100%; max-height: 9.6in; object-fit: contain; margin: 0 auto; }
  .print-sheet p { font: 10px sans-serif; color: #888; }
}

/* ---------- Kid coloring studio ---------- */
body.kid { background-color: #FBEFDD; overscroll-behavior: none; }
.kid-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; }
.studio { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 0 14px 14px; height: calc(100dvh - 68px); }
.stage { position: relative; display: grid; place-items: center; min-height: 0; background: #F3E2C9; border-radius: 30px; overflow: hidden; touch-action: none;
  background-image: radial-gradient(rgba(255, 255, 255, .5) 2px, transparent 2.2px); background-size: 26px 26px; }
.stage canvas { position: absolute; background: transparent; border-radius: 10px; }
.stage .layer-color { background: #fff; box-shadow: var(--shadow); cursor: crosshair; }
.stage .layer-line { pointer-events: none; }
.stage .loading { font: 600 1.1rem var(--font-display); color: var(--ink-soft); }
.toolbar { display: flex; flex-direction: column; gap: 12px; width: 300px; overflow-y: auto; padding: 4px; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; min-height: 66px; border-radius: 20px; border: 3px solid transparent; background: #fff;
  color: var(--ink); font: 600 .85rem var(--font-display); cursor: pointer; box-shadow: 0 3px 0 rgba(74, 52, 40, .12); transition: transform .1s; }
.tool:active { transform: translateY(2px); }
.tool svg { width: 28px; height: 28px; }
.tool.is-on { border-color: var(--ink); background: var(--butter); }
.sizes { grid-column: span 3; display: flex; justify-content: space-around; background: #fff; border-radius: 20px; padding: 6px; box-shadow: 0 3px 0 rgba(74, 52, 40, .12); }
.size { width: 54px; height: 44px; border-radius: 14px; border: 3px solid transparent; background: none; display: grid; place-items: center; cursor: pointer; }
.size i { display: block; border-radius: 50%; background: var(--ink); }
.size.is-on { border-color: var(--ink); background: var(--cream); }
/* Crayon swatches (SVG drawn in color.js) */
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px 6px; background: #fff; border-radius: 22px; padding: 10px 8px 6px; box-shadow: 0 3px 0 rgba(74, 52, 40, .12); }
.swatch { background: none; border: 0; padding: 0; cursor: pointer; height: 74px; display: grid; place-items: end center; transition: transform .15s; }
.swatch svg { width: 30px; height: 70px; filter: drop-shadow(0 2px 0 rgba(74, 52, 40, .18)); }
.swatch:hover { transform: translateY(-4px); }
.swatch[aria-checked="true"] { transform: translateY(-12px); }
.swatch[aria-checked="true"] svg { filter: drop-shadow(0 0 0 #000) drop-shadow(0 4px 6px rgba(74, 52, 40, .35)); }
.studio-pip { position: fixed; right: 18px; bottom: 14px; width: 110px; height: auto; pointer-events: none; animation: bob 5s ease-in-out infinite; }
.confirm { border: none; border-radius: 28px; padding: 26px; box-shadow: var(--shadow); font: 600 1.25rem var(--font-display); background: #fff; color: var(--ink); }
.confirm form { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.confirm::backdrop { background: rgba(74, 52, 40, .35); }
@media (max-width: 860px), (orientation: portrait) {
  .studio { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .toolbar { width: auto; }
  .tools { grid-template-columns: repeat(8, 1fr); }
  .sizes { grid-column: span 8; }
  .palette { grid-template-columns: repeat(12, 1fr); }
  .swatch { height: 56px; } .swatch svg { width: 22px; height: 52px; }
  .tool span { display: none; }
  .tool { min-height: 52px; }
  .studio-pip { display: none; }
}
@media (max-width: 520px) { .tools { grid-template-columns: repeat(4, 1fr); } .sizes { grid-column: span 4; } .palette { grid-template-columns: repeat(8, 1fr); } }

/* ---------- Languages ---------- */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px; border-radius: 999px; background: var(--paper); box-shadow: var(--shadow); cursor: pointer; font: 600 .9rem var(--font-display); color: var(--ink); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 20px; height: 20px; }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: 52px; z-index: 20; list-style: none; margin: 0; padding: 8px; min-width: 190px; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); }
.lang-menu a { display: block; padding: 8px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 700; }
.lang-menu a:hover, .lang-menu a[aria-current] { background: var(--cream); }
.footer-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 22px; }
.footer-langs svg { width: 18px; height: 18px; color: var(--ink-soft); }
.footer-langs a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer-langs a[aria-current] { text-decoration: underline; }
.translation-note { border-inline-start: 4px solid var(--butter); padding-inline-start: 12px; }
.lang-404 { list-style: none; padding: 0; display: grid; gap: 8px; margin-top: 28px; }
:lang(fr) .squiggle, :lang(pt-BR) .squiggle { white-space: normal; }

/* Right-to-left (Arabic) */
[dir="rtl"] { --font-display: "Baloo Bhaijaan 2", "Fredoka", system-ui, sans-serif; --font-body: "Baloo Bhaijaan 2", "Nunito", system-ui, sans-serif; }
[dir="rtl"] body { line-height: 1.75; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; line-height: 1.35; }
[dir="rtl"] .skip:focus { left: auto; right: 8px; }
[dir="rtl"] .crumbs li + li::before { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .page-icon { float: left; margin: 0 16px 8px 0; }
[dir="rtl"] .note.fun { padding-left: 24px; padding-right: 112px; }
[dir="rtl"] .note.try { padding-left: 24px; padding-right: 92px; }
[dir="rtl"] .note-pip { left: auto; right: 10px; }
[dir="rtl"] .note-star { left: auto; right: 16px; }
[dir="rtl"] .note.fun:not(:has(.note-pip)), [dir="rtl"] .note.try:not(:has(.note-star)) { padding-right: 24px; }
[dir="rtl"] .faq summary::before { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .guide-list a { border-left: 0; border-right: 8px solid var(--sage); }
[dir="rtl"] .guide-list li:nth-child(even) a { border-right-color: var(--pink); }
[dir="rtl"] .studio-pip { right: auto; left: 18px; }
[dir="rtl"] .studio .stage, [dir="rtl"] .brand { direction: ltr; }
[dir="rtl"] .facts dt { letter-spacing: 0; text-transform: none; }
