/* Online Library — one stylesheet, no build step. Logical properties keep RTL and LTR in sync.
   Palette: coral / teal / sunshine / navy (Kiddo Puzzle). Every color comes from a token below,
   so dark mode only redefines the tokens. */

:root {
  /* Brand */
  --coral: #ff6b6b;
  --teal: #4ecdc4;
  --sun: #f5b01c;
  --navy: #1e293b;

  /* Surfaces and text */
  --page: #f8fafc;
  --bg: #ffffff;
  --bg-raised: #ffffff;
  --fg: #1e293b;
  --muted: #64748b;
  --subtle: #94a3b8;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --input: #cbd5e1;
  --secondary: #f1f5f9;
  --secondary-hover: #e2e8f0;

  /* Actions */
  --primary: var(--coral);
  --primary-hover: #f25555;
  --primary-text: #d93636;         /* coral that passes 4.5:1 as text on white */
  --primary-soft: rgb(255 107 107 / 12%);
  --primary-fg: #ffffff;
  --ring: rgb(255 107 107 / 55%);
  --accent: var(--teal);
  --accent-text: #0d7d76;
  --accent-soft: rgb(78 205 196 / 16%);
  --sun-soft: rgb(245 176 28 / 16%);
  --sun-text: #a16207;

  /* Status */
  --success: #10b981;
  --success-text: #047857;
  --success-soft: #ecfdf5;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-text: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #f59e0b;
  --warn-text: #92400e;
  --warn-soft: #fffbeb;
  --info: #0ea5e9;
  --info-text: #075985;
  --info-soft: #f0f9ff;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 6%);
  --shadow: 0 1px 3px rgb(15 23 42 / 6%), 0 1px 2px rgb(15 23 42 / 4%);
  --shadow-md: 0 10px 30px -12px rgb(15 23 42 / 18%);
  --shadow-lg: 0 24px 48px -16px rgb(15 23 42 / 25%);
  --shadow-primary: 0 8px 20px -8px rgb(255 107 107 / 70%);
  --overlay: rgb(15 23 42 / 45%);
  --glass: rgb(255 255 255 / 85%);
  --hero-from: #fdf4ff;
  --hero-to: #f8fafc;

  /* Type */
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-latin: "Inter", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Dark theme: follows the device unless the visitor picked one (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0b1120; --bg: #111a2e; --bg-raised: #17223a; --fg: #e2e8f0; --muted: #94a3b8; --subtle: #64748b;
    --border: #22304a; --border-soft: #1a2640; --input: #334463; --secondary: #1a2640; --secondary-hover: #22304a;
    --primary-hover: #ff8585; --primary-text: #ff8a8a; --primary-soft: rgb(255 107 107 / 16%);
    --accent-text: #5eead4; --accent-soft: rgb(78 205 196 / 14%); --sun-soft: rgb(245 176 28 / 14%); --sun-text: #fcd34d;
    --success-text: #6ee7b7; --success-soft: rgb(16 185 129 / 12%); --danger-text: #fca5a5; --danger-soft: rgb(239 68 68 / 12%);
    --warn-text: #fcd34d; --warn-soft: rgb(245 158 11 / 12%); --info-text: #7dd3fc; --info-soft: rgb(14 165 233 / 12%);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%); --shadow: 0 1px 3px rgb(0 0 0 / 35%);
    --shadow-md: 0 10px 30px -12px rgb(0 0 0 / 60%); --shadow-lg: 0 24px 48px -16px rgb(0 0 0 / 70%);
    --shadow-primary: 0 8px 20px -8px rgb(255 107 107 / 45%); --overlay: rgb(2 6 23 / 65%); --glass: rgb(17 26 46 / 85%);
    --hero-from: #1a1433; --hero-to: #0b1120;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0b1120; --bg: #111a2e; --bg-raised: #17223a; --fg: #e2e8f0; --muted: #94a3b8; --subtle: #64748b;
  --border: #22304a; --border-soft: #1a2640; --input: #334463; --secondary: #1a2640; --secondary-hover: #22304a;
  --primary-hover: #ff8585; --primary-text: #ff8a8a; --primary-soft: rgb(255 107 107 / 16%);
  --accent-text: #5eead4; --accent-soft: rgb(78 205 196 / 14%); --sun-soft: rgb(245 176 28 / 14%); --sun-text: #fcd34d;
  --success-text: #6ee7b7; --success-soft: rgb(16 185 129 / 12%); --danger-text: #fca5a5; --danger-soft: rgb(239 68 68 / 12%);
  --warn-text: #fcd34d; --warn-soft: rgb(245 158 11 / 12%); --info-text: #7dd3fc; --info-soft: rgb(14 165 233 / 12%);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%); --shadow: 0 1px 3px rgb(0 0 0 / 35%);
  --shadow-md: 0 10px 30px -12px rgb(0 0 0 / 60%); --shadow-lg: 0 24px 48px -16px rgb(0 0 0 / 70%);
  --shadow-primary: 0 8px 20px -8px rgb(255 107 107 / 45%); --overlay: rgb(2 6 23 / 65%); --glass: rgb(17 26 46 / 85%);
  --hero-from: #1a1433; --hero-to: #0b1120;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip;
  font-family: var(--font); font-size: 15px; line-height: 1.65; color: var(--fg); background: var(--page);
  -webkit-font-smoothing: antialiased;
}
:lang(en) body, body:lang(en) { font-family: var(--font-latin); }
::selection { background: var(--primary-soft); color: inherit; }
a { color: inherit; text-decoration: none; }

/* Keyboard focus is always visible; mouse clicks don't show a ring. */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .chip:focus-visible, .pill:focus-visible { outline-offset: 3px; border-radius: var(--radius-pill); }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; padding: 8px 16px; border-radius: var(--radius-pill); background: var(--fg); color: var(--page); font-weight: 600; transition: top .15s; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; color: inherit; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }

/* ── Layout helpers ─────────────────────────────────────────────── */
.container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 16px; }
.container.narrow { max-width: 896px; }
.pad { padding-block: 32px; }
.pad-lg { padding-block: 80px; }
.site-main { flex: 1; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 24px; }
.stack-sm > * + * { margin-top: 10px; }
.stack-xs > * + * { margin-top: 4px; }
.stack-xs { display: grid; gap: 4px; }
.row { display: flex; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.baseline { align-items: baseline; }
.align-end { align-items: flex-end; }
.align-start { align-items: start; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.grid { display: grid; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.full { width: 100%; }
.grow { flex: 1; min-width: 0; }
.push { margin-inline-start: auto; }
.min-w-0 { min-width: 0; }
.center { text-align: center; }
.center-items { display: grid; justify-items: center; }
.start { text-align: start; }
.end { text-align: end; }
.block { display: block; }
.inline { display: inline; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.xs { font-size: 12px; }
.strong { font-weight: 600; }
.normal { font-weight: 400; font-size: 16px; }
.primary { color: var(--primary-text); }
.success-text { color: var(--success-text); }
.danger-text { color: var(--danger-text) !important; }
.upper { text-transform: uppercase; }
.pointer { cursor: pointer; }
.h1 { font-size: 26px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.h2 { font-size: 19px; font-weight: 700; }
.h-title { font-size: 32px; font-weight: 800; line-height: 1.25; letter-spacing: -.015em; }
.lead { font-size: 18px; }
.prose { white-space: pre-line; line-height: 1.9; }
.empty { padding: 64px 16px; text-align: center; color: var(--muted); }
.link { color: var(--primary-text); }
.link:hover, .link-plain:hover { text-decoration: underline; text-underline-offset: 3px; color: var(--primary-text); }
.divider-top { border-top: 1px solid var(--border); padding-top: 16px; }
.flip-rtl { }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

@media (max-width: 720px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hide-sm { display: none !important; }
  .h-title { font-size: 24px; }
}

/* Theme switch shows the moon in light mode and the sun in dark mode. */
.theme-light-icon { display: none; }
:root[data-theme="dark"] .theme-light-icon { display: block; }
:root[data-theme="dark"] .theme-dark-icon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-light-icon { display: block; }
  :root:not([data-theme="light"]) .theme-dark-icon { display: none; }
}

/* ── Icons ──────────────────────────────────────────────────────── */
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.icon-lg { width: 40px; height: 40px; }
.btn-lg .icon { width: 18px; height: 18px; }

/* ── Buttons & forms ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: var(--primary); color: var(--primary-fg); font-size: 14px; font-weight: 700;
  white-space: nowrap; box-shadow: var(--shadow-primary);
  transition: background .15s, border-color .15s, box-shadow .2s, transform .15s var(--ease);
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn-lg { height: 48px; padding: 0 26px; font-size: 16px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 12px; gap: 4px; }
.btn-block { width: 100%; }
.btn-outline { background: var(--bg); color: var(--fg); border-color: var(--input); box-shadow: none; }
.btn-outline:hover { background: var(--secondary); border-color: var(--subtle); }
.btn-coral-outline { background: transparent; color: var(--primary-text); border: 2px solid var(--primary); box-shadow: none; }
.btn-coral-outline:hover { background: var(--primary-soft); }
.btn-secondary { background: var(--secondary); color: var(--fg); box-shadow: none; }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-ghost { background: transparent; color: var(--fg); box-shadow: none; }
.btn-ghost:hover { background: var(--secondary); }
.btn-teal { background: var(--teal); color: var(--navy); box-shadow: 0 8px 20px -8px rgb(78 205 196 / 70%); }
.btn-teal:hover { background: #3dbdb4; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-danger-text { color: var(--danger-text); }
.btn-success { background: var(--success); color: #fff; box-shadow: none; }
.btn-success:hover { background: #059669; }
.btn.disabled { opacity: .4; pointer-events: none; box-shadow: none; }
.btn.is-favorite { color: var(--primary-text); border-color: var(--primary); background: var(--primary-soft); }
.btn.is-favorite .icon { fill: currentColor; }
.btn[disabled] { opacity: .6; cursor: wait; }

input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--fg); font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[type=file] { font: inherit; font-size: 13px; max-width: 100%; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-inline-end: 10px; padding: 6px 14px; border: 1px solid var(--input); border-radius: var(--radius-pill); background: var(--secondary); color: var(--fg); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--secondary-hover); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
select { width: auto; cursor: pointer; }
select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-inline-end: 34px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%2394a3b8%27 stroke-width=%272.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: right 12px center; }
[dir="rtl"] select:not([multiple]) { background-position: left 12px center; }
.field select, .grid select { width: 100%; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 14px; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); }
.field-error { font-size: 13px; color: var(--danger-text); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check-list { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.narrow-field { max-width: 320px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; border: 1px solid; }
.alert-error { background: var(--danger-soft); border-color: rgb(239 68 68 / 30%); color: var(--danger-text); }
.alert-success { background: var(--success-soft); border-color: rgb(16 185 129 / 30%); color: var(--success-text); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.notice > .icon { width: 20px; height: 20px; margin-top: 2px; }
.notice-warn { background: var(--warn-soft); border-color: rgb(245 158 11 / 35%); } .notice-warn > .icon { color: var(--warn); }
.notice-info { background: var(--info-soft); border-color: rgb(14 165 233 / 30%); } .notice-info > .icon { color: var(--info); }
.notice-success { background: var(--success-soft); border-color: rgb(16 185 129 / 30%); } .notice-success > .icon { color: var(--success); }
.notice-error { background: var(--danger-soft); border-color: rgb(239 68 68 / 30%); } .notice-error > .icon { color: var(--danger); }
.notice-muted { background: var(--secondary); } .notice-muted > .icon { color: var(--muted); }

/* ── Cards, badges, tables ──────────────────────────────────────── */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.row > .card-title { margin-bottom: 0; }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-default { background: var(--primary); color: var(--primary-fg); }
.badge-secondary { background: var(--secondary); color: var(--fg); }
.badge-outline { border: 1px solid var(--input); color: var(--fg); }
.badge-destructive { background: var(--danger-soft); color: var(--danger-text); }
.star { color: var(--sun); }
.tag { background: var(--primary-soft); color: var(--primary-text); border-radius: var(--radius-sm); padding: 0 6px; font-size: 12px; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.status.lg { font-size: 14px; }
.status-pending_payment { background: var(--sun-soft); color: var(--sun-text); }
.status-pending_review { background: var(--info-soft); color: var(--info-text); }
.status-approved { background: var(--success-soft); color: var(--success-text); }
.status-rejected { background: var(--danger-soft); color: var(--danger-text); }
.status-cancelled { background: var(--secondary); color: var(--muted); }

.table-wrap { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 600; font-size: 13px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table thead th { background: var(--secondary); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--secondary) 50%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table th.center, .table td.center { text-align: center; }
.table th.end, .table td.end { text-align: end; }
.table td.max-w { max-width: 260px; }
.table td.indent { padding-inline-start: 32px; }
.table.compact { max-width: 480px; margin-top: 8px; }
.table.compact td, .table.compact th { padding: 4px 6px; }
.empty-cell { text-align: center; color: var(--muted); padding: 40px 12px !important; }
.w-thumb { width: 56px; }
.mini-cover { width: 40px; aspect-ratio: 2/3; border-radius: 4px; background: var(--secondary); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-qr { width: 40px; height: 40px; margin-inline: auto; border-radius: 4px; border: 1px solid var(--border); }
.divided > li { padding-block: 8px; border-bottom: 1px solid var(--border); }
.divided > li:last-child { border-bottom: 0; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; font-size: 14px; }
.details dt { color: var(--muted); }
.details dd { overflow-wrap: anywhere; }
.card.details { max-width: 460px; }

/* ── Header / nav / footer ──────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--border); }
/* The frosted background sits on a pseudo-element: backdrop-filter on the header itself would make it
   the containing block for the drawer's fixed panel and backdrop. */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--fg); flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; transition: transform .3s var(--ease); }
/* Logo files: the color one on light backgrounds, the white one in dark mode. */
.logo-on-dark { display: none !important; }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-on-dark { display: block !important; }
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); }

.main-nav { display: flex; align-items: center; gap: 2px; margin-inline-start: 12px; }
.main-nav a { position: relative; padding: 8px 14px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; color: var(--muted); transition: color .15s, background .15s; }
.main-nav a:hover { color: var(--fg); background: var(--secondary); }
.main-nav a.active { color: var(--primary-text); background: var(--primary-soft); }
/* صمملي (Creator): one link that stands out from the rest of the menu. */
.main-nav a.nav-creator, .main-nav a.nav-creator:hover { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 6px; color: #fff; background: linear-gradient(135deg, var(--coral), var(--sun)); box-shadow: 0 4px 14px -4px rgb(255 107 107 / 60%); }
.main-nav a.nav-creator:hover { filter: brightness(1.06); transform: translateY(-1px); }
.main-nav a.nav-creator .icon { width: 16px; height: 16px; }
.drawer-links a.nav-creator { color: #fff; background: linear-gradient(135deg, var(--coral), var(--sun)); }
.drawer-links a.nav-creator .icon { color: #fff; }
.nav-creator-tag { margin-inline-start: auto; padding: 1px 8px; border-radius: var(--radius-pill); background: rgb(255 255 255 / 25%); font-size: 11px; font-weight: 800; }
.credits-pill { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 14px; font-weight: 800; white-space: nowrap; transition: filter .15s; }
.credits-pill:hover { filter: brightness(.95); }
.credits-pill .icon { width: 16px; height: 16px; }
.credits-pill-word { font-weight: 700; }
.drawer-theme { display: none; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius); font-weight: 600; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: start; }
.drawer-theme .icon { width: 20px; height: 20px; color: var(--muted); }
.drawer-theme:hover { background: var(--secondary); }
@media (max-width: 440px) {
  .header-actions .header-theme { display: none; }
  .drawer-theme { display: flex; }
  .credits-pill { padding: 0 9px; }
}

.header-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; color: var(--fg); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--secondary); }
.icon-btn .icon { width: 18px; height: 18px; }
.lang-btn { border-color: var(--border); }

.search-box { position: relative; width: 260px; }
.search-box.wide { width: 100%; max-width: 380px; }
.search-box > .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search-box input { padding-inline-start: 40px !important; }
.header-search { flex: 1; max-width: 380px; margin-inline-start: auto; }
.header-search input { border-radius: var(--radius-pill) !important; background: var(--secondary) !important; border-color: transparent !important; }
.header-search input:focus { background: var(--bg) !important; border-color: var(--primary) !important; }
.header-search + .header-actions { margin-inline-start: 0; }

/* Account dropdown and mobile drawer: <details> works without JavaScript; app.js closes them on outside click / Esc. */
.menu, .drawer { position: relative; }
.menu > summary, .drawer > summary { list-style: none; }
.menu > summary::-webkit-details-marker, .drawer > summary::-webkit-details-marker { display: none; }
.avatar-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px; padding-inline-end: 8px; border-radius: var(--radius-pill); border: 1px solid var(--border); cursor: pointer; transition: background .15s, box-shadow .15s; }
.avatar-btn:hover, .menu[open] > .avatar-btn { background: var(--secondary); }
.avatar-btn > .icon { color: var(--muted); transition: transform .2s; }
.menu[open] > .avatar-btn > .icon { transform: rotate(180deg); }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--coral), var(--sun)); color: #fff; font-weight: 800; font-size: 14px; }
.menu-panel { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60; width: 260px; padding: 8px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: pop-in .16s var(--ease); }
.menu-head { display: grid; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-head strong { font-size: 15px; }
.menu-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none; font-size: 14px; font-weight: 500; text-align: start; }
.currency-menu summary { width: auto; min-width: 40px; padding-inline: 10px; font-size: 13px; }
.currency-menu .menu-panel { min-width: 230px; max-height: 70vh; overflow-y: auto; }
.currency-menu .menu-item.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 700; }
.menu-hint { padding: 4px 10px 8px; }
.currency-note { display: flex; align-items: flex-start; gap: 6px; }
.currency-note .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.menu-item:hover { background: var(--secondary); }
.menu-item .icon { color: var(--muted); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger-text); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.drawer { display: none; }
.drawer-panel { position: fixed; inset-inline: 0; top: 68px; z-index: 60; max-height: calc(100dvh - 68px); overflow-y: auto; padding: 16px; display: grid; gap: 14px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop-in .18s var(--ease); }
.drawer-panel .search-box { width: 100%; }
.drawer-links { display: grid; gap: 2px; }
.drawer-links a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius); font-weight: 600; }
.drawer-links a .icon { width: 20px; height: 20px; color: var(--muted); }
.drawer-links a:hover { background: var(--secondary); }
.drawer-links a.active { background: var(--primary-soft); color: var(--primary-text); }
.drawer-links a.active .icon { color: var(--primary-text); }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer[open] > summary { background: var(--secondary); }
.drawer[open] > summary::after { content: ""; position: fixed; inset: 68px 0 0; background: var(--overlay); z-index: 50; cursor: default; }

@media (max-width: 1023px) { .header-search { max-width: 260px; } }
@media (max-width: 860px) {
  .drawer { display: block; margin-inline-start: -6px; }
  .main-nav, .header-search { display: none; }
  .header-inner { gap: 8px; min-height: 60px; }
  .drawer-panel { top: 60px; max-height: calc(100dvh - 60px); }
  .drawer[open] > summary::after { inset: 60px 0 0; }
  .brand { font-size: 17px; }
  .brand-mark { width: 28px; height: 28px; }
}
@media (max-width: 420px) {
  /* Signed in, the header holds language, theme, bell and account: tighten it so the name still fits. */
  .header-inner { gap: 6px; }
  .header-actions { gap: 2px; }
  .header-actions .icon-btn { min-width: 32px; padding: 0 5px; }
  .brand { gap: 6px; font-size: 15px; }
  /* A long site name gives way ("My Libr…") rather than pushing the page wider than the phone. */
  .brand { min-width: 0; flex-shrink: 1; }
  .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .site-header .container { padding-inline: 12px; }
  .header-actions .credits-pill { padding: 0 7px; gap: 4px; }
}
@media (max-width: 359px) { .brand span { display: none; } }

/* Footer stays navy in both themes, like the Kiddo Puzzle footer. */
.site-footer { margin-top: 64px; background: #111827; color: #cbd5e1; position: relative; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--coral) 0 25%, var(--teal) 25% 50%, var(--sun) 50% 75%, #6366f1 75%); }
.footer-grid { display: grid; gap: 32px; padding-block: 48px 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } .footer-brand { grid-column: auto; } }
.footer-brand { display: grid; gap: 14px; align-content: start; justify-items: start; }
.footer-brand .brand { color: #fff; }
.footer-brand p { color: #94a3b8; max-width: 340px; }
.footer-contact { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--radius-pill); background: rgb(255 255 255 / 6%); border: 1px solid rgb(255 255 255 / 10%); font-size: 13px; font-weight: 600; color: #e2e8f0; transition: background .15s, border-color .15s; }
.footer-pill:hover { background: rgb(255 255 255 / 12%); }
.footer-pill.wa .icon { color: #4ade80; }
.footer-col { display: grid; gap: 10px; align-content: start; font-size: 14px; }
.footer-col h2 { font-size: 13px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
:lang(ar) .footer-col h2 { letter-spacing: 0; font-size: 14px; }
.footer-col a { color: #94a3b8; justify-self: start; transition: color .15s; }
.footer-col a:hover { color: var(--coral); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px; border-top: 1px solid rgb(255 255 255 / 8%); font-size: 13px; color: #64748b; }
.footer-bottom a { display: inline-flex; align-items: center; gap: 6px; color: #94a3b8; }
.footer-bottom a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: var(--coral); }

.toasts { position: fixed; top: 16px; inset-inline-end: 16px; z-index: 50; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--bg); border: 1px solid var(--border); border-inline-start: 4px solid var(--success); border-radius: 8px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; }
.toast-error { border-inline-start-color: var(--danger); }
.toast-warning { border-inline-start-color: var(--warn); }
.toast.hide { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* ── Home ───────────────────────────────────────────────────────── */
.stack-xl > * + * { margin-top: 48px; }
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--hero-from) 0%, var(--hero-to) 100%); border-bottom: 1px solid var(--border-soft); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 75%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); opacity: .7; }
.hero-inner { position: relative; display: grid; gap: 40px; align-items: center; padding-block: 56px 64px; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.1fr .9fr; padding-block: 72px 80px; } }
.hero-copy { display: grid; gap: 20px; justify-items: start; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--bg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 700; color: var(--primary-text); }
.eyebrow .icon { color: var(--sun); }
.hero-title { font-size: clamp(34px, 5.5vw, 58px); font-weight: 800; line-height: 1.12; letter-spacing: -.025em; }
:lang(ar) .hero-title { line-height: 1.3; letter-spacing: 0; }
.hero-title .hl { color: var(--primary); display: inline-block; position: relative; }
.hero-title .hl::after { content: ""; position: absolute; inset-inline: 2%; bottom: .06em; height: .16em; border-radius: 999px; background: var(--sun); opacity: .55; z-index: -1; }
.hero-lead { font-size: 18px; color: var(--muted); max-width: 520px; }
.hero-search { position: relative; display: flex; align-items: center; width: 100%; max-width: 520px; padding: 6px; padding-inline-start: 44px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-pill); box-shadow: var(--shadow-md); transition: border-color .15s, box-shadow .15s; }
.hero-search:focus-within { border-color: var(--primary); box-shadow: var(--shadow-md), 0 0 0 4px var(--primary-soft); }
.hero-search > .icon { position: absolute; inset-inline-start: 18px; width: 18px; height: 18px; color: var(--subtle); }
.hero-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding-inline: 4px !important; font-size: 15px !important; }
.hero-search .btn { flex-shrink: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 12px 32px; padding-top: 8px; }
.hero-stats li { display: grid; }
.hero-stats strong { font-size: 26px; font-weight: 800; line-height: 1.1; }
.hero-stats li:nth-child(1) strong { color: var(--primary-text); }
.hero-stats li:nth-child(2) strong { color: var(--accent-text); }
.hero-stats li:nth-child(3) strong { color: var(--sun-text); }
.hero-stats span { font-size: 13px; color: var(--muted); font-weight: 600; }

.hero-art { position: relative; min-height: 340px; display: grid; place-items: center; }
.blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.blob-teal { width: 260px; height: 260px; background: var(--accent-soft); inset-inline-end: 4%; top: 0; }
.blob-sun { width: 180px; height: 180px; background: var(--sun-soft); inset-inline-start: 6%; bottom: 0; }
.hero-stack { position: relative; width: 220px; aspect-ratio: 2/3; }
.hero-stack a { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); transition: transform .4s var(--ease); }
.hero-stack img { width: 100%; height: 100%; object-fit: cover; }
.hero-stack.n3 a:nth-child(1) { transform: translateX(-46%) rotate(-10deg) scale(.86); }
.hero-stack.n3 a:nth-child(2) { transform: translateX(46%) rotate(10deg) scale(.86); }
.hero-stack.n2 a:nth-child(1) { transform: translateX(-26%) rotate(-7deg) scale(.92); }
.hero-stack a:last-child { z-index: 2; transform: none; }
.hero-art:hover .hero-stack.n3 a:nth-child(1) { transform: translateX(-56%) rotate(-13deg) scale(.86); }
.hero-art:hover .hero-stack.n3 a:nth-child(2) { transform: translateX(56%) rotate(13deg) scale(.86); }
.hero-art:hover .hero-stack a:last-child { transform: translateY(-6px); }
.hero-float { position: absolute; z-index: 3; bottom: 14px; inset-inline-start: 4%; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: float 5s ease-in-out infinite; }
.hero-float strong { display: block; font-size: 14px; }
.hero-float small { display: block; font-size: 12px; color: var(--muted); }
.float-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--success-soft); color: var(--success); flex-shrink: 0; }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (max-width: 899px) { .hero-art { min-height: 300px; } .hero-stack { width: 170px; } }
@media (max-width: 599px) { .hero-art { display: none; } .hero-inner { padding-block: 40px 48px; } .hero-stats strong { font-size: 22px; } }

.section-head, .shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-head h2, .shelf-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.section-head a, .shelf-head a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--primary-text); flex-shrink: 0; padding: 4px 10px; border-radius: var(--radius-pill); transition: background .15s; }
.section-head a:hover, .shelf-head a:hover { background: var(--primary-soft); }

.tone-coral { --tone: var(--coral); --tone-soft: var(--primary-soft); --tone-text: var(--primary-text); }
.tone-teal { --tone: var(--teal); --tone-soft: var(--accent-soft); --tone-text: var(--accent-text); }
.tone-sun { --tone: var(--sun); --tone-soft: var(--sun-soft); --tone-text: var(--sun-text); }
.tone-indigo { --tone: #6366f1; --tone-soft: rgb(99 102 241 / 14%); --tone-text: #4f46e5; }
:root[data-theme="dark"] .tone-indigo { --tone-text: #a5b4fc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tone-indigo { --tone-text: #a5b4fc; } }
.cat-chips { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cat-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.cat-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--tone); }
.cat-chip-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--tone-soft); color: var(--tone-text); flex-shrink: 0; }
.cat-chip-icon .icon { width: 20px; height: 20px; }
.cat-chip-text { display: grid; min-width: 0; }
.cat-chip-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-chip-text small { font-size: 12px; color: var(--muted); }

.continue-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.continue-card { display: flex; gap: 14px; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); transition: box-shadow .2s, border-color .2s; }
.continue-card:hover { box-shadow: var(--shadow-md); border-color: var(--ring); }
.continue-cover { width: 64px; flex-shrink: 0; }
.continue-cover .cover { border-radius: 6px; box-shadow: var(--shadow); }
.continue-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.continue-text strong { font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue-text small { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--primary-text); }

.empty-state { display: grid; justify-items: center; gap: 10px; padding: 56px 16px; text-align: center; background: var(--bg); border: 1px dashed var(--input); border-radius: var(--radius-lg); }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 6px; }
.empty-icon .icon { width: 28px; height: 28px; }

/* ── Books ──────────────────────────────────────────────────────── */
.cover { position: relative; aspect-ratio: 2/3; width: 100%; overflow: hidden; border-radius: 4px 10px 10px 4px; background: var(--secondary); box-shadow: 0 2px 4px rgb(15 23 42 / 10%), 0 12px 24px -10px rgb(15 23 42 / 35%); }
[dir="rtl"] .cover { border-radius: 10px 4px 4px 10px; }
/* Spine shading on the binding edge (left for LTR, right for RTL books). */
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgb(0 0 0 / 18%) 0, rgb(255 255 255 / 18%) 2%, transparent 7%, transparent 100%); }
[dir="rtl"] .cover::after { background: linear-gradient(270deg, rgb(0 0 0 / 18%) 0, rgb(255 255 255 / 18%) 2%, transparent 7%, transparent 100%); }
.cover img:not(.cover-mark) { width: 100%; height: 100%; object-fit: cover; }

.cover-empty { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 14% 12% 16%; color: #fff; background: var(--c1); isolation: isolate; container-type: inline-size; }
.cover-coral { --c1: #ff6b6b; --c2: #e0454f; }
.cover-teal { --c1: #4ecdc4; --c2: #1f9c93; }
.cover-sun { --c1: #f5b01c; --c2: #e0851b; }
.cover-navy { --c1: #334155; --c2: #1e293b; }
.cover-indigo { --c1: #818cf8; --c2: #5b5bd6; }
.cover-empty { background: linear-gradient(160deg, var(--c1) 0%, var(--c2) 100%); }
.cover-sun, .cover-teal { color: #1e293b; }
.cover-shape { position: absolute; z-index: -1; border-radius: 50%; background: rgb(255 255 255 / 18%); }
.cover-shape.a { width: 80%; aspect-ratio: 1; top: -18%; inset-inline-end: -22%; }
.cover-shape.b { width: 46%; aspect-ratio: 1; top: 30%; inset-inline-start: -14%; background: rgb(255 255 255 / 12%); border-radius: 30%; transform: rotate(20deg); }
.cover-title { font-size: clamp(11px, 11cqi, 26px); font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cover-author { font-size: clamp(9px, 7cqi, 16px); font-weight: 600; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-mark { position: absolute; top: 9%; inset-inline-start: 12%; width: clamp(12px, 13cqi, 30px); height: auto; opacity: .9; }
@container (max-width: 90px) { .cover-title, .cover-author { display: none; } .cover-mark { top: 50%; inset-inline-start: auto; left: 50%; translate: -50% -50%; width: 40%; } }

.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 18px; }
@media (min-width: 640px) { .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .book-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 22px; } }
@media (min-width: 1024px) { .book-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.book-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: start; border-radius: var(--radius); }
.book-card-cover { position: relative; width: 100%; display: block; transition: transform .3s var(--ease); }
.book-card-cover .cover { transition: box-shadow .3s var(--ease); }
a.book-card:hover .book-card-cover, .book-card-cover:hover { transform: translateY(-6px); }
a.book-card:hover .cover, .book-card-cover:hover .cover { box-shadow: 0 4px 8px rgb(15 23 42 / 10%), 0 24px 36px -12px rgb(15 23 42 / 40%); }
a.book-card:hover h3 { color: var(--primary-text); }
.book-card-text { display: grid; gap: 2px; width: 100%; }
.book-card-text h3 { font-size: 14px; font-weight: 700; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .15s; }
.book-card-text p { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owned-badge, .sale-badge { position: absolute; z-index: 2; top: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: var(--radius-pill); box-shadow: var(--shadow-md); }
.owned-badge { background: var(--teal); color: var(--navy); }
.sale-badge { background: var(--primary); color: #fff; }
.owned-badge .icon { width: 12px; height: 12px; stroke-width: 3; }
.price-tag { display: inline-flex; align-items: center; gap: 6px; background: var(--sun-soft); color: var(--fg); border-radius: var(--radius-pill); padding: 2px 10px; font-size: 13px; font-weight: 800; }
.price-tag.free { background: var(--accent-soft); color: var(--accent-text); }
.price-tag.lg { font-size: 18px; padding: 6px 16px; }
.price-tag s { font-weight: 500; color: var(--muted); font-size: .85em; }

.shelf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.shelf-body { position: relative; }
.shelf-track { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-block: 8px 12px; margin-block: -8px -12px; }
.shelf-track::-webkit-scrollbar { display: none; }
.shelf-item { width: 164px; flex-shrink: 0; scroll-snap-align: start; }
@media (max-width: 640px) { .shelf-item { width: 132px; } .shelf-track { gap: 14px; } }
.shelf-arrow { position: absolute; z-index: 3; top: 38%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-raised); box-shadow: var(--shadow-lg); color: var(--fg); display: none; align-items: center; justify-content: center; transition: opacity .2s, background .15s, color .15s, transform .2s var(--ease); }
.shelf-arrow:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-50%) scale(1.06); }
.shelf-arrow .icon { width: 20px; height: 20px; }
.shelf-arrow.start { inset-inline-start: -14px; }
.shelf-arrow.end { inset-inline-end: -14px; }
.shelf-arrow.off { opacity: 0; pointer-events: none; }
@media (min-width: 640px) { .shelf-arrow { display: flex; } }

.page-head { background: linear-gradient(180deg, var(--hero-from), var(--page)); border-bottom: 1px solid var(--border-soft); padding-block: 32px 24px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--primary-text); }
.crumbs .icon { width: 14px; height: 14px; color: var(--subtle); }
.crumbs [aria-current] { color: var(--fg); font-weight: 600; }
.count-pill { display: inline-flex; align-items: center; padding: 2px 12px; border-radius: var(--radius-pill); background: var(--bg); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--muted); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.filter-scroll { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-label { display: inline-flex; align-items: center; gap: 6px; padding-inline: 6px 4px; font-size: 13px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.filter-bar select { width: auto; flex-shrink: 0; min-height: 36px; height: 36px; padding-block: 0; border-radius: var(--radius-pill); background-color: var(--secondary); border-color: transparent; font-weight: 600; font-size: 13px; cursor: pointer; }
.filter-bar select:hover { background-color: var(--secondary-hover); }
.filter-bar select.is-set { background-color: var(--primary-soft); color: var(--primary-text); border-color: var(--ring); }
.filter-bar .sort { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-shrink: 0; }
.filter-bar .sort select { background-color: var(--bg); border-color: var(--input); }
@media (max-width: 640px) { .filter-bar { border-radius: var(--radius); } .filter-bar .sort { margin-inline-start: 0; width: 100%; } .filter-bar .sort select { width: 100%; } }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px !important; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 14px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 13px; font-weight: 700; transition: background .15s; }
[dir="rtl"] .chip { padding: 0 14px 0 8px; }
.chip .icon { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--bg); }
.chip:hover { background: rgb(255 107 107 / 22%); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-block; border-radius: var(--radius-pill); background: var(--bg); border: 1px solid var(--border); padding: 4px 14px; font-size: 13px; font-weight: 600; transition: border-color .15s, color .15s; }
.pill:hover { border-color: var(--primary); color: var(--primary-text); }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 24px; }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-num { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
a.pager-num:hover { background: var(--secondary); color: var(--fg); }
.pager-num.current { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.pager-gap { color: var(--subtle); padding: 0 2px; }

.cat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cat-card { padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: box-shadow .2s, border-color .2s, transform .2s var(--ease); }
.cat-card:hover { border-color: var(--tone, var(--primary)); box-shadow: var(--shadow-md); }
.cat-link { display: flex; align-items: center; gap: 12px; }
.cat-link > .icon { color: var(--subtle); transition: transform .2s var(--ease), color .2s; }
.cat-card:hover .cat-link > .icon { color: var(--tone-text); transform: translateX(3px); }
[dir="rtl"] .cat-card:hover .cat-link > .icon { transform: translateX(-3px); }
.cat-card .pills { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }

.book-hero { background: linear-gradient(180deg, var(--hero-from), var(--page)); border-bottom: 1px solid var(--border-soft); padding-block: 24px 40px; }
.book-hero .crumbs { margin-bottom: 24px; }
.book-hero .crumbs [aria-current] { max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-detail { display: grid; gap: 28px; }
.book-detail-cover { position: relative; width: 200px; margin-inline: auto; }
.book-detail-cover .cover { box-shadow: 0 4px 8px rgb(15 23 42 / 10%), 0 32px 48px -16px rgb(15 23 42 / 45%); }
.sale-badge.lg { font-size: 14px; padding: 4px 12px; top: 12px; inset-inline-end: -10px; }
.book-info { display: grid; gap: 16px; align-content: start; }
@media (min-width: 768px) {
  .book-detail { grid-template-columns: 17rem 1fr; gap: 48px; }
  .book-detail-cover { width: 100%; }
}
.book-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.book-meta li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--bg); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); }
.book-meta .icon { width: 14px; height: 14px; }
.book-meta a { display: inline-flex; align-items: center; gap: 6px; }
.buy-panel { display: grid; gap: 16px; padding: 20px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); max-width: 620px; }
.buy-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.save-note { font-size: 13px; font-weight: 800; color: var(--primary-text); background: var(--primary-soft); padding: 3px 10px; border-radius: var(--radius-pill); }
.owned-note { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--success-text); }
.owned-note .icon { width: 20px; height: 20px; }
.buy-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.buy-hint .icon { width: 15px; height: 15px; color: var(--accent-text); }
.buy-panel .notice { margin: 0; }

.book-body { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .book-body { grid-template-columns: 1fr 20rem; gap: 40px; } }
.clamp { position: relative; }
.clamp.is-clamped { max-height: 11.5em; overflow: hidden; }
.clamp.is-clamped::after { content: ""; position: absolute; inset: auto 0 0; height: 4em; background: linear-gradient(transparent, var(--page)); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--primary-text); font-weight: 700; font-size: 14px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.sticky-cta { display: none; }
@media (max-width: 767px) {
  .sticky-cta { position: fixed; z-index: 30; inset: auto 0 0; display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -12px rgb(15 23 42 / 25%); }
  .sticky-cta-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
  .sticky-cta-text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sticky-cta-text .price-tag { justify-self: start; }
  .sticky-cta .btn { flex-shrink: 0; }
  .sticky-cta { transition: transform .25s var(--ease), opacity .25s; }
  .sticky-cta.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
  body:has(.sticky-cta) .site-footer { padding-bottom: 76px; }
}

/* ── Auth ───────────────────────────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; align-items: stretch; gap: 0; width: 100%; max-width: 940px; margin: 40px auto; padding: 0 16px; }
.auth-card { position: relative; width: 100%; max-width: 440px; padding: 32px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.auth-card-mark { width: 44px; height: 44px; margin: 0 auto 14px; }
.auth-card > h1 { margin-bottom: 20px; font-size: 22px; font-weight: 800; }
.auth-card .hint, .auth-card > p { margin-bottom: 12px; }
.auth-card .btn-block { height: 46px; font-size: 15px; margin-top: 4px; }
.auth-links { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 8px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-links a { color: var(--primary-text); font-weight: 700; }
.auth-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-aside { display: none; }
@media (min-width: 860px) {
  .auth-aside { position: relative; overflow: hidden; display: grid; align-content: center; gap: 20px; flex: 1; padding: 40px; color: #fff; background: linear-gradient(145deg, var(--coral) 0%, #f7875a 55%, var(--sun) 100%); border-radius: var(--radius-lg) 0 0 var(--radius-lg); isolation: isolate; }
  [dir="rtl"] .auth-aside { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
  .auth-aside + .auth-card { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; border-inline-start: 0; }
  [dir="rtl"] .auth-aside + .auth-card { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
  .auth-aside h2 { font-size: 28px; font-weight: 800; line-height: 1.25; }
  .auth-aside ul { display: grid; gap: 14px; }
  .auth-aside li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
  .auth-aside li span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: rgb(255 255 255 / 22%); flex-shrink: 0; }
  .auth-mark { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 16px; padding: 8px; box-shadow: var(--shadow-md); }
  .auth-blob { position: absolute; z-index: -1; border-radius: 50%; background: rgb(255 255 255 / 14%); }
  .auth-blob.a { width: 260px; height: 260px; inset-inline-end: -80px; top: -80px; }
  .auth-blob.b { width: 180px; height: 180px; inset-inline-start: -60px; bottom: -60px; background: rgb(78 205 196 / 35%); }
}

/* ── Orders ─────────────────────────────────────────────────────── */
.order-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 16px 18px; border-radius: var(--radius); transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.order-line.card:hover { border-color: var(--ring); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.order-line.plain { padding: 0; }
.order-line.plain:hover { color: var(--primary-text); }
.thumb { width: 56px; flex-shrink: 0; }
.thumb.sm { width: 40px; }
.totals { border-top: 1px dashed var(--border); padding-top: 12px; display: grid; gap: 4px; }
.total-line { border-top: 1px dashed var(--border); padding-top: 14px; font-size: 20px; font-weight: 800; }
.code-pill { background: var(--secondary); padding: 1px 8px; border-radius: var(--radius-sm); font-weight: 700; }
.coupon-input { max-width: 220px; text-transform: uppercase; letter-spacing: .06em; }

.stepper { display: grid; grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr)); padding: 18px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); counter-reset: step; }
.step { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; }
.step::before { content: ""; position: absolute; top: 17px; inset-inline-start: calc(-50% + 22px); width: calc(100% - 44px); height: 3px; border-radius: 3px; background: var(--border); }
.step:first-child::before { display: none; }
.step.done::before, .step.current::before { background: var(--teal); }
.step-dot { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--secondary); color: var(--muted); font-weight: 800; font-size: 14px; border: 2px solid var(--border); }
.step-dot .icon { width: 18px; height: 18px; stroke-width: 3; }
.step.done .step-dot { background: var(--teal); border-color: var(--teal); color: var(--navy); }
.step.current .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 5px var(--primary-soft); }
.step-label { font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.35; }
.step.current .step-label { color: var(--fg); }
@media (max-width: 480px) { .step-label { font-size: 11px; } .stepper { padding-inline: 4px; } }

.pay-step { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; }
.pay-step-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); font-size: 14px; flex-shrink: 0; }
.method-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.method-option { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--bg); cursor: pointer; font-size: 14px; transition: border-color .15s, background .15s, box-shadow .15s; }
.method-option:hover { border-color: var(--input); }
.method-option input { position: absolute; opacity: 0; pointer-events: none; }
.method-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.method-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--secondary); color: var(--muted); flex-shrink: 0; }
.method-check { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--input); color: transparent; flex-shrink: 0; }
.method-check .icon { width: 13px; height: 13px; stroke-width: 3.5; }
.method-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow-sm); }
.method-option:has(input:checked) .method-icon { background: var(--primary); color: #fff; }
.method-option:has(input:checked) .method-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.method-info { display: grid; gap: 14px; padding: 18px; border: 1px dashed var(--input); border-radius: var(--radius); background: var(--secondary); }
@media (min-width: 640px) { .method-info:has(.qr) { grid-template-columns: 1fr auto; } }
.pay-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pay-chip { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 13px; }
/* Checkout: items and receipt on one side, coupon / total / method / Pay button on the other. */
.checkout { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) { .checkout { grid-template-columns: minmax(0, 1fr) 24rem; } .checkout-aside { position: sticky; top: 88px; } }
.checkout-aside .total-line { font-size: 18px; }
.pay-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.pay-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 12px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--secondary); text-align: center; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.pay-tile:hover { border-color: var(--input); }
.pay-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pay-tile .icon { width: 26px; height: 26px; color: var(--muted); }
.pay-tile:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pay-tile:has(input:checked) .icon { color: var(--primary); }
.pay-tile:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-block { width: 100%; justify-content: center; }
/* The main call to action on checkout: tall, full width, impossible to miss. */
.btn-xl { height: 64px; padding: 0 28px; font-size: 19px; font-weight: 800; border-radius: var(--radius); box-shadow: var(--shadow); }
.btn-xl .icon { width: 22px; height: 22px; }
/* On phones the payment card comes first, so the Pay button needs no scrolling to reach. */
@media (max-width: 959px) { .checkout-aside { order: -1; } }
.account { display: inline-block; background: var(--bg); border: 1px solid var(--border); padding: 6px 14px; border-radius: var(--radius-sm); font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.qr { width: 150px; height: 150px; justify-self: center; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.dropzone { position: relative; display: grid; justify-items: center; gap: 6px; padding: 28px 16px; text-align: center; border: 2px dashed var(--input); border-radius: var(--radius-lg); background: var(--secondary); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--teal); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--bg); color: var(--primary-text); box-shadow: var(--shadow-sm); }
.dropzone.has-file .dropzone-icon { color: var(--accent-text); }
.dropzone-icon .icon { width: 22px; height: 22px; }
.dropzone-text { font-size: 14px; overflow-wrap: anywhere; }
.upload-preview { max-height: 256px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.proof-line { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; transition: background .15s; }
.proof-line:hover { background: var(--secondary); }
.proof-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); }
.timeline { display: grid; gap: 14px; }
.timeline > li { position: relative; border-inline-start: 2px solid var(--border); padding-inline-start: 16px; display: grid; gap: 4px; }
.timeline > li::before { content: ""; position: absolute; top: 6px; inset-inline-start: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--teal); }
.timeline > li:first-child::before { background: var(--teal); }
.proof { display: grid; gap: 16px; }
@media (min-width: 640px) { .proof { grid-template-columns: minmax(0, 16rem) 1fr; } }
.proof-image { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--secondary); }
.proof-image img { width: 100%; max-height: 384px; object-fit: contain; }
.proof-image .pdf { height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }

/* ── Admin ──────────────────────────────────────────────────────── */
.admin-shell { display: flex; flex-direction: column; gap: 24px; padding-block: 24px 40px; flex: 1; }
.admin-main { min-width: 0; flex: 1; }
.admin-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { position: relative; display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding: 9px 12px; border-radius: var(--radius); font-size: 14px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.admin-nav a .icon { width: 18px; height: 18px; }
.admin-nav a:hover { background: var(--secondary); color: var(--fg); }
.admin-nav a.active { background: var(--primary-soft); color: var(--primary-text); }
.admin-nav .count { margin-inline-start: auto; min-width: 22px; text-align: center; background: var(--primary); color: #fff; border-radius: var(--radius-pill); padding: 0 7px; font-size: 12px; font-weight: 800; }
@media (min-width: 768px) {
  .admin-shell { flex-direction: row; align-items: flex-start; }
  .admin-side { position: sticky; top: 88px; width: 228px; flex-shrink: 0; }
  .admin-nav { flex-direction: column; }
  .admin-nav a.active::before { content: ""; position: absolute; inset-inline-start: -6px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--primary); }
}
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .stat-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { position: relative; overflow: hidden; display: grid; gap: 6px; align-content: start; padding: 18px; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.stat::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tone, var(--border)); opacity: .9; }
.stat-grid > .stat:nth-child(4n+1):not([class*="tone-"]) { --tone: var(--coral); }
.stat-grid > .stat:nth-child(4n+2):not([class*="tone-"]) { --tone: var(--teal); }
.stat-grid > .stat:nth-child(4n+3):not([class*="tone-"]) { --tone: var(--sun); }
.stat-grid > .stat:nth-child(4n+4):not([class*="tone-"]) { --tone: #6366f1; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--tone-soft); color: var(--tone-text); margin-bottom: 4px; }
.stat-icon .icon { width: 20px; height: 20px; }
.stat.highlight { box-shadow: 0 0 0 2px var(--primary), var(--shadow-md); }
a.stat:hover { border-color: var(--tone, var(--primary)); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.stat-value.sm { font-size: 20px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .15s; }
.tabs a:hover { color: var(--fg); }
.tabs a.active { color: var(--primary-text); font-weight: 700; border-color: var(--primary); }
.tabs .count { background: var(--secondary); border-radius: var(--radius-pill); padding: 0 8px; font-size: 12px; font-weight: 700; }
.tabs .count.hot { background: var(--primary); color: #fff; }
.two-col { display: grid; gap: 24px; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 20rem; } }
.book-form { display: grid; gap: 24px; }
@media (min-width: 1024px) { .book-form { grid-template-columns: 1fr 18rem; align-items: start; } }
.cover-preview { width: 160px; aspect-ratio: 2/3; margin-inline: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--secondary); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-preview.wide { width: 100%; aspect-ratio: 1200 / 630; }
.break-word { overflow-wrap: anywhere; }
.package-upload { display: grid; gap: 10px; margin-top: 12px; }
.progress { height: 8px; background: var(--secondary); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.fold { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.fold > summary { cursor: pointer; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.fold[open] > summary { margin-bottom: 12px; }

/* Charts */
.chart svg { width: 100%; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--primary); }
.chart .hit { fill: transparent; }
.chart .col:hover .bar { fill: var(--primary-hover); }
.chart .col:hover .hit { fill: var(--secondary); }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { font-weight: 600; white-space: nowrap; }
.bar-track { height: 6px; background: var(--secondary); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.bar-fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* ── Reader ─────────────────────────────────────────────────────── */
.layout-bare .reader { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.reader-bar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 10px; background: #111827; color: #e2e8f0; flex-shrink: 0; border-bottom: 3px solid var(--coral); }
.reader-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--radius-pill); border: 0; background: rgb(255 255 255 / 6%); color: inherit; font-size: 13px; font-weight: 600; transition: background .15s; }
.reader-btn:hover { background: rgb(255 255 255 / 14%); }
.reader-btn:focus-visible { outline-color: var(--coral); }
.reader-title { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 700; }
.reader-badge { flex-shrink: 0; background: var(--sun); color: var(--navy); font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: var(--radius-pill); }
.reader-frame { position: relative; flex: 1; background: #fff; }
.reader-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.watermark { position: absolute; inset-inline-end: 12px; bottom: 8px; font-size: 10px; color: rgb(0 0 0 / 25%); pointer-events: none; user-select: none; }

/* ── Legal, errors, installer ───────────────────────────────────── */
.legal { padding: 28px 32px; }
@media (max-width: 640px) { .legal { padding: 20px; } }
.legal > * + * { margin-top: 16px; }
.legal .h2 { margin-top: 32px; padding-top: 20px; border-top: 1px dashed var(--border); font-weight: 800; }
.legal .h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.seg-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-pill); }
.seg-tabs a { padding: 6px 16px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.seg-tabs a:hover { color: var(--fg); }
.seg-tabs a.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.error-page { display: grid; justify-items: center; gap: 14px; }
.error-code { font-size: clamp(88px, 18vw, 140px); font-weight: 800; line-height: 1; letter-spacing: -.04em; background: linear-gradient(135deg, var(--coral), var(--sun) 60%, var(--teal)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.error-detail { text-align: start; background: var(--secondary); padding: 12px; border-radius: var(--radius); overflow: auto; font-size: 12px; margin-block: 16px; white-space: pre-wrap; max-width: 100%; }

.install { max-width: 760px; margin: 32px auto; padding: 0 16px; display: grid; gap: 20px; }
.install h1 { font-size: 26px; }
.install h2 { font-size: 17px; margin-top: 8px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; font-size: 14px; }
.checks .ok { color: var(--success-text); } .checks .bad { color: var(--danger-text); font-weight: 600; } .checks .warn { color: var(--warn); }

/* ── Notifications, profiles, Google sign-in, book requests ─────────────── */

/* Bell */
.bell-btn { position: relative; }
.bell-count { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--primary); color: var(--primary-fg); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.bell-count[hidden] { display: none; }
.menu[open] > .bell-btn { background: var(--secondary); }
.bell-panel { width: min(360px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
@media (max-width: 480px) { .bell-menu { position: static; } .bell-panel { inset-inline: 12px; width: auto; top: 64px; } }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell-panel .notice-list { max-height: min(420px, 60vh); overflow-y: auto; }
.bell-empty { padding: 28px 16px; text-align: center; }
.bell-all { display: block; padding: 11px; text-align: center; font-size: 13px; font-weight: 700; color: var(--primary-text); border-top: 1px solid var(--border); }
.bell-all:hover { background: var(--secondary); }

.notice-list { list-style: none; padding: 0; }
.card.notice-list { padding: 6px; }
.notice-list > li + li { border-top: 1px solid var(--border-soft); }
.notice-item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); color: var(--fg); transition: background .12s; }
.notice-item:hover { background: var(--secondary); }
.notice-item.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notice-item.unread:hover { background: var(--primary-soft); }
.notice-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--secondary); color: var(--muted); }
.notice-item.unread .notice-icon { background: var(--bg); color: var(--primary-text); }
.notice-icon .icon { width: 17px; height: 17px; }
.notice-text { display: grid; gap: 2px; min-width: 0; flex: 1; font-size: 14px; }
.notice-body { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.notice-time { color: var(--subtle); font-size: 12px; }
.notice-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--primary); }
.toast-info { border-inline-start-color: var(--info); }
a.toast { display: block; color: var(--fg); font-weight: 600; }

/* Push switch */
.push-toggle { display: grid; gap: 6px; justify-items: start; }
.push-toggle.compact { padding: 12px 14px; border: 1px dashed var(--input); border-radius: var(--radius); background: var(--bg); grid-template-columns: 1fr auto; align-items: center; }
.push-toggle.compact .hint { grid-column: 1 / -1; }
.push-toggle.compact .hint:empty { display: none; }

/* Avatars */
img.avatar { object-fit: cover; background: var(--secondary); }
.avatar-lg { width: 48px; height: 48px; font-size: 20px; }
.avatar-xl { width: 88px; height: 88px; font-size: 36px; box-shadow: 0 0 0 4px var(--bg), var(--shadow-md); }
.avatar[hidden] { display: none; }
.menu-head { color: var(--fg); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
a.menu-head:hover { background: var(--secondary); }
.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-head .h1 { overflow-wrap: anywhere; }
.avatar-field { display: flex; align-items: center; gap: 16px; }
.avatar-preview { flex: none; }
.file-btn { position: relative; overflow: hidden; width: fit-content; cursor: pointer; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { flex: none; width: 34px; height: 34px; font-size: 14px; }

/* Google */
.google-g { width: 18px; height: 18px; flex: none; }
.google-btn { gap: 10px; font-weight: 600; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--subtle); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.badge.gap-1 { gap: 4px; }
.badge .google-g { width: 13px; height: 13px; }

/* Book requests */
.request-card { display: grid; gap: 6px; padding: 16px 18px; }
.request-note, .request-answer { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--secondary); white-space: normal; }
.request-answer { background: var(--accent-soft); }
.request-actions { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; align-items: center; padding-top: 6px; border-top: 1px solid var(--border-soft); }
@media (max-width: 720px) { .request-actions { grid-template-columns: 1fr; } }
.request-hint { margin-top: 28px; }
.center-row { justify-content: center; }

/* Settings helpers */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.label { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.steps { display: grid; gap: 6px; padding-inline-start: 20px; list-style: decimal; }
.steps a { color: var(--primary-text); text-decoration: underline; text-underline-offset: 2px; }
.steps code, .found-chats code { padding: 1px 6px; border-radius: var(--radius-sm); background: var(--secondary); font-size: 12px; overflow-wrap: anywhere; }
.found-chats { display: grid; gap: 6px; list-style: none; padding: 0; font-size: 14px; }
.found-chats li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fit { width: fit-content; }
.settings-tests { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Formatted descriptions (lib/richtext.php). Text colours are classes with a light and a dark shade. */
.rich { line-height: 1.9; overflow-wrap: anywhere; }
.rich > * + * { margin-top: .75em; }
.rich h2 { font-size: 1.3em; font-weight: 800; line-height: 1.4; }
.rich h3 { font-size: 1.1em; font-weight: 700; line-height: 1.4; }
.rich ul, .rich ol { padding-inline-start: 1.5em; }
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }
.rich li + li { margin-top: .25em; }
.rich blockquote { margin-inline: 0; padding: 8px 16px; border-inline-start: 4px solid var(--primary); background: var(--primary-soft); border-radius: var(--radius-sm); }
.rich a { color: var(--primary-text); text-decoration: underline; text-underline-offset: 3px; }
.rich hr { border: 0; border-top: 1px solid var(--border); }
.tc-red { color: #e03131; } .tc-orange { color: #e8590c; } .tc-gold { color: #b7791f; } .tc-green { color: #2f9e44; }
.tc-teal { color: #0c8599; } .tc-blue { color: #1c7ed6; } .tc-purple { color: #7048e8; } .tc-pink { color: #d6336c; }
.tc-bg-red { background: #e03131; } .tc-bg-orange { background: #e8590c; } .tc-bg-gold { background: #b7791f; } .tc-bg-green { background: #2f9e44; }
.tc-bg-teal { background: #0c8599; } .tc-bg-blue { background: #1c7ed6; } .tc-bg-purple { background: #7048e8; } .tc-bg-pink { background: #d6336c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tc-red { color: #ff8787; } :root:not([data-theme="light"]) .tc-orange { color: #ffa94d; }
  :root:not([data-theme="light"]) .tc-gold { color: #ffd43b; } :root:not([data-theme="light"]) .tc-green { color: #69db7c; }
  :root:not([data-theme="light"]) .tc-teal { color: #66d9e8; } :root:not([data-theme="light"]) .tc-blue { color: #74c0fc; }
  :root:not([data-theme="light"]) .tc-purple { color: #b197fc; } :root:not([data-theme="light"]) .tc-pink { color: #faa2c1; }
}
:root[data-theme="dark"] .tc-red { color: #ff8787; } :root[data-theme="dark"] .tc-orange { color: #ffa94d; }
:root[data-theme="dark"] .tc-gold { color: #ffd43b; } :root[data-theme="dark"] .tc-green { color: #69db7c; }
:root[data-theme="dark"] .tc-teal { color: #66d9e8; } :root[data-theme="dark"] .tc-blue { color: #74c0fc; }
:root[data-theme="dark"] .tc-purple { color: #b197fc; } :root[data-theme="dark"] .tc-pink { color: #faa2c1; }

/* The editor */
.rte { position: relative; border: 1px solid var(--input); border-radius: var(--radius); background: var(--bg); }
.rte:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--secondary); border-radius: var(--radius) var(--radius) 0 0; }
.rte-btn { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--fg); font-size: 14px; font-weight: 700; line-height: 1; }
.rte-btn:hover, .rte-btn[aria-expanded="true"] { background: var(--bg); box-shadow: var(--shadow-sm); }
.rte-btn .icon { width: 16px; height: 16px; }
[dir="rtl"] .rte-btn[data-cmd="justifyStart"] .icon { transform: scaleX(-1); }
.rte-sep { width: 1px; height: 20px; margin-inline: 4px; background: var(--border); }
.rte-color-a { padding-bottom: 1px; border-bottom: 3px solid; border-image: linear-gradient(90deg, #e03131, #f5b01c, #2f9e44, #1c7ed6, #7048e8) 1; }
.rte-panel { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--bg-raised); }
.rte-panel[hidden] { display: none; }
.rte-swatch { width: 28px; height: 28px; border: 2px solid var(--bg); border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.rte-swatch:hover { transform: scale(1.1); }
.rte-swatch-reset { width: auto; font-size: 12px; font-weight: 600; }
.rte-emoji { max-height: 180px; overflow-y: auto; }
.rte-emoji button { width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm); background: transparent; font-size: 20px; line-height: 1; }
.rte-emoji button:hover { background: var(--secondary); }
.rte-area { min-height: 180px; max-height: 480px; overflow-y: auto; padding: 12px 14px; outline: none; font-size: 15px; }
.rte-area:empty::before { content: attr(aria-label); color: var(--subtle); }
.rte textarea { border: 0; border-radius: 0 0 var(--radius) var(--radius); }

/* Book photos and videos */
.gallery { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.gallery-item { flex-shrink: 0; height: 240px; scroll-snap-align: start; border-radius: var(--radius); overflow: hidden; background: var(--secondary); border: 1px solid var(--border); }
.gallery-item img { height: 100%; width: auto; max-width: 420px; object-fit: cover; transition: transform .3s var(--ease); }
a.gallery-item:hover img { transform: scale(1.03); }
.gallery-item.is-video { aspect-ratio: 16/9; background: #000; }
.gallery-item video { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 640px) { .gallery-item { height: 190px; } .gallery-item img { max-width: 300px; } }
.lightbox { width: min(96vw, 1100px); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius-lg); background: #0b1120; overflow: hidden; }
.lightbox::backdrop { background: rgb(2 6 23 / 85%); }
.lightbox img { display: block; width: 100%; max-height: 94vh; object-fit: contain; }
.lightbox-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(15 23 42 / 70%); color: #fff; }
.lightbox-btn:hover { background: var(--primary); }
.lightbox-btn .icon { width: 22px; height: 22px; }
.lightbox-btn.close { top: 10px; inset-inline-end: 10px; }
.lightbox-btn.prev, .lightbox-btn.next { top: 50%; transform: translateY(-50%); }
.lightbox-btn.prev { inset-inline-start: 10px; }
.lightbox-btn.next { inset-inline-end: 10px; }
.lightbox-btn[hidden] { display: none; }

/* Admin: managing photos and videos */
.media-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.media-admin li { position: relative; display: grid; gap: 6px; }
.media-admin img, .media-admin video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--secondary); }
.media-kind { position: absolute; top: 6px; inset-inline-start: 6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgb(15 23 42 / 70%); color: #fff; }
.media-kind .icon { width: 14px; height: 14px; }
.media-tools { display: flex; justify-content: center; gap: 4px; }

/* Stars and reviews */
.stars { display: inline-flex; gap: 1px; line-height: 1; font-size: 15px; }
.stars .star { color: var(--border); }
.stars .star.on { color: var(--sun); }
.rating-link { display: inline-flex; align-items: center; gap: 6px; }
.rating-link:hover span:last-child { color: var(--fg); }
.rating-summary { display: inline-flex; align-items: center; gap: 8px; }
.rating-summary .stars { font-size: 18px; }
.review-list { display: grid; gap: 12px; }
.review { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.review .badge { gap: 3px; }
.review .badge .icon { width: 12px; height: 12px; }
.review-form { max-width: 720px; }
.review-body { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--secondary); overflow-wrap: anywhere; }
.review-card { padding: 16px 18px; }
/* Star picker: the radios come 5…1 and row-reverse shows them 1…5 from the reading start (in
   both directions), so ":checked ~ label" lights the chosen star and the ones before it. */
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-input legend { margin-bottom: 4px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 30px; line-height: 1; color: var(--border); cursor: pointer; transition: color .1s, transform .1s; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--sun); }
.star-input label:hover { transform: scale(1.12); }
.star-input input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* Package offers */
.bundle-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.bundle-card { position: relative; display: grid; gap: 14px; padding: 18px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.bundle-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--ring); }
.bundle-card:hover h3 { color: var(--primary-text); }
.bundle-card .sale-badge { top: 14px; inset-inline-end: 14px; }
.bundle-card-text { display: grid; gap: 6px; justify-items: start; }
.bundle-card-text h3 { font-size: 16px; font-weight: 800; line-height: 1.4; transition: color .15s; }
.bundle-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--primary-text); }
.bundle-kicker .icon { width: 14px; height: 14px; }
.bundle-art { position: relative; display: grid; place-items: center; aspect-ratio: 4/3; border-radius: var(--radius); background: linear-gradient(160deg, var(--primary-soft), var(--accent-soft)); overflow: hidden; }
.bundle-art > img { width: 100%; height: 100%; object-fit: cover; }
.bundle-art.stacked .cover { position: absolute; width: 38%; transition: transform .3s var(--ease); }
.bundle-art.stacked.n1 .cover { width: 42%; }
.bundle-art.stacked.n2 .cover:nth-child(1) { transform: translateX(-28%) rotate(-7deg); }
.bundle-art.stacked.n2 .cover:nth-child(2) { transform: translateX(28%) rotate(6deg); }
.bundle-art.stacked.n3 .cover:nth-child(1) { transform: translateX(-52%) rotate(-10deg) scale(.9); }
.bundle-art.stacked.n3 .cover:nth-child(2) { z-index: 2; }
.bundle-art.stacked.n3 .cover:nth-child(3) { transform: translateX(52%) rotate(9deg) scale(.9); }
.bundle-card:hover .bundle-art.stacked.n3 .cover:nth-child(1) { transform: translateX(-60%) rotate(-13deg) scale(.9); }
.bundle-card:hover .bundle-art.stacked.n3 .cover:nth-child(3) { transform: translateX(60%) rotate(12deg) scale(.9); }
.bundle-art.lg { aspect-ratio: 3/4; box-shadow: var(--shadow-md); }
.bundle-art.lg.stacked .cover { width: 46%; }
.bundle-detail .eyebrow { justify-self: start; }
.bundle-promo { display: flex; align-items: center; gap: 12px; max-width: 620px; padding: 14px 16px; border: 1px dashed var(--primary); border-radius: var(--radius-lg); background: var(--primary-soft); transition: background .15s, transform .15s var(--ease); }
.bundle-promo:hover { background: color-mix(in srgb, var(--primary-soft) 60%, var(--bg)); transform: translateY(-1px); }
.bundle-promo-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--primary); color: #fff; }
.bundle-promo-icon .icon { width: 20px; height: 20px; }
.bundle-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); font-size: 14px; }
.bundle-line .icon { color: var(--primary-text); }
.narrow-text { max-width: 760px; }
.pick-list { display: grid; gap: 4px; max-height: 520px; overflow-y: auto; padding: 2px; }
.pick-list li[hidden] { display: none; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); cursor: pointer; transition: background .12s, border-color .12s; }
.pick:hover { background: var(--secondary); }
.pick:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* Sharing */
.share-menu .menu-panel { width: 220px; }
.share-menu > summary { list-style: none; }
.share-menu > summary::-webkit-details-marker { display: none; }

/* Order statuses added later: refunded and gift */
.status-refunded { background: var(--danger-soft); color: var(--danger-text); }
.status-gift { background: var(--accent-soft); color: var(--accent-text); }
.thanks-preview { margin: 0; padding: 12px 14px; border-inline-start: 4px solid var(--teal); border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.check.align-start { align-items: flex-start; }
.check.align-start input { margin-top: 3px; }

/* PDF reader */
.pdf-view { position: absolute; inset: 0; overflow: auto; scrollbar-gutter: stable; background: #525659; -webkit-overflow-scrolling: touch; }
.pdf-pages { display: grid; justify-items: center; gap: 12px; padding: 12px 8px 40px; min-width: min-content; }
.pdf-page { background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / 35%); max-width: none; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-status { position: absolute; top: 40%; inset-inline: 0; text-align: center; color: #fff; font-weight: 600; }
.pdf-view iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Activity books: drawing on PDF pages (pen, marker, line, eraser, stickers), "I finished!" and a framed picture */
.pdf-page { position: relative; }
.pdf-page canvas.pdf-ink { position: absolute; inset: 0; pointer-events: none; }
.pdf-view.is-drawing .pdf-ink { pointer-events: auto; touch-action: none; cursor: crosshair; }
.pdf-page.is-done { outline: 4px solid #22c55e; outline-offset: 3px; }
.pdf-page.is-done::after { content: "⭐"; position: absolute; top: -18px; inset-inline-end: -14px; font-size: 38px; line-height: 1; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 35%)); pointer-events: none; }
.pdf-view.has-ink .pdf-pages { padding-bottom: 170px; }
.ink-dock { position: absolute; inset-inline: 8px; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 5; }
.ink-dock[hidden], .ink-tray[hidden] { display: none; }
.ink-bar, .ink-tray { pointer-events: auto; display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px; background: #fff; color: #1e293b; border-radius: 30px; box-shadow: 0 6px 22px rgb(0 0 0 / 35%); }
.ink-tray { flex-wrap: wrap; justify-content: center; border-radius: 22px; }
.ink-tools { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ink-tools::-webkit-scrollbar { display: none; }
.ink-tool, .ink-nav, .ink-sticker { flex-shrink: 0; display: inline-grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: #f1f5f9; font-size: 24px; line-height: 1; transition: transform .12s, background .12s; }
.ink-tool:active, .ink-sticker:active, .ink-nav:active, .ink-done:active { transform: scale(.9); }
.ink-tool[aria-pressed="true"], .ink-sticker[aria-pressed="true"] { background: #fde68a; box-shadow: inset 0 0 0 3px var(--sun); }
.ink-nav { background: var(--navy); color: #fff; }
.ink-nav .icon { width: 26px; height: 26px; }
.ink-nav:disabled { opacity: .35; }
.ink-sep { flex-shrink: 0; width: 2px; height: 30px; margin: 0 2px; background: #e2e8f0; border-radius: 2px; }
.ink-done { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px; border: 0; border-radius: 23px; background: linear-gradient(135deg, #facc15, #fb923c); color: #1e293b; font-size: 17px; font-weight: 800; box-shadow: 0 3px 0 #c2410c; transition: transform .12s; white-space: nowrap; }
.ink-colour { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px #cbd5e1; }
.ink-colour[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--navy); transform: scale(1.1); }
.ink-size { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f5f9; }
.ink-size span { width: var(--s); height: var(--s); border-radius: 50%; background: #1e293b; }
.ink-size[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--sun); background: #fde68a; }
.ink-sticker { width: 44px; height: 44px; font-size: 26px; }
.ink-dock:not([hidden]) ~ .watermark { bottom: 76px; }
/* Phones: every tool on its own row (nothing hidden off the side), then ◀ I finished! ▶ */
@media (max-width: 560px) {
  .ink-bar { flex-wrap: wrap; justify-content: space-between; border-radius: 24px; }
  .ink-tools { order: -1; flex-basis: 100%; justify-content: center; gap: 3px; overflow: visible; }
  .ink-tools .ink-sep { display: none; }
  .ink-tool { width: 35px; height: 35px; font-size: 19px; }
  .ink-nav { width: 44px; height: 44px; }
  .ink-done { flex: 1; justify-content: center; }
  .ink-colour, .ink-size { width: 30px; height: 30px; }
  .ink-sticker { width: 38px; height: 38px; font-size: 22px; }
  .pdf-view.has-ink .pdf-pages { padding-bottom: 230px; }
  .ink-dock:not([hidden]) ~ .watermark { bottom: 124px; }
}
.ink-party { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgb(15 23 42 / 45%); animation: ink-fade .2s ease-out; }
.ink-party canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.ink-party-card { position: relative; width: min(100%, 360px); padding: 26px 22px 22px; border-radius: 28px; background: #fff; color: #1e293b; text-align: center; box-shadow: 0 20px 50px rgb(0 0 0 / 35%); animation: ink-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.ink-party-star { font-size: 78px; line-height: 1; animation: ink-bounce 1s ease-in-out infinite alternate; }
.ink-party-card h2 { margin: 10px 0 4px; font-size: 32px; font-weight: 900; color: #f97316; }
.ink-party-card p { margin: 0 0 18px; font-size: 17px; font-weight: 600; color: #475569; }
.ink-party-actions { display: grid; gap: 10px; }
.ink-party-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border: 0; border-radius: 25px; background: #f1f5f9; color: #1e293b; font-size: 17px; font-weight: 800; }
.ink-party-btn.is-main { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; box-shadow: 0 3px 0 #15803d; }
.ink-shot-card { width: min(100%, 520px); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.ink-shot-img { display: block; min-height: 0; max-height: 58vh; width: 100%; object-fit: contain; border-radius: 14px; }
.ink-shot-img:not([src]) { height: 40vh; background: #f1f5f9; }
.ink-shot-frames { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ink-shot-frame { width: 46px; height: 46px; border: 3px solid #fff; border-radius: 50%; font-size: 22px; line-height: 1; box-shadow: 0 0 0 1px #cbd5e1; transition: transform .12s; }
.ink-shot-frame[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--sun); transform: scale(1.12); }
.ink-shot-actions { grid-template-columns: 2fr 1fr; }
.ink-party-btn:disabled { opacity: .6; }
@media (max-width: 560px) { .ink-shot-img { max-height: 48vh; } .ink-shot-frame { width: 40px; height: 40px; font-size: 19px; } }
@keyframes ink-fade { from { opacity: 0; } }
@keyframes ink-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes ink-bounce { to { transform: translateY(-10px) rotate(8deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .ink-party, .ink-party-card, .ink-party-star { animation: none; } }
.reader-page { font-size: 13px; font-weight: 700; padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Cart */
.cart-layout { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: 1fr 22rem; } .cart-summary { position: sticky; top: 88px; } }
.cart-list { display: grid; gap: 12px; }
.cart-item { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.cart-item .thumb { width: 64px; }
.icon-btn.active { background: var(--primary-soft); color: var(--primary-text); }
.btn.in-cart { color: var(--success-text); border-color: var(--success); }

/* Recommendations: book cards with an Add to cart button under each */
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 18px; }
@media (min-width: 640px) { .rec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .rec-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.rec-item { display: grid; gap: 10px; align-content: space-between; }

/* Subscription */
.sub-badge { display: inline-flex; align-items: center; gap: 4px; justify-self: start; width: fit-content; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--sun-soft); color: var(--sun-text); font-size: 11px; font-weight: 800; }
.sub-badge .icon { width: 12px; height: 12px; }
.credit-badge { display: inline-flex; align-items: center; gap: 4px; justify-self: start; width: fit-content; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 800; }
.credit-badge .icon { width: 12px; height: 12px; }
.menu-credits .credit-badge { font-size: 12px; }
.kiddo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kiddo-stat { display: grid; align-content: start; gap: 2px; padding: 12px 16px; border-radius: var(--radius); background: var(--border-soft); }
.kiddo-stat strong { font-size: 22px; font-weight: 800; }
.credits-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--accent-soft); }
.credits-strip-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--bg); color: var(--accent-text); }
.credit-total { display: grid; gap: 2px; min-width: 160px; padding: 12px 16px; border-radius: var(--radius); background: var(--accent-soft); }
.credit-total strong { font-size: 24px; font-weight: 800; color: var(--accent-text); }
.sub-note, .sub-note .icon { color: var(--sun-text); }
.sub-promo { border-color: var(--sun); background: var(--sun-soft); }
.sub-promo .bundle-promo-icon { background: var(--sun); color: var(--navy); }
.sub-status { align-items: center; }
.plan-thumb { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: var(--radius-sm); background: var(--sun-soft); color: var(--sun-text); }
.plan-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.plan-card.is-best { border: 2px solid var(--sun); box-shadow: var(--shadow-md); }
.plan-flag { position: absolute; top: -12px; inset-inline-start: 20px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--sun); color: var(--navy); font-size: 12px; font-weight: 800; }
.plan-flag .icon { width: 13px; height: 13px; }
.plan-name { font-size: 18px; font-weight: 800; }
.plan-price strong { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.plan-desc { color: var(--muted); }
.plan-points { display: grid; gap: 6px; margin-block: 4px 8px; }
.plan-points li { display: flex; align-items: flex-start; gap: 8px; }
.plan-points .icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 2px; color: var(--success); stroke-width: 3; }
.plan-action { margin-top: auto; }
.btn.block { width: 100%; justify-content: center; }
.how-steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.how-steps li { display: flex; gap: 12px; align-items: flex-start; }
.how-no { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--sun-soft); color: var(--sun-text); font-weight: 800; }

/* Subscription offers and book access period */
.access-term { display: flex; align-items: center; gap: 8px; width: fit-content; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 700; }
.access-term .icon { width: 16px; height: 16px; flex-shrink: 0; }
.credit-price { display: flex; align-items: center; gap: 8px; width: fit-content; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary-text); font-size: 13px; font-weight: 700; }
.credit-price .icon { width: 16px; height: 16px; flex-shrink: 0; }
.confirm-dialog { width: min(92vw, 420px); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); color: var(--fg); box-shadow: var(--shadow-md); }
.confirm-dialog::backdrop { background: rgb(2 6 23 / 60%); }
.confirm-dialog-head { display: flex; align-items: center; gap: 12px; }
.confirm-dialog-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.confirm-dialog-sum { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; padding: 12px 16px; border-radius: var(--radius); background: var(--border-soft); font-size: 14px; }
.confirm-dialog-sum dd { margin: 0; text-align: end; }
.owned-note.ending, .owned-note.ending .icon { color: var(--sun-text); }
.sub-offer { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 14px 16px; padding: 18px 20px; border: 2px solid var(--sun); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--sun-soft), var(--primary-soft)); box-shadow: var(--shadow-md); max-width: 760px; }
.sub-offer-icon { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; background: var(--sun); color: var(--navy); }
.sub-offer-icon .icon { width: 24px; height: 24px; }
.sub-offer-body { flex: 1 1 240px; display: grid; gap: 4px; }
.sub-offer-title { font-size: 17px; font-weight: 800; }
.sub-offer-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.sub-offer-meta .plan-price strong { font-size: 20px; }
.sub-offer-worth { font-size: 12px; font-weight: 700; color: var(--success-text); }
.sub-offer-btn { background: var(--navy); color: #fff; }
.sub-offer-btn:hover { background: var(--navy); filter: brightness(1.25); }
.sub-offer-flag { position: absolute; top: -12px; inset-inline-end: 16px; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; box-shadow: var(--shadow-md); }
.plans-hero { padding-block: 44px 36px; background: radial-gradient(120% 140% at 0% 0%, var(--sun-soft), transparent 60%), radial-gradient(120% 140% at 100% 0%, var(--primary-soft), transparent 55%), var(--page, var(--bg)); border-bottom: 1px solid var(--border-soft); }
.plans-hero .eyebrow { justify-self: start; width: fit-content; }
.plans-hero-title { font-size: clamp(28px, 5vw, 44px); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; max-width: 20ch; }
.plans-hero .lead { color: var(--muted); max-width: 60ch; }
.plans-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.plans-stats li { display: grid; gap: 2px; min-width: 120px; padding: 12px 16px; border-radius: var(--radius); background: var(--bg-raised); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.plans-stats strong { font-size: 22px; font-weight: 800; color: var(--primary-text); }
.plans-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-off { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; }
.plan-price s { font-size: 15px; }
.plan-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }
.plan-saving { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--success-soft); color: var(--success-text); font-size: 13px; font-weight: 800; }
.plan-saving .icon { width: 14px; height: 14px; }
.billing-toggle { display: flex; width: fit-content; max-width: 100%; margin-inline: auto; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-raised); box-shadow: var(--shadow-sm); }
.billing-toggle button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 18px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.billing-toggle button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); }
.billing-save { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--success-soft); color: var(--success-text); font-size: 12px; font-weight: 800; }
[data-billing="yearly"] [data-only="monthly"], [data-billing="monthly"] [data-only="yearly"] { display: none; }
.compare-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.compare-col .card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.compare-col.is-sub { border: 2px solid var(--sun); background: var(--sun-soft); }

/* Kiddo Puzzle promo (home) and the admin key/value list */
/* صمملي (Creator) on the home page: its own look, in the brand's coral → sun. */
.kiddo-promo { position: relative; overflow: hidden; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  background: radial-gradient(circle at 0% 0%, var(--sun-soft), transparent 55%), radial-gradient(circle at 100% 100%, var(--primary-soft), transparent 55%), var(--bg-raised); }
.kiddo-promo::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--coral), var(--sun), var(--teal)); }
.kiddo-promo-art { position: relative; display: block; aspect-ratio: 5 / 4; isolation: isolate; }
.kp-glow { position: absolute; inset: 12% 10%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgb(245 176 28 / 35%), rgb(255 107 107 / 20%) 45%, transparent 70%); filter: blur(8px); }
.kp-sheet { position: absolute; width: 58%; aspect-ratio: 4 / 3; padding: 6px; border-radius: 14px; background: #fff; box-shadow: 0 10px 28px -10px rgb(15 23 42 / 45%); transition: transform .45s var(--ease); }
.kp-sheet img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.kp-sheet-1 { inset-inline-start: 2%; top: 6%; transform: rotate(-12deg); }
.kp-sheet-2 { inset-inline-end: 2%; top: 4%; transform: rotate(10deg); }
.kp-sheet-3 { inset-inline-start: 6%; bottom: 4%; transform: rotate(-4deg); }
.kp-sheet-4 { inset-inline-end: 6%; bottom: 8%; transform: rotate(6deg); z-index: 2; }
.kiddo-promo-art:hover .kp-sheet-1 { transform: rotate(-16deg) translate(-6px, -6px); }
.kiddo-promo-art:hover .kp-sheet-2 { transform: rotate(14deg) translate(6px, -6px); }
.kiddo-promo-art:hover .kp-sheet-3 { transform: rotate(-7deg) translate(-4px, 6px); }
.kiddo-promo-art:hover .kp-sheet-4 { transform: rotate(3deg) scale(1.04); }
.kp-sticker { position: absolute; z-index: 3; top: 38%; inset-inline-start: 40%; display: grid; place-items: center; align-content: center; width: 78px; height: 78px; border-radius: 50%; color: #fff; text-align: center; line-height: 1.1;
  background: linear-gradient(135deg, var(--coral), var(--sun)); box-shadow: 0 8px 20px -6px rgb(255 107 107 / 70%); transform: rotate(-8deg); border: 3px solid #fff; }
.kp-sticker strong { font-size: 24px; font-weight: 800; }
.kp-sticker small { font-size: 11px; font-weight: 700; }
.kp-piece { position: absolute; z-index: 4; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; box-shadow: var(--shadow-md); animation: kp-float 5s ease-in-out infinite; }
.kp-piece .icon { width: 20px; height: 20px; }
.kp-piece-1 { top: -2%; inset-inline-start: 44%; background: var(--teal); }
.kp-piece-2 { bottom: 0; inset-inline-start: 0; background: var(--coral); animation-delay: -1.6s; }
.kp-piece-3 { top: 52%; inset-inline-end: -1%; background: var(--sun); animation-delay: -3.2s; }
@keyframes kp-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .kp-piece { animation: none; } .kp-sheet { transition: none; } }
.kp-brand { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: var(--radius-pill); color: #fff; font-size: 14px; font-weight: 800; background: linear-gradient(135deg, var(--coral), var(--sun)); box-shadow: 0 4px 14px -4px rgb(255 107 107 / 60%); }
.kp-brand .icon { width: 16px; height: 16px; }
.kp-balance .icon { width: 16px; height: 16px; }
/* The Kiddo icon's dark quarter follows the text colour, so it stays visible in dark mode (like the white logo). */
.icon .kiddo-ink { fill: var(--fg); }
.nav-creator .icon-kiddo .kq, .kp-brand .icon-kiddo .kq, .kp-piece .icon-kiddo .kq,
.btn:not(.btn-outline):not(.btn-ghost):not(.btn-secondary) .icon-kiddo .kq { fill: #fff; }
.kp-balance { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 800; }
.kp-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.kp-chip { padding: 4px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; background: var(--tone-soft); color: var(--tone-text); }
@media (max-width: 720px) { .kiddo-promo { grid-template-columns: 1fr; padding: 22px; } .kiddo-promo-art { max-width: 420px; width: 100%; justify-self: center; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ── Floating WhatsApp button (site pages, when a contact phone is set) ── */
.wa-float { position: fixed; z-index: 60; bottom: max(18px, env(safe-area-inset-bottom)); inset-inline-end: max(18px, env(safe-area-inset-right)); display: inline-flex; align-items: center; gap: 0; height: 56px; padding: 0; border-radius: 999px; background: #25d366; color: #fff; box-shadow: 0 10px 26px rgb(37 211 102 / 38%), 0 2px 6px rgb(0 0 0 / 15%); text-decoration: none; transition: transform .15s, box-shadow .15s, padding .2s; animation: wa-pop .5s cubic-bezier(.2, .9, .3, 1.3) both; }
.wa-float svg { width: 30px; height: 30px; margin: 13px; flex-shrink: 0; }
.wa-float-label { max-width: 0; overflow: hidden; white-space: nowrap; font-size: 14px; font-weight: 700; transition: max-width .25s, padding .25s; }
.wa-float:hover, .wa-float:focus-visible { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgb(37 211 102 / 45%), 0 3px 8px rgb(0 0 0 / 18%); }
.wa-float:hover .wa-float-label, .wa-float:focus-visible .wa-float-label { max-width: 240px; padding-inline-end: 20px; }
@keyframes wa-pop { from { opacity: 0; transform: scale(.6); } }
@media (max-width: 720px) { .wa-float { height: 52px; } .wa-float svg { width: 28px; height: 28px; margin: 12px; } }
@media (prefers-reduced-motion: reduce) { .wa-float { animation: none; transition: none; } }
@media print { .wa-float { display: none; } }
.qr-image { width: 168px; height: 168px; flex-shrink: 0; padding: 6px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); }
