/* com_tasi3abooks — مكتبة تاسعة. A dark "holo-library" inside the tasi3a template. Everything is scoped under .tb */

@font-face { font-family: "Changa"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/changa-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Changa"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/changa-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Changa"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/changa-arabic-800-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Changa"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/changa-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Changa"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/changa-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Changa"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/changa-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* the template wraps components in a white notebook sheet: the library draws its own */
.tsa-component.tsa-sheet:has(> .tb) { padding: 0; background: none; border: 0; box-shadow: none; }
.tsa-component.tsa-sheet:has(> .tb)::before { display: none; }
.tsa-component.tsa-sheet .tb :is(h1, h2, h3, h4), :is(.tb, .tb-portal) :is(h1, h2, h3, h4) { display: block; background: none; box-decoration-break: slice; -webkit-box-decoration-break: slice; margin: 0; }
:is(.tb, .tb-portal) [hidden] { display: none !important; }

.tb, .tb-portal {
  --bg0: #050816;
  --bg1: #0a1033;
  --bg2: #121c52;
  --ink: #eef2ff;
  --ink2: #c4cdf2;
  --muted: #8f9bcc;
  --gold: #ffc83d;
  --blue: #3d7bff;
  --cyan: #38e1ff;
  --red: #ff4d5a;
  --line: rgba(140, 165, 255, .18);
  --glass: rgba(255, 255, 255, .055);
  --accent: var(--gold);
  --r: 26px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color: var(--ink);
  font-family: Changa, Tajawal, Tahoma, Arial, sans-serif;
  line-height: 1.7;
}
.tb {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(61, 123, 255, .22), transparent 60%),
    radial-gradient(900px 600px at 0% 40%, rgba(255, 200, 61, .08), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 55%, #070b24);
  border-radius: 30px;
  overflow: clip;
  font-family: Changa, Tajawal, Tahoma, Arial, sans-serif;
  line-height: 1.7;
  isolation: isolate;
}
:is(.tb, .tb-portal) *, :is(.tb, .tb-portal) *::before, :is(.tb, .tb-portal) *::after { box-sizing: border-box; }
:is(.tb, .tb-portal) a { color: inherit; }
:is(.tb, .tb-portal) img { max-width: none; border-radius: 0; }
:is(.tb, .tb-portal) svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:is(.tb, .tb-portal) :focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; border-radius: 10px; }
:is(.tb, .tb-portal) button { font-family: inherit; }

/* ------------------------------------------------------------------ buttons */
.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 10px 26px; border-radius: 60px; border: 1px solid transparent;
  font: 800 16px/1.2 Changa, Tahoma, sans-serif; cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), box-shadow .25s, background .25s, border-color .25s; }
.tb-btn:hover { transform: translateY(-2px); }
.tb-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.tb-btn.is-neon { color: #0b1030; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset, 0 8px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.tb-btn.is-neon:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset, 0 10px 44px color-mix(in srgb, var(--accent) 70%, transparent); }
.tb-btn.is-ghost { color: var(--ink); background: var(--glass); border-color: var(--line); backdrop-filter: blur(8px); }
.tb-btn.is-ghost:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.tb-btn.is-wide { width: 100%; }
.tb-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 16, 51, .7); color: var(--ink); cursor: pointer; transition: .2s; backdrop-filter: blur(8px); }
.tb-ic:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(56, 225, 255, .4); }

/* ------------------------------------------------------------------ hero */
.tb-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: clamp(20px, 4vw, 56px);
  min-height: min(760px, 92vh); padding: clamp(36px, 6vw, 80px) clamp(18px, 5vw, 64px) clamp(56px, 7vw, 90px); }
.tb-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.tb-aurora { position: absolute; inset: -20% -10% auto; height: 70%; z-index: -1; pointer-events: none; filter: blur(60px); opacity: .55;
  background: conic-gradient(from 200deg at 50% 50%, rgba(61,123,255,.0), rgba(61,123,255,.45), rgba(56,225,255,.25), rgba(255,200,61,.25), rgba(61,123,255,0));
  animation: tb-aurora 18s linear infinite; }
@keyframes tb-aurora { to { transform: rotate(360deg); } }
.tb-floor { position: absolute; inset: auto -40% -6% -40%; height: 46%; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(56,225,255,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(61,123,255,.28) 1px, transparent 1px);
  background-size: 64px 64px; transform: perspective(520px) rotateX(72deg); transform-origin: top;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
  animation: tb-floor 7s linear infinite; }
@keyframes tb-floor { to { background-position: 0 64px, 0 0; } }

.tb-hero-text { position: relative; z-index: 2; }
.tb-chip { display: inline-flex; align-items: center; gap: 9px; padding: 6px 16px; border-radius: 40px; border: 1px solid rgba(56,225,255,.4);
  background: rgba(56,225,255,.08); color: var(--cyan); font-weight: 600; font-size: 14px; }
.tb-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: tb-pulse 1.6s infinite; }
@keyframes tb-pulse { 50% { opacity: .25; } }
.tb-hero h1 { font-size: clamp(42px, 6.6vw, 84px); line-height: 1.12; font-weight: 800; color: var(--ink); margin: 18px 0 12px; letter-spacing: -.5px; }
.tb-grad { background: linear-gradient(100deg, var(--gold), #fff3c4 35%, var(--cyan) 70%, var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 200, 61, .35)); }
.tb-lead { color: var(--ink2); font-size: clamp(16px, 1.6vw, 19px); max-width: 520px; margin: 0; }
.tb-kpis { display: flex; gap: 12px; list-style: none; margin: 24px 0 0; padding: 0; flex-wrap: wrap; }
.tb-kpis li { min-width: 92px; padding: 10px 16px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); text-align: center; backdrop-filter: blur(10px); }
.tb-kpis b { display: block; font-size: 26px; line-height: 1.1; font-weight: 800; color: var(--gold); text-shadow: 0 0 18px rgba(255, 200, 61, .45); direction: ltr; }
.tb-kpis span { font-size: 13px; color: var(--muted); }
.tb-now { margin-top: 24px; padding: 14px 18px; max-width: 460px; border-radius: 16px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  border-inline-start: 3px solid var(--accent); transition: border-color .6s; }
.tb-now small { display: block; color: var(--muted); font-size: 12px; letter-spacing: .5px; }
.tb-now strong { display: block; font-size: 22px; font-weight: 800; transition: opacity .35s; }
.tb-now span { display: block; color: var(--ink2); font-size: 14px; transition: opacity .35s; }
.tb-now.is-swap :is(strong, span) { opacity: 0; }
.tb-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* the flipping book */
.tb-holo { position: relative; z-index: 2; display: grid; justify-items: center; gap: 22px; }
.tb-flip-box { position: relative; width: min(620px, 100%); aspect-ratio: 600 / 424; display: grid; place-items: center; transition: opacity .5s, transform .5s var(--ease);
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.55)) drop-shadow(0 0 36px color-mix(in srgb, var(--accent) 35%, transparent)); }
.tb-flip-box.is-out { opacity: 0; transform: translateY(14px) scale(.97); }
.tb-flip-fallback { height: 100%; width: auto; max-width: 50%; object-fit: contain; border-radius: 4px; }
.tb-mirror { width: 100%; height: 100%; transform: scaleX(-1); }          /* StPageFlip turns pages like a French book: mirrored = an Arabic book */
.tb-mirror .tb-flip { width: 100%; height: 100%; }
.tb-pg { background: #fff; overflow: hidden; }
.tb-pg img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); user-select: none; -webkit-user-drag: none; }
.tb-pg.is-back { background: linear-gradient(150deg, var(--bg2), var(--bg0)); }
.tb-pg.is-back .tb-back { transform: scaleX(-1); height: 100%; display: grid; place-content: center; gap: 6px; text-align: center; color: #fff; padding: 12%; direction: rtl; }
.tb-back b { font-size: clamp(16px, 2.2vw, 26px); font-weight: 800; color: var(--accent); text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent); }
.tb-back span { font-size: clamp(11px, 1.2vw, 14px); color: var(--ink2); }
.tb-back i { font-style: normal; direction: ltr; font-size: clamp(11px, 1.1vw, 13px); color: var(--muted); }
.tb-ring { position: absolute; left: 8%; right: 8%; bottom: 40px; height: 120px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transform: rotateX(76deg); pointer-events: none; box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 0 40px color-mix(in srgb, var(--accent) 20%, transparent); }
.tb-ring.r1 { animation: tb-ring 6s ease-in-out infinite; }
.tb-ring.r2 { left: 20%; right: 20%; bottom: 52px; height: 80px; border-color: rgba(56,225,255,.35); animation: tb-ring 6s ease-in-out -3s infinite; }
@keyframes tb-ring { 50% { transform: rotateX(76deg) scale(1.06); opacity: .6; } }
.tb-beam { position: absolute; bottom: 58px; width: 60%; height: 26px; border-radius: 50%; background: radial-gradient(color-mix(in srgb, var(--accent) 60%, transparent), transparent 70%); filter: blur(10px); pointer-events: none; }
.tb-holo-ctrl { display: flex; align-items: center; gap: 14px; position: relative; z-index: 3; }
.tb-ban-dots { display: flex; gap: 7px; }
.tb-ban-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 9px; background: #2a3470; cursor: pointer; transition: width .35s var(--ease), background .35s; }
.tb-ban-dots button.on { width: 30px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* ------------------------------------------------------------------ showcase */
.tb-shelf { scroll-margin-top: 90px; position: relative; padding: clamp(40px, 6vw, 80px) clamp(14px, 4vw, 48px) clamp(40px, 6vw, 70px);
  background: radial-gradient(800px 380px at 50% 46%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); transition: background .8s; }
.tb-head { text-align: center; max-width: 640px; margin: 0 auto 22px; }
.tb-over { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: 1px; color: var(--cyan); }
.tb-head h2 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 800; color: var(--ink); line-height: 1.25; }
.tb-head p { color: var(--muted); margin: 6px 0 0; }
.tb-filters { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 0 auto 10px; }
.tb-filters button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 18px; border-radius: 40px; border: 1px solid var(--line);
  background: var(--glass); color: var(--ink2); font-weight: 600; font-size: 15px; cursor: pointer; transition: .25s; }
.tb-filters button small { min-width: 22px; padding: 0 6px; border-radius: 10px; background: rgba(255,255,255,.1); font-size: 12px; }
.tb-filters button:hover { border-color: rgba(56,225,255,.6); color: var(--ink); }
.tb-filters button.on { background: var(--cyan); border-color: var(--cyan); color: #04122a; box-shadow: 0 0 22px rgba(56,225,255,.45); }
.tb-filters button.on small { background: rgba(4,18,42,.15); }

.tb-stage-wrap { position: relative; }
.tb-stage { position: relative; height: clamp(360px, 46vw, 500px); perspective: 1400px; touch-action: pan-y; user-select: none; }
.tb-book { position: absolute; left: 50%; top: 18px; width: clamp(180px, 22vw, 270px); aspect-ratio: 640 / 960; margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; translate: -50% 0; transition: transform .8s var(--ease), opacity .6s, filter .6s; will-change: transform; }
.tb-book img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; display: block; pointer-events: none;
  filter: drop-shadow(0 26px 30px rgba(0,0,0,.6)); transition: filter .6s;
  -webkit-box-reflect: below 6px linear-gradient(transparent 76%, rgba(255,255,255,.16)); }
.tb-book.is-active { cursor: default; }
.tb-book.is-active img { filter: drop-shadow(0 26px 30px rgba(0,0,0,.55)) drop-shadow(0 0 34px color-mix(in srgb, var(--accent) 65%, transparent)); animation: tb-float 5s ease-in-out infinite; }
@keyframes tb-float { 50% { transform: translateY(-10px); } }
.tb-book.is-active::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -26px; height: 34px; border-radius: 50%; z-index: -1;
  background: radial-gradient(color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%); filter: blur(8px); }
.tb-book-cap { position: absolute; inset: auto 0 -64px; text-align: center; opacity: 0; transition: opacity .4s; pointer-events: none; }
.tb-book-cap b { display: block; font-size: 15px; } .tb-book-cap small { color: var(--muted); }
.tb-new { position: absolute; z-index: 2; top: 6%; left: -6px; padding: 3px 12px; border-radius: 30px; font-size: 13px; font-weight: 800; color: #0b1030; background: var(--gold);
  box-shadow: 0 0 18px rgba(255,200,61,.7); transform: rotate(-8deg); }
.tb-nav { position: absolute; top: 42%; z-index: 30; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(10,16,51,.72); color: var(--ink); cursor: pointer; backdrop-filter: blur(10px); transition: .25s; }
.tb-nav:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); }
.tb-nav:disabled { opacity: .3; cursor: default; }
.tb-nav.is-prev { right: clamp(0px, 3vw, 40px); } .tb-nav.is-next { left: clamp(0px, 3vw, 40px); }

.tb-card { position: relative; max-width: 700px; margin: 18px auto 0; padding: 26px clamp(18px, 4vw, 34px) 24px; border-radius: var(--r); text-align: center;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.025)); border: 1px solid var(--line); backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08); }
.tb-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(100deg, var(--accent), transparent 35%, transparent 65%, var(--cyan));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.tb-card-fade { transition: opacity .3s, transform .3s; }
.tb-card.is-swap .tb-card-fade { opacity: 0; transform: translateY(8px); }
.tb-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tb-tag { font-size: 13px; font-weight: 600; padding: 3px 14px; border-radius: 30px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: color-mix(in srgb, var(--accent) 70%, #fff); }
.tb-tag.is-level { background: rgba(56,225,255,.12); color: var(--cyan); }
.tb-tag:empty { display: none; }
.tb-card h3 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; line-height: 1.3; margin-top: 10px; color: var(--ink); }
.tb-sub { color: color-mix(in srgb, var(--accent) 60%, #fff); font-weight: 600; margin: 2px 0 0; }
.tb-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 14px 0 10px; padding: 0; color: var(--ink2); font-size: 15px; }
.tb-meta li { display: inline-flex; align-items: center; gap: 7px; }
.tb-meta svg { stroke: var(--cyan); width: 18px; height: 18px; }
.tb-meta b { color: var(--ink); direction: ltr; }
.tb-desc { color: var(--ink2); margin: 0 auto; max-width: 560px; }
.tb-state { display: inline-block; margin-top: 14px; padding: 6px 16px; border-radius: 30px; font-weight: 600; font-size: 14px; }
.tb-state.is-waiting { background: rgba(255,200,61,.14); color: var(--gold); }
.tb-state.is-sent { background: rgba(53,211,154,.14); color: #5ef0b8; }
.tb-state.is-refused { background: rgba(255,255,255,.08); color: var(--ink2); }
.tb-card-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.tb-dots { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.tb-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 10px; background: #2a3470; cursor: pointer; transition: width .35s var(--ease), background .35s; }
.tb-dots button.on { width: 30px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.tb-empty { text-align: center; color: var(--muted); font-size: 18px; padding: 40px 0; }

.tb-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 900px; margin: clamp(40px, 6vw, 64px) auto 0; padding: 0; list-style: none; counter-reset: s; }
.tb-steps li { position: relative; display: grid; gap: 2px; padding: 18px 18px 16px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); text-align: center; }
.tb-steps span { width: 38px; height: 38px; margin: -36px auto 6px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #0b1030;
  background: linear-gradient(135deg, var(--gold), #fff0b8); box-shadow: 0 0 20px rgba(255,200,61,.5); }
.tb-steps b { font-size: 17px; } .tb-steps small { color: var(--muted); font-size: 14px; }

/* no script: a simple grid */
.tb:not(.is-ready) .tb-stage { height: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; perspective: none; }
.tb:not(.is-ready) .tb-book { position: relative; left: auto; top: auto; translate: none; width: 200px; }
.tb:not(.is-ready) .tb-book-cap { position: static; opacity: 1; }
.tb:not(.is-ready) :is(.tb-nav, .tb-card, .tb-dots, .tb-holo-ctrl) { display: none; }

/* ------------------------------------------------------------------ modals */
.tb-modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: rgba(3, 5, 16, .78); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .3s; }
.tb-modal.is-open { opacity: 1; }
.tb-mbox, .tb-rbox { position: relative; width: min(540px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 28px clamp(18px, 4vw, 30px);
  border-radius: 26px; color: var(--ink); background: linear-gradient(160deg, #141c55, #090d2a); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 70px color-mix(in srgb, var(--accent) 25%, transparent), 0 30px 80px rgba(0,0,0,.6); transform: translateY(18px) scale(.97); transition: transform .35s var(--ease); }
.tb-modal.is-open :is(.tb-mbox, .tb-rbox) { transform: none; }
.tb-x { position: absolute; top: 14px; left: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink2); font-size: 22px; line-height: 1; cursor: pointer; }
.tb-x:hover { color: #fff; border-color: var(--accent); }
.tb-mhead { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; padding-inline-end: 34px; }
.tb-mhead img { width: 70px; height: 100px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)); }
.tb-mhead small { color: var(--muted); } .tb-mhead h4 { font-size: 22px; font-weight: 800; line-height: 1.3; } .tb-mhead span { color: color-mix(in srgb, var(--accent) 60%, #fff); font-size: 14px; }
.tb-modal label { display: block; margin: 12px 0 5px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.tb-modal label small { color: var(--muted); font-weight: 400; }
.tb-modal input, .tb-modal textarea { width: 100%; margin: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink);
  font: 400 16px/1.5 Changa, Tahoma, sans-serif; transition: border-color .2s, box-shadow .2s; box-shadow: none; }
.tb-modal input:focus, .tb-modal textarea:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,225,255,.18); }
.tb-modal input[type=email] { text-align: right; }
.tb-modal input.is-bad { border-color: var(--red); }
.tb-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); } .tb-hint a { color: var(--cyan); }
.tb-me { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.tb-me b { display: block; } .tb-me span { display: block; font-size: 13px; color: var(--muted); text-align: right; }
.tb-av { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #0b1030; background: linear-gradient(135deg, var(--cyan), var(--blue)); }
.tb-score { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tb-score span { padding: 5px 12px; border-radius: 30px; font-size: 13px; background: rgba(255,200,61,.1); color: #ffe39a; }
.tb-score b { color: var(--gold); }
.tb-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tb-info { margin: 14px 0; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; color: #bfeaff; background: rgba(56,225,255,.07); border: 1px dashed rgba(56,225,255,.35); }
.tb-err { margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: rgba(255,77,90,.12); color: #ffb3b9; font-size: 14px; }
.tb-btn.is-loading { pointer-events: none; opacity: .8; }
.tb-btn.is-loading svg { animation: tb-spin 1s linear infinite; }
@keyframes tb-spin { to { transform: rotate(360deg); } }
.tb-login { text-align: center; } .tb-login p { color: var(--ink2); } .tb-login .tb-btn { margin: 6px 4px; }
.tb-ok { text-align: center; padding: 10px 0 4px; }
.tb-check { width: 92px; height: 92px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--accent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent); animation: tb-pop .5s var(--ease); }
.tb-check svg { width: 46px; height: 46px; stroke: var(--accent); stroke-width: 3; stroke-dasharray: 30; stroke-dashoffset: 30; animation: tb-draw .6s .25s forwards; }
@keyframes tb-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes tb-draw { to { stroke-dashoffset: 0; } }
.tb-ok h4 { font-size: 26px; font-weight: 800; } .tb-ok p { color: var(--ink2); }

.tb-rbox { width: min(980px, 100%); text-align: center; display: grid; gap: 14px; justify-items: center; }
.tb-rbox h4 { font-size: 22px; font-weight: 800; padding: 0 40px; }
.tb-reader-book { width: min(860px, 100%); aspect-ratio: 600 / 424; filter: drop-shadow(0 20px 40px rgba(0,0,0,.6)); }
.tb-reader-ctrl { display: flex; align-items: center; gap: 16px; color: var(--muted); }

@media (max-width: 960px) {
  .tb-hero { grid-template-columns: 1fr; text-align: center; min-height: 0; }
  .tb-lead, .tb-now { margin-inline: auto; }
  .tb-kpis, .tb-hero-cta { justify-content: center; }
  .tb-now { border-inline-start: 0; border-top: 3px solid var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent); }
  .tb-holo { order: -1; }
}
@media (max-width: 640px) {
  .tb { border-radius: 22px; }
  .tb-flip-box, .tb-reader-book { aspect-ratio: 300 / 424; width: min(300px, 78vw); }
  .tb-nav { top: 36%; width: 44px; height: 44px; }
  .tb-steps { grid-template-columns: 1fr; gap: 30px; }
  .tb-btn { padding-inline: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.tb, .tb-portal) *, :is(.tb, .tb-portal) *::before, :is(.tb, .tb-portal) *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* the template styles headings and form fields: keep the library's own look in the dialogs */
.tb-portal :is(h1, h2, h3, h4) { color: var(--ink); font-family: Changa, Tahoma, sans-serif; }
.tb-portal .tb-modal :is(input:not([type=hidden]), textarea) { background: rgba(255,255,255,.05) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; box-shadow: none !important; height: auto; min-height: 0; }
.tb-portal .tb-modal :is(input, textarea):focus { border-color: var(--cyan) !important; box-shadow: 0 0 0 3px rgba(56,225,255,.18) !important; }
.tb-portal .tb-modal input.is-bad { border-color: var(--red) !important; }
.tb-portal .tb-modal ::placeholder { color: #7380b3; opacity: 1; }
