/* מעצמת קריפטו: הספר שלי. Simple library + reader. Served from wp-content/mu-plugins/mkl-reader/app.css */
:root{
  --page:#f6f5f1;--card:#fff;--ink:#15192a;--soft:#4a5068;--mute:#7a7f93;--line:#e6e3dc;
  --coin:#f7931a;--acc:#c46a00;--ok:#1f9d63;
  --ui:'Rubik',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;--serif:'Frank Ruhl Libre','David',Georgia,serif;
  --ease:cubic-bezier(.2,.8,.2,1);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--page);color:var(--ink);font:400 16px/1.6 var(--ui);direction:rtl;text-align:right;min-height:100vh;-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:inherit;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;padding:0;-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--coin);outline-offset:2px;border-radius:8px}
svg{display:block}
.ico{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.boot{display:grid;place-items:center;min-height:100vh}
.boot img{border-radius:4px;opacity:.85}

.btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;background:var(--coin);color:#1b0f00;font:700 18px/1.2 var(--ui);padding:16px 24px;border-radius:14px;text-decoration:none;transition:filter .15s;text-align:center}
.btn:hover{filter:brightness(1.05)}

/* ---------- library ---------- */
.lib{max-width:760px;margin:0 auto;padding:0 16px 48px}
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;height:64px}
.brand{display:flex;align-items:center;gap:8px;font:700 17px/1 var(--ui);text-decoration:none}
.brand i{width:26px;height:26px;border-radius:7px;background:var(--coin);display:grid;place-items:center;color:#1b0f00;font:800 14px/1 var(--ui);font-style:normal}
.top-links{display:flex;gap:18px;font-size:15px;color:var(--mute)}
.top-links a{text-decoration:none}
.top-links a:hover{color:var(--ink)}
h1.page-h{font:800 26px/1.2 var(--ui);margin:8px 0 16px}
.bookcard{display:flex;gap:22px;background:var(--card);border:1px solid var(--line);border-radius:18px;padding:22px;align-items:center}
.bookcard img{width:120px;height:auto;border-radius:4px;box-shadow:0 10px 24px -10px rgba(0,0,0,.45);flex:none}
.bookcard .info{flex:1;min-width:0}
.bookcard h2{font:800 22px/1.25 var(--ui);margin:0 0 4px}
.bookcard .sub{color:var(--mute);font-size:14.5px;margin:0 0 14px}
.prog{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--soft);margin:0 0 6px}
.bar{flex:1;height:6px;border-radius:9px;background:#ece9e2;overflow:hidden}
.bar i{display:block;height:100%;background:var(--coin);border-radius:9px}
.where{font-size:14.5px;color:var(--soft);margin:0 0 16px}
.where b{color:var(--ink);font-weight:600}
.toc-h{font:700 19px/1.3 var(--ui);margin:32px 0 10px}
.toc{background:var(--card);border:1px solid var(--line);border-radius:18px;overflow:hidden}
.ph{font:600 13px/1.4 var(--ui);color:var(--mute);padding:14px 18px 6px}
.toc .ph{background:#faf9f6;border-top:1px solid var(--line);padding-bottom:10px}
.toc .ph:first-child{border-top:0}
.toc > .row:first-child{border-top:0}
.toc .row + .ph{border-top:1px solid var(--line)}
.row{display:flex;align-items:center;gap:12px;min-height:58px;padding:10px 18px;text-decoration:none;border-top:1px solid #f0eee9}
.ph + .row{border-top:0}
a.row:hover{background:#fbfaf7}
.row .t{flex:1;min-width:0;font-size:16px;line-height:1.4}
.row .t small{display:block;font-size:12.5px;color:var(--mute)}
.row .s{font-size:13.5px;color:var(--mute);white-space:nowrap}
.row .s.ok{color:var(--ok);font-weight:600}
.row.cur .t,.row.cur .s{color:var(--acc);font-weight:600}
.row.na{color:var(--mute)}
.foot{margin-top:32px;font-size:13.5px;color:var(--mute);line-height:1.9}
.foot a{color:var(--mute)}
.demo{display:inline-block;font-size:12.5px;color:var(--acc);background:#fdf1e2;border-radius:8px;padding:0 8px}

/* ---------- reader ---------- */
.reader{--bg:#fbfaf7;--fg:#1f2330;--mute:#73788b;--line:#e8e4da;--panel:#fff;--acc:#c46a00;--bar:#fbfaf7;min-height:100vh;background:var(--bg);color:var(--fg)}
.reader[data-theme=sepia]{--bg:#f4ead5;--fg:#3b2f20;--mute:#806d52;--line:#e2d3b3;--panel:#faf2e0;--acc:#a1520a;--bar:#f4ead5}
.reader[data-theme=dark]{--bg:#14161d;--fg:#d6d8df;--mute:#8a8f9f;--line:#272a35;--panel:#1c1f28;--acc:#f0a043;--bar:#14161d}
.rbar{position:fixed;top:0;inset-inline:0;z-index:40;height:calc(56px + env(safe-area-inset-top));display:flex;align-items:center;gap:2px;padding:env(safe-area-inset-top) 6px 0;background:var(--bar);border-bottom:1px solid var(--line);transition:transform .25s var(--ease)}
.rbtn{width:48px;height:48px;border-radius:12px;display:grid;place-items:center;color:var(--fg);flex:none}
.rbtn:hover{background:rgba(127,127,127,.12)}
.rbtn.aa{font:700 19px/1 var(--serif)}
.rtitle{flex:1;min-width:0;text-align:center;font-size:14.5px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rfoot{position:fixed;bottom:0;inset-inline:0;z-index:40;height:calc(44px + env(safe-area-inset-bottom));padding:0 18px env(safe-area-inset-bottom);display:flex;align-items:center;gap:12px;font-size:13px;color:var(--mute);background:var(--bar);border-top:1px solid var(--line);transition:transform .25s var(--ease)}
.rfoot .bar{background:var(--line);height:4px}
.rfoot .bar i{background:var(--acc)}
.reader.hide .rbar{transform:translateY(-100%)}
.reader.hide .rfoot{transform:translateY(100%)}
.page{max-width:680px;margin:0 auto;padding:92px 22px 110px}
.ch-head{text-align:center;margin:12px 0 40px}
.ch-head small{display:block;font:600 14px/1.4 var(--ui);color:var(--acc);margin-bottom:10px}
.ch-head h1{font:700 clamp(28px,6vw,40px)/1.25 var(--serif);margin:0}
.text{font-family:var(--rf,var(--serif));font-size:var(--fs,20px);line-height:1.85;overflow-wrap:break-word}
.reader[data-font=sans] .text{--rf:var(--ui);line-height:1.8}
.text p{margin:0 0 1em}
.mkl-wm{font:400 12px/1.4 var(--ui)!important;color:var(--mute);opacity:.6;text-align:center;margin:40px 0 0!important;user-select:none;-webkit-user-select:none}
.loading{display:flex;flex-direction:column;gap:14px}
.loading i{display:block;height:1.1em;border-radius:6px;background:var(--line)}
.loading i:nth-child(3n){width:70%}
.na-box{text-align:center;padding:36px 20px;border:1.5px dashed var(--line);border-radius:16px;color:var(--mute)}
.na-box b{display:block;color:var(--fg);font-size:18px;margin-bottom:6px}
.ch-end{margin-top:56px;text-align:center}
.ch-end p{color:var(--mute);margin:0 0 14px;font-size:15px}
.ch-end .btn{max-width:420px;margin:0 auto 14px;flex-direction:column;gap:4px}
.ch-end .btn span{font-weight:500;font-size:14.5px;opacity:.8}
.ch-end .home-link{color:var(--mute);font-size:15px}

/* sheets */
.scrim{position:fixed;inset:0;z-index:50;background:rgba(10,12,20,.4);animation:fade .2s}
.scrim.clear{background:transparent}
@keyframes fade{from{opacity:0}}
.sheet{position:fixed;z-index:51;background:var(--panel);color:var(--fg);box-shadow:0 20px 60px rgba(0,0,0,.3);display:flex;flex-direction:column}
.sheet-toc{top:0;bottom:0;inset-inline-start:0;width:min(420px,100vw);animation:slide .28s var(--ease)}
@keyframes slide{from{transform:translateX(100%)}}
.sheet-h{display:flex;align-items:center;justify-content:space-between;min-height:56px;padding:env(safe-area-inset-top) 18px 0 6px;border-bottom:1px solid var(--line);font:700 17px/1.2 var(--ui)}
.sheet-b{overflow:auto;flex:1;padding-bottom:env(safe-area-inset-bottom)}
.sheet .row{border-top:0;min-height:54px;padding:8px 18px;color:var(--fg)}
.sheet .row:hover{background:rgba(127,127,127,.08)}
.sheet .row.cur{background:rgba(247,147,26,.13)}
.sheet .row.cur .t,.sheet .row.cur .s{color:var(--acc)}
.sheet .row .t small,.sheet .row .s,.sheet .ph{color:var(--mute)}
.sheet .row.na{opacity:.5}
.sheet-aa{top:64px;inset-inline-end:12px;width:320px;border-radius:18px;padding:18px;border:1px solid var(--line);animation:fade .15s}
.sheet-aa h4{font:600 13px/1 var(--ui);color:var(--mute);margin:0 0 10px}
.opt{margin-bottom:20px}.opt:last-child{margin:0}
.sizes{display:flex;align-items:center;gap:10px}
.sizes button{flex:1;height:52px;border-radius:12px;background:rgba(127,127,127,.12);font-family:var(--serif);font-weight:700;color:var(--fg)}
.sizes output{min-width:40px;text-align:center;color:var(--mute);font-size:15px}
.themes,.fonts{display:flex;gap:12px}
.themes button,.fonts button{flex:1;height:52px;border-radius:12px;font-size:16px;box-shadow:inset 0 0 0 1px rgba(127,127,127,.35)}
.themes button[aria-pressed=true],.fonts button[aria-pressed=true]{box-shadow:inset 0 0 0 2.5px var(--coin)}
.toast{position:fixed;z-index:70;bottom:70px;left:50%;transform:translateX(-50%);background:#1b1f2c;color:#fff;padding:12px 18px;border-radius:12px;font-size:14.5px;max-width:calc(100vw - 32px);text-align:center;animation:fade .2s}

/* gate */
.gate{min-height:100vh;display:grid;place-items:center;padding:24px 16px}
.gate-card{width:min(420px,100%);background:var(--card);border:1px solid var(--line);border-radius:20px;padding:30px 24px;text-align:center}
.gate-cover{border-radius:4px;box-shadow:0 12px 26px -10px rgba(0,0,0,.45);margin-bottom:20px;height:auto}
.gate h1{font:800 24px/1.25 var(--ui);margin:0 0 8px}
.gate p{color:var(--soft);margin:0 0 20px}
.gate form{text-align:right}
.gate form p{margin:0 0 14px;color:var(--ink)}
.gate label{display:block;font-size:14px;color:var(--soft);margin-bottom:6px}
.gate input[type=text],.gate input[type=password]{width:100%;height:50px;padding:0 14px;border-radius:12px;border:1px solid #d9d6cf;background:#fff;color:var(--ink);font:400 16px/1 var(--ui);direction:ltr;text-align:right}
.gate .login-remember label{display:flex;gap:8px;align-items:center}
.gate input[type=submit]{width:100%;height:54px;border:0;cursor:pointer;background:var(--coin);color:#1b0f00;font:700 17px/1 var(--ui);border-radius:14px;margin-top:4px}
.gate .gate-small{font-size:14px;color:var(--mute);margin:16px 0 0}
.gate .gate-small a{color:var(--soft)}
.gate .btn{width:auto;display:inline-flex}

/* after purchase (my-book/?welcome=1) */
.welcome{max-width:760px;margin:12px auto 0;padding:12px 44px 12px 14px;position:relative;background:#ecf8f1;border:1px solid #bfe5cf;color:#14603d;border-radius:12px;font-size:14.5px;line-height:1.55}
.welcome p{margin:0}
.welcome button{position:absolute;top:6px;left:8px;width:30px;height:30px;font-size:20px;line-height:1;color:#14603d}
@media (max-width:790px){.welcome{margin:10px 16px 0}}

/* login link, thanks page (mkl-sales.php) */
.gate input[type=email]{width:100%;height:50px;padding:0 14px;border-radius:12px;border:1px solid #d9d6cf;background:#fff;color:var(--ink);font:400 16px/1 var(--ui);direction:ltr;text-align:right;margin-bottom:12px}
.gate .link-form .btn{width:100%;display:flex;border:0;cursor:pointer;font-size:17px}
.gate div.gate-note{margin:0 0 18px}
.gate .gate-note{background:#fff7ea;border:1px solid #f3d6a6;color:#6b4100;border-radius:12px;padding:12px 14px;font-size:15px;text-align:right}
.gate .gate-note.ok{background:#ecf8f1;border-color:#bfe5cf;color:#14603d}
.gate details{text-align:right;margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
.gate summary{cursor:pointer;color:var(--soft);font-size:15px;list-style-position:inside}
.gate details[open] summary{margin-bottom:14px}
.gate .pw-login form{margin-top:4px}
.thanks-check{width:60px;height:60px;border-radius:50%;background:var(--ok);color:#fff;display:grid;place-items:center;margin:0 auto 16px}
.thanks .steps{list-style:none;margin:0 0 6px;padding:0;text-align:right;display:grid;gap:10px}
.thanks .steps li{display:flex;gap:12px;align-items:center;background:var(--page);border-radius:12px;padding:12px 14px;font-size:15.5px}
.thanks .steps b{flex:none;width:28px;height:28px;border-radius:50%;background:var(--coin);color:#1b0f00;display:grid;place-items:center;font:800 14px/1 var(--ui)}
.gate .claim-form input[type=text]{width:100%;height:50px;padding:0 14px;border-radius:12px;border:1px solid #d9d6cf;background:#fff;color:var(--ink);font:400 16px/1 var(--ui);margin-bottom:12px}
.thanks .my-mail{background:var(--page);border-radius:12px;padding:12px;margin:0 0 18px;text-align:center;word-break:break-all}
.thanks .help-paid{margin-top:18px;text-align:right}
.thanks .gate-small-l{font-size:14.5px;color:var(--soft);margin:0 0 14px}

@media (max-width:600px){
  h1.page-h{font-size:22px;margin-top:0}
  .bookcard{flex-direction:column;text-align:center;padding:22px 18px}
  .bookcard img{width:130px}
  .bookcard .info{width:100%}
  .prog{max-width:320px;margin-inline:auto}
  .top-links .hide-sm{display:none}
  .page{padding:80px 20px 100px}
  .rtitle{font-size:13.5px}
  .sheet-aa{top:auto;bottom:0;inset-inline:0;width:auto;border-radius:20px 20px 0 0;padding:20px 18px calc(22px + env(safe-area-inset-bottom));animation:up .25s var(--ease)}
  @keyframes up{from{transform:translateY(100%)}}
}
@media (prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
