/* Raff theme layer — loaded last. Wine buttons + logo (both modes) and the day palette.
   Day rules use :where(html[data-theme="light"]) so they keep each base selector's own weight. */
:root { --wine: #8c1c3c; --wine-hi: #b7385a; --wine-lo: #5f0b24; --wine-deep: #2b0410; }
html.theme-anim body, html.theme-anim body * { transition: background-color .5s, color .5s, border-color .5s, box-shadow .5s !important; }

/* ---------- logo: the calligraphic «رفّ» mark ---------- */
.brand { gap: 8px; }
.brand-logo { display: block; width: 56px; height: 45px; flex: none;
  background: linear-gradient(160deg, #ffffff 20%, #f1d3dc 70%, #d98aa2);
  -webkit-mask: url(../img/logo-mark.png) center / contain no-repeat; mask: url(../img/logo-mark.png) center / contain no-repeat;
  filter: drop-shadow(0 3px 0 rgba(140, 28, 60, .55)) drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); transition: transform .5s var(--spring); }
.brand:hover .brand-logo { transform: translateY(-2px) rotate(-3deg); }
.brand-sub { font-size: .95rem; color: #8b8b95; }
.foot-logo { display: block; width: 92px; height: 74px; margin: 0 auto 6px; background: #f1d3dc; -webkit-mask: url(../img/logo-mark.png) center / contain no-repeat; mask: url(../img/logo-mark.png) center / contain no-repeat; }
.b3-logo { display: block; width: 2.6em; height: 2.1em; background: var(--ink); -webkit-mask: url(../img/logo-mark.png) center / contain no-repeat; mask: url(../img/logo-mark.png) center / contain no-repeat; }

/* ---------- wine buttons (both modes) ---------- */
.btn-gold { --depth: var(--wine-deep); color: #fff; background: linear-gradient(180deg, #c64a6c 0%, #9a2245 45%, #6a0e2a 100%); text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.btn-gold:hover { filter: brightness(1.08) saturate(1.05); }
.btn-ghost:hover { color: #f1a5bb; }
.lang-toggle button[aria-pressed="true"], .icon-btn[aria-pressed="true"] { color: #fff; background: linear-gradient(180deg, #c64a6c, #9a2245 60%, #6a0e2a); box-shadow: 0 3px 0 var(--wine-deep), 0 6px 12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.icon-btn, .nav-btn { color: #f1a5bb; }
.plan-badge { color: #fff; background: linear-gradient(180deg, #c64a6c, #9a2245 60%, #6a0e2a); box-shadow: 0 3px 0 var(--wine-deep), 0 8px 14px rgba(0, 0, 0, .3); }
.plan li::before { background: radial-gradient(circle at 35% 30%, #ffd5e0, #b7385a 45%, #5f0b24); }
.plan.featured { border-color: rgba(183, 56, 90, .55); box-shadow: 0 1px 0 rgba(255, 200, 215, .2) inset, 0 40px 80px rgba(0, 0, 0, .5), 0 0 60px rgba(183, 56, 90, .18); }
.account-chip i { color: #fff; background: linear-gradient(180deg, #c64a6c, #6a0e2a); }
.seal-btn { color: #fff !important; background: linear-gradient(180deg, #c64a6c, #9a2245 60%, #6a0e2a) !important; box-shadow: 0 4px 0 var(--wine-deep), 0 10px 18px rgba(0, 0, 0, .3) !important; }
.scrub input::-webkit-slider-thumb { background: linear-gradient(180deg, #e27393, #8c1c3c); box-shadow: 0 3px 0 var(--wine-deep), 0 6px 10px rgba(0, 0, 0, .4); }
.scrub input { background: linear-gradient(to var(--fill-dir, right), #b7385a var(--fill, 0%), #1a1a20 var(--fill, 0%)); }
.field-3d:focus { border-color: rgba(183, 56, 90, .6); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .5), 0 0 0 4px rgba(183, 56, 90, .15); }
.theme-btn { width: 40px; height: 40px; }
.theme-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-moon { display: none; }
html[data-theme="light"] .theme-btn .i-sun { display: none; }
html[data-theme="light"] .theme-btn .i-moon { display: block; }

/* =========================================================
   DAY MODE
   ========================================================= */
html[data-theme="light"] {
  --night: #f6f1ec; --night-2: #ffffff; --night-3: #efe8e2;
  --text: #1d1418; --text-dim: #6f6468; --line: rgba(90, 15, 35, .14);
  --gold: #8c1c3c; --gold-hi: #7a1430; --gold-lo: #5f0b24;
  color-scheme: light;
}
:where(html[data-theme="light"]) body { background: #f6f1ec; color: #1d1418; }
:where(html[data-theme="light"]) .grain::after { opacity: .025; }
:where(html[data-theme="light"]) ::selection { background: rgba(183, 56, 90, .2); }

/* nav + controls */
:where(html[data-theme="light"]) .nav { background: rgba(255, 255, 255, .72); border-color: rgba(60, 20, 30, .08); box-shadow: 0 1px 0 #fff inset, 0 -2px 0 rgba(60, 20, 30, .05) inset, 0 18px 40px rgba(60, 20, 30, .12); }
:where(html[data-theme="light"]) .brand-logo { background: linear-gradient(160deg, #a8264a, #6a0e2a); filter: drop-shadow(0 2px 0 rgba(106, 14, 42, .25)) drop-shadow(0 6px 10px rgba(106, 14, 42, .2)); }
:where(html[data-theme="light"]) .brand-sub { color: #8a7f83; }
:where(html[data-theme="light"]) .nav-links a:not(.btn) { color: #6f6468; }
:where(html[data-theme="light"]) .nav-links a:not(.btn):hover { color: var(--wine); }
:where(html[data-theme="light"]) .lang-toggle { background: linear-gradient(180deg, #e9e1dc, #f6f1ee); box-shadow: inset 0 2px 5px rgba(60, 20, 30, .15), 0 1px 0 #fff; }
:where(html[data-theme="light"]) .lang-toggle button { color: #6f6468; }
:where(html[data-theme="light"]) .btn { box-shadow: 0 var(--lift) 0 var(--depth), 0 calc(var(--lift) + 10px) 22px rgba(60, 20, 30, .18), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .12); }
:where(html[data-theme="light"]) .btn-ghost { --depth: #d6cbc6; color: #2a1a1f; background: linear-gradient(180deg, #ffffff, #f2ece8); border-color: rgba(60, 20, 30, .08); }
:where(html[data-theme="light"]) .btn-ghost:hover { color: var(--wine); }
:where(html[data-theme="light"]) .icon-btn, :where(html[data-theme="light"]) .nav-btn { color: var(--wine); background: linear-gradient(180deg, #ffffff, #efe8e3); border-color: rgba(60, 20, 30, .08); box-shadow: 0 4px 0 #d6cbc6, 0 10px 18px rgba(60, 20, 30, .12), inset 0 1px 0 #fff; }
:where(html[data-theme="light"]) .icon-btn[aria-pressed="true"] { color: #fff; }
:where(html[data-theme="light"]) .caps { color: var(--wine); }
:where(html[data-theme="light"]) .modal-backdrop { background: rgba(40, 15, 22, .45); }
:where(html[data-theme="light"]) .modal-card { background: radial-gradient(120% 80% at 50% 0%, #ffffff, #f6f1ec 70%); border-color: rgba(60, 20, 30, .08); box-shadow: 0 50px 120px rgba(60, 20, 30, .25); }
:where(html[data-theme="light"]) .plan { background: linear-gradient(160deg, #ffffff, #faf6f3 60%, #f3ede9); border-color: rgba(60, 20, 30, .07); box-shadow: 0 1px 0 #fff inset, 0 -3px 0 rgba(60, 20, 30, .05) inset, 0 30px 60px rgba(60, 20, 30, .12); }
:where(html[data-theme="light"]) .plan.featured { background: linear-gradient(160deg, #fff1f4, #ffffff 60%); }
:where(html[data-theme="light"]) .plan-name { color: var(--wine); }
:where(html[data-theme="light"]) .plan-price b { color: #1d1418; text-shadow: 0 1px 0 #ead2d8, 0 2px 0 #dbb7c1, 0 6px 12px rgba(60, 20, 30, .15); }
:where(html[data-theme="light"]) .field-3d { color: #1d1418; background: #ffffff; border-color: rgba(60, 20, 30, .12); box-shadow: inset 0 2px 5px rgba(60, 20, 30, .08); }
:where(html[data-theme="light"]) .account-chip { color: #1d1418; background: linear-gradient(180deg, #ffffff, #f0e9e4); box-shadow: 0 3px 0 #d6cbc6, inset 0 1px 0 #fff; }
:where(html[data-theme="light"]) .toast { background: #ffffff; color: var(--wine); box-shadow: 0 5px 0 #d6cbc6, 0 16px 30px rgba(60, 20, 30, .18); }
:where(html[data-theme="light"]) .scrub input { background: linear-gradient(to var(--fill-dir, right), #b7385a var(--fill, 0%), #e2d8d3 var(--fill, 0%)); box-shadow: inset 0 2px 4px rgba(60, 20, 30, .15); }

/* landing */
:where(html[data-theme="light"]) .hero, :where(html[data-theme="light"]) section { background: transparent; }
:where(html[data-theme="light"]) .hero { background: radial-gradient(90% 70% at 50% 60%, #fffaf7, #f6f1ec 70%); }
:where(html[data-theme="light"]) .hero-glow { opacity: .35; }
:where(html[data-theme="light"]) .dust { opacity: 0; }
:where(html[data-theme="light"]) .hero-title { background: linear-gradient(180deg, #2a1a1f 30%, #8c1c3c); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 0 #e6d6da) drop-shadow(0 4px 0 #d8c3c9) drop-shadow(0 18px 26px rgba(106, 14, 42, .15)); }
:where(html[data-theme="light"]) .hero-sub { color: #5d5357; text-shadow: 0 2px 12px #f6f1ec; }
:where(html[data-theme="light"]) .chip-tag { color: #3a2a2f; background: rgba(255, 255, 255, .7); border-color: rgba(60, 20, 30, .1); }
:where(html[data-theme="light"]) .ring-cap { color: #1d1418; background: rgba(255, 255, 255, .8); border-color: rgba(60, 20, 30, .1); }
:where(html[data-theme="light"]) .ring-cap span, :where(html[data-theme="light"]) .hint { color: #8a7f83; }
:where(html[data-theme="light"]) .sec-title { color: #1d1418; }
:where(html[data-theme="light"]) .stats div { background: #ffffff; border-color: rgba(60, 20, 30, .08); box-shadow: 0 4px 0 #e2d8d3; }
:where(html[data-theme="light"]) .stats span { color: #8a7f83; }
:where(html[data-theme="light"]) .link-btn { color: #1d1418; border-color: rgba(60, 20, 30, .3); }
:where(html[data-theme="light"]) .focus-bg { background: radial-gradient(60% 70% at 32% 50%, color-mix(in srgb, var(--c) 22%, #f6f1ec), #f6f1ec 75%); }
:where(html[data-theme="light"]) .focus-bg::after { background-image: linear-gradient(rgba(60, 20, 30, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(60, 20, 30, .06) 1px, transparent 1px); }
:where(html[data-theme="light"]) .fi-in { background: rgba(255, 255, 255, .8); border-color: rgba(60, 20, 30, .08); box-shadow: 0 1px 0 #fff inset, 0 40px 80px rgba(60, 20, 30, .15); }
:where(html[data-theme="light"]) .fi-in h2 { color: #1d1418; }
:where(html[data-theme="light"]) .fi-in p { color: #5d5357; }
:where(html[data-theme="light"]) .fi-in .vol { color: #8a7f83; }
:where(html[data-theme="light"]) .sph-core { opacity: .45; }
:where(html[data-theme="light"]) .sc { background: #ffffff; color: #1d1418; border-color: rgba(60, 20, 30, .08); }
:where(html[data-theme="light"]) .sc-t h5 { color: #4a3f43; }
:where(html[data-theme="light"]) .sc-t span { filter: none; }
:where(html[data-theme="light"]) .fly-in { background: radial-gradient(70% 60% at 50% 50%, #ffffff, #efe8e2); }
:where(html[data-theme="light"]) .fly-step { text-shadow: 0 2px 18px #f6f1ec, 0 0 40px #fff; }
:where(html[data-theme="light"]) .fly-step h3 { color: #1d1418; }
:where(html[data-theme="light"]) .fly-step p { color: #5d5357; }
:where(html[data-theme="light"]) .fly-n { color: #fff; background: var(--wine); }
:where(html[data-theme="light"]) .fly-bar { background: rgba(60, 20, 30, .1); }
:where(html[data-theme="light"]) .fl-pg { box-shadow: 0 30px 60px rgba(60, 20, 30, .18); }
:where(html[data-theme="light"]) .faq details { background: #ffffff; border-color: rgba(60, 20, 30, .07); box-shadow: 0 4px 0 #e2d8d3, inset 0 1px 0 #fff; }
:where(html[data-theme="light"]) .faq summary { color: #1d1418; }
:where(html[data-theme="light"]) .foot { border-color: rgba(60, 20, 30, .08); }
:where(html[data-theme="light"]) .foot-logo { background: var(--wine); }

/* reader */
:where(html[data-theme="light"]) body.reader, :where(html[data-theme="light"]) .loading { background: #efe8e2; }
:where(html[data-theme="light"]) .stage-bg { background: radial-gradient(60% 55% at 50% 48%, #ffffff, transparent 70%), linear-gradient(#f6f1ec, #e8e0da); }
:where(html[data-theme="light"]) .drawer { background: #ffffff; }
:where(html[data-theme="light"]) .d-ch > button:hover { background: #f6f1ec; box-shadow: 0 3px 0 #e2d8d3; }
:where(html[data-theme="light"]) .hint { background: #ffffff; color: #6f6468; box-shadow: 0 3px 0 #e2d8d3; }
:where(html[data-theme="light"]) .scrim { background: rgba(40, 15, 22, .3); }
:where(html[data-theme="light"]) .cover-3d { background: #f6f1ec; }
.load-logo { width: 120px; height: 97px; animation: logoPulse 1.6s ease-in-out infinite; }
@keyframes logoPulse { 50% { opacity: .55; transform: scale(.96); } }

/* ---------- sign-in form + account page ---------- */
.login { display: grid; gap: 12px; }
.auth-tabs { width: 100%; margin-bottom: 4px; }
.auth-tabs button { flex: 1; padding: 9px 10px; font-size: .9rem; font-family: var(--f-ui); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .85rem; }
.auth-links .link-btn { font-size: .85rem; color: var(--text-dim); border-color: transparent; }
.auth-links .link-btn:hover { color: var(--text); }
.login-msg { min-height: 1.5em; margin: 0; font-size: .9rem; color: #f1a5bb; }
:where(html[data-theme="light"]) .login-msg { color: var(--wine); }
.link-btn { background: none; border: 0; padding: 4px 2px; color: inherit; font: inherit; cursor: pointer; border-bottom: 1px solid currentColor; }
.acct-page { min-height: 100vh; }
.acct { min-height: 100vh; display: grid; place-items: center; padding: 110px 16px 50px; }
.acct-card { width: min(480px, 100%); padding: clamp(22px, 5vw, 38px); border-radius: 26px; background: linear-gradient(160deg, #17171c, #0c0c10); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 40px 90px rgba(0, 0, 0, .55); display: grid; gap: 18px; }
:where(html[data-theme="light"]) .acct-card { background: #ffffff; border-color: rgba(60, 20, 30, .08); box-shadow: 0 40px 90px rgba(60, 20, 30, .14); }
.acct-loading { display: grid; place-items: center; min-height: 200px; }
.acct-head { display: flex; gap: 16px; align-items: center; }
.acct-head h2 { margin: .1em 0 0; font-family: var(--f-display); font-size: 1.7rem; line-height: 1.2; }
.acct-head p { margin: 0; color: var(--text-dim); font-size: .9rem; text-align: start; }
.acct-av { width: 58px; height: 58px; flex: none; border-radius: 18px; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 1.5rem; color: #fff; background: linear-gradient(180deg, #c64a6c, #6a0e2a); box-shadow: 0 4px 0 var(--wine-deep); }
.acct-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
:where(html[data-theme="light"]) .acct-row, :where(html[data-theme="light"]) .acct-books a { background: #f8f4f1; border-color: rgba(60, 20, 30, .07); }
.acct-row span, .acct-books > span { color: var(--text-dim); font-size: .88rem; }
.acct-row b { flex: 1; }
.acct-books { display: grid; gap: 8px; }
.acct-books a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); font-size: .93rem; }
.acct-books a i { width: 10px; height: 26px; border-radius: 3px; background: var(--c); flex: none; }
.acct-books p { margin: 0; color: var(--text-dim); }
.pw-form { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.pw-form h3 { margin: 0; font-family: var(--f-display); font-size: 1.1rem; }
.acct-out { justify-self: start; }
a.account-chip { text-decoration: none; }

/* ---------- reader guard ---------- */
.wm-tile { position: absolute; inset: 0; pointer-events: none; user-select: none; z-index: 3; background-repeat: repeat; mix-blend-mode: multiply; }
.reader .stage { -webkit-user-select: none; user-select: none; }
.reader .stage .prompt code { -webkit-user-select: text; user-select: text; }
.shield-msg { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 20px;
  color: #fff; font-family: var(--f-ui); background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transition: opacity .15s, visibility .15s; }
.shield-msg .foot-logo { margin: 0; }
html.shielded .shield-msg { opacity: 1; visibility: visible; }
html.shielded .reader .stage, html.shielded .stage { filter: blur(22px) saturate(.6); transition: filter .1s; }
.auth-tabs { display: flex; padding: 4px; gap: 2px; border-radius: 12px; background: linear-gradient(180deg, #050507, #111115); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .07); }
.auth-tabs button { border-radius: 9px; color: var(--text-dim); font-weight: 700; transition: .3s var(--spring); }
.auth-tabs button[aria-pressed="true"] { color: #fff; background: linear-gradient(180deg, #c64a6c, #9a2245 60%, #6a0e2a); box-shadow: 0 3px 0 var(--wine-deep), 0 6px 12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .35); transform: translateY(-2px); }
:where(html[data-theme="light"]) .auth-tabs { background: linear-gradient(180deg, #e9e1dc, #f6f1ee); box-shadow: inset 0 2px 5px rgba(60, 20, 30, .15), 0 1px 0 #fff; }
.plans { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- Ask Raff assistant ---------- */
.ask { position: fixed; z-index: 70; inset-inline-end: 18px; bottom: 18px; font-family: var(--f-ui); }
.reader .ask { bottom: 96px; }
.ask-fab { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px; border-radius: 99px; color: #fff; font-weight: 700; font-size: .95rem;
  background: linear-gradient(180deg, #c64a6c, #9a2245 60%, #6a0e2a); box-shadow: 0 5px 0 var(--wine-deep), 0 16px 30px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .2s var(--spring); }
.ask-fab:hover { transform: translateY(-2px); }
.ask-dot { width: 26px; height: 21px; background: #fff; -webkit-mask: url(../img/logo-mark.png) center / contain no-repeat; mask: url(../img/logo-mark.png) center / contain no-repeat; }
.ask.on .ask-fab { display: none; }
.ask-panel { position: absolute; bottom: 0; inset-inline-end: 0; width: min(420px, calc(100vw - 24px)); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column;
  border-radius: 24px; overflow: hidden; background: linear-gradient(180deg, #16161b, #0b0b0e); border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 40px 90px rgba(0, 0, 0, .6); animation: askIn .35s var(--spring); }
.ask-panel[hidden] { display: none; }
@keyframes askIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.ask-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.ask-h > div { flex: 1; min-width: 0; }
.ask-h h4 { margin: 0; font-family: var(--f-display); font-size: 1.05rem; color: var(--text); }
.ask-h p { margin: 0; font-size: .76rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-av { width: 40px; height: 40px; flex: none; border-radius: 13px; background: linear-gradient(180deg, #c64a6c, #6a0e2a); position: relative; }
.ask-av::after { content: ""; position: absolute; inset: 7px; background: #fff; -webkit-mask: url(../img/logo-mark.png) center / contain no-repeat; mask: url(../img/logo-mark.png) center / contain no-repeat; }
.ask-h .icon-btn { width: 34px; height: 34px; border-radius: 11px; }
.ask-h .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ask-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.am { display: flex; }
.am.me { justify-content: flex-start; }
.am.bot, .am.sys { justify-content: flex-end; }
html[dir="ltr"] .am.me { justify-content: flex-end; }
html[dir="ltr"] .am.bot, html[dir="ltr"] .am.sys { justify-content: flex-start; }
.bub { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: .92rem; line-height: 1.65; color: var(--text); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); overflow-wrap: anywhere; }
.am.me .bub { color: #fff; background: linear-gradient(180deg, #a8264a, #7a1430); border-color: transparent; }
.am.sys .bub { background: rgba(183, 56, 90, .12); border-color: rgba(183, 56, 90, .3); display: grid; gap: 10px; justify-items: start; }
.bub p { margin: 0 0 .5em; } .bub p:last-child { margin-bottom: 0; }
.bub ul { margin: .3em 0 .6em; padding-inline-start: 1.2em; } .bub li { margin: .15em 0; }
.bub h5 { margin: .5em 0 .25em; font-size: .95rem; }
.bub a { color: #f1a5bb; text-decoration: underline; }
.srcs { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.srcs b { font-size: .78rem; color: var(--text-dim); }
.srcs a { display: flex; gap: 8px; align-items: baseline; font-size: .8rem; text-decoration: none; color: var(--text); direction: ltr; text-align: start; }
.srcs a i { flex: none; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: .7rem; color: #fff; background: var(--wine); }
.srcs a:hover { color: #f1a5bb; }
.typing { display: flex; align-items: center; gap: 5px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #f1a5bb; animation: dot 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
.typing em { font-style: normal; font-size: .8rem; color: var(--text-dim); margin-inline-start: 6px; }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .5; } }
.ask-f { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, .07); }
.ask-f textarea { flex: 1; resize: none; max-height: 140px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1); background: #08080b; color: var(--text); font: inherit; font-size: .93rem; outline: none; }
.ask-f textarea:focus { border-color: rgba(183, 56, 90, .6); }
.ask-foot { display: flex; justify-content: space-between; gap: 10px; padding: 0 14px 10px; font-size: .7rem; color: var(--text-dim); }
:where(html[data-theme="light"]) .ask-panel { background: #ffffff; border-color: rgba(60, 20, 30, .1); box-shadow: 0 40px 90px rgba(60, 20, 30, .2); }
:where(html[data-theme="light"]) .ask-h, :where(html[data-theme="light"]) .ask-f { border-color: rgba(60, 20, 30, .08); }
:where(html[data-theme="light"]) .bub { background: #f6f1ec; border-color: rgba(60, 20, 30, .06); }
:where(html[data-theme="light"]) .ask-f textarea { background: #faf7f5; border-color: rgba(60, 20, 30, .12); }
:where(html[data-theme="light"]) .bub a, :where(html[data-theme="light"]) .srcs a:hover { color: var(--wine); }
:where(html[data-theme="light"]) .srcs { border-color: rgba(60, 20, 30, .1); }
@media (max-width: 560px) {
  .ask { inset-inline-end: 12px; bottom: 12px; }
  .reader .ask { bottom: 88px; }
  .ask-fab b { display: none; }
  .ask-fab { padding: 12px; }
  .ask-panel { position: fixed; inset: auto 8px 8px 8px; width: auto; height: calc(100vh - 90px); }
}

/* ---------- Pro voice call ---------- */
.call { position: fixed; inset: 0; z-index: 210; display: none; place-items: center; padding: 16px; }
.call.on { display: grid; }
.call-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(8px); }
.call-card { position: relative; width: min(380px, 100%); padding: 34px 26px 28px; border-radius: 28px; text-align: center; display: grid; justify-items: center; gap: 10px;
  background: radial-gradient(120% 80% at 50% 0%, #2a0d18, #0b0b0e 70%); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 50px 120px rgba(0, 0, 0, .7); }
.call-x { position: absolute; top: 14px; inset-inline-end: 14px; width: 36px; height: 36px; }
.call-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.call-card h3 { margin: 6px 0 0; font-family: var(--f-display); font-size: 1.3rem; color: var(--text); }
.cl-msg { margin: 0; color: var(--text-dim); font-size: .92rem; min-height: 2.8em; }
.cl-left { margin: 0; font-family: var(--f-mono); font-size: .8rem; color: #f1a5bb; direction: ltr; }
.cl-go { min-width: 170px; }
.call[data-state="live"] .cl-go, .call[data-state="connecting"] .cl-go { background: linear-gradient(180deg, #3a3a42, #1b1b21); }
.cl-orb { position: relative; width: 130px; height: 130px; display: grid; place-items: center; }
.cl-orb i { width: 92px; height: 92px; border-radius: 50%; background: linear-gradient(160deg, #c64a6c, #6a0e2a); box-shadow: 0 0 40px rgba(183, 56, 90, .5); position: relative; }
.cl-orb i::after { content: ""; position: absolute; inset: 20px; background: #fff; -webkit-mask: url(../img/logo-mark.png) center / contain no-repeat; mask: url(../img/logo-mark.png) center / contain no-repeat; }
.cl-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(198, 74, 108, .5); opacity: 0; }
.call[data-state="live"] .cl-orb span { animation: ring 1.8s infinite; }
.call[data-state="live"] .cl-orb span + span { animation-delay: .9s; }
.call[data-state="connecting"] .cl-orb i { animation: logoPulse 1.2s infinite; }
@keyframes ring { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
:where(html[data-theme="light"]) .call-card { background: radial-gradient(120% 80% at 50% 0%, #fde8ee, #ffffff 70%); border-color: rgba(60, 20, 30, .08); }

/* ---------- prompt library ---------- */
.pl { max-width: 1180px; margin: 0 auto; padding: 120px 16px 80px; }
.pl-head { text-align: center; max-width: 720px; margin: 0 auto 26px; display: grid; gap: 10px; justify-items: center; }
.pl-head h1 { margin: 0; font-family: var(--f-display); font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.15; color: var(--text); }
.pl-head p { margin: 0; color: var(--text-dim); }
.pl-search { max-width: 520px; margin-top: 8px; }
.pl-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.pl-tabs button { padding: 8px 14px; border-radius: 12px; font-size: .88rem; color: var(--text-dim); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); display: inline-flex; gap: 8px; align-items: center; }
.pl-tabs button[style]::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.pl-tabs button.on { color: #fff; background: linear-gradient(180deg, #c64a6c, #6a0e2a); border-color: transparent; }
.pl-note { display: grid; gap: 8px; justify-items: center; margin-bottom: 20px; color: var(--text-dim); font-size: .85rem; }
.pl-lock { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 14px; background: rgba(183, 56, 90, .1); border: 1px solid rgba(183, 56, 90, .25); }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pl-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 20px; background: linear-gradient(160deg, #16161b, #0c0c10); border: 1px solid rgba(255, 255, 255, .07); box-shadow: inset 0 3px 0 var(--c); }
.pl-top { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; color: var(--text-dim); }
.pl-top b { font-family: var(--f-mono); color: var(--c); filter: brightness(1.3); }
.pl-card h3 { margin: 0; font-family: var(--f-display); font-size: 1.05rem; line-height: 1.35; color: var(--text); }
.pl-type { margin: 0; font-size: .78rem; color: var(--text-dim); }
.pl-card code { flex: 1; display: block; padding: 12px; border-radius: 12px; background: #08080b; border: 1px solid rgba(255, 255, 255, .06); color: #e8dfe2; font-family: var(--f-mono); font-size: .8rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.pl-act { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pl-act .link-btn { font-size: .82rem; color: var(--text-dim); }
.pl-none { grid-column: 1 / -1; text-align: center; color: var(--text-dim); }
:where(html[data-theme="light"]) .pl-card { background: #ffffff; border-color: rgba(60, 20, 30, .07); }
:where(html[data-theme="light"]) .pl-card code { background: #f8f4f1; border-color: rgba(60, 20, 30, .08); color: #2a1a1f; }
:where(html[data-theme="light"]) .pl-tabs button { background: #ffffff; border-color: rgba(60, 20, 30, .1); }
:where(html[data-theme="light"]) .pl-head h1 { color: #1d1418; }
.ask-panel { padding: 0; }
.ask-h .icon-btn[hidden] { display: none; }

/* ---------- Arabic typography (Cairo everywhere) ---------- */
html[lang="ar"] body { font-weight: 500; line-height: 1.8; font-feature-settings: "kern", "liga", "calt"; }
html[lang="ar"] .caps, html[lang="ar"] .rh, html[lang="ar"] .kicker, html[lang="ar"] .tip-num small, html[lang="ar"] .prompt-h, html[lang="ar"] .gl dt small, html[lang="ar"] .tp-pub b { letter-spacing: 0; }
html[lang="ar"] .hero-title { font-weight: 900; line-height: 1.25; letter-spacing: 0; }
html[lang="ar"] .sec-title, html[lang="ar"] .pl-head h1, html[lang="ar"] .fly-step h3 { font-weight: 800; line-height: 1.3; letter-spacing: 0; }
html[lang="ar"] .hero-sub, html[lang="ar"] .sec-sub, html[lang="ar"] .fly-step p { font-weight: 500; line-height: 1.85; }
html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4, html[lang="ar"] .plan-name, html[lang="ar"] .brand-name { font-weight: 800; }
html[lang="ar"] .btn, html[lang="ar"] .lang-toggle button, html[lang="ar"] .ask-fab { font-weight: 700; }
html[lang="ar"] .plan-desc, html[lang="ar"] .plan li, html[lang="ar"] .pan-txt p, html[lang="ar"] .fi-in p { line-height: 1.8; }
