/* "Caietul meu" for visitors who are not signed in: the same edge tab as for learners, opening a panel that shows what the
   notebook does (a short animation, three points, the "Cum înveți cu noi" video) and leads to a free account. Desktop only. */
.apa-nbx-tab, .apa-nbx-tip, .apa-nbx { display: none; }
@media (min-width: 768px) {
    :where(body.apa-nbx-on) :where(.apa-wrap, .kp-wrap) { width: calc(100% - 40px); }
    :where(body.apa-nbx-on) :where(.apa-footer__in) { width: calc(100% - 80px); }

    .apa-nbx-tab {
        position: fixed; right: 0; top: 46%; z-index: 1050; width: 34px; display: flex; flex-direction: column; align-items: center; gap: 7px;
        padding: 11px 0; border: 1px solid rgba(45, 212, 191, .45); border-right: 0; border-radius: 12px 0 0 12px;
        background: #0d2a2a; color: #5eead4; cursor: pointer; box-shadow: -6px 8px 24px rgba(0, 0, 0, .35); font: inherit; transition: background .15s, opacity .2s;
    }
    .apa-nbx-tab:hover { background: #10403c; }
    .apa-nbx-tab svg { width: 20px; height: 20px; }
    .apa-nbx-tab b { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; letter-spacing: .02em; }
    .apa-nbx-tab i { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .2); animation: apaNbxPulse 2s ease-in-out infinite; }
    .apa-nbx-tab.is-wiggle svg { animation: apaNbxWig .9s ease; }
    body.apa-nbx-open .apa-nbx-tab { opacity: 0; pointer-events: none; }

    .apa-nbx-tip {
        display: block; position: fixed; right: 44px; top: 46%; z-index: 1051; width: 250px; padding: 11px 13px; border-radius: 12px; background: #182131;
        border: 1px solid rgba(45, 212, 191, .4); box-shadow: 0 14px 40px rgba(0, 0, 0, .45); font-size: 13px; line-height: 1.5; color: #cbd5e1;
        opacity: 0; transform: translateX(8px); pointer-events: none; transition: .2s;
    }
    .apa-nbx-tip b { color: #e7ecf3; display: block; margin-bottom: 2px; }
    .apa-nbx-tip.is-on { opacity: 1; transform: none; }

    .apa-nbx {
        display: flex; flex-direction: column; position: fixed; right: 0; top: 80px; bottom: 8px; width: min(410px, calc(100vw - 40px)); z-index: 1060;
        background: #0f141d; color: #e7ecf3; border: 1px solid rgba(148, 163, 184, .16); border-right: 0; border-radius: 16px 0 0 16px;
        box-shadow: -18px 0 50px rgba(0, 0, 0, .45); transform: translateX(105%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s;
        font-size: 14px; line-height: 1.55;
    }
    body.apa-nbx-open .apa-nbx { transform: none; visibility: visible; transition: transform .3s ease; }
}
.apa-nbx__head { display: flex; align-items: center; gap: 8px; padding: 13px 14px 10px; border-bottom: 1px solid rgba(148, 163, 184, .16); }
.apa-nbx__head h2 { margin: 0 auto 0 0; font-size: 16px; display: flex; gap: 8px; align-items: center; color: #e7ecf3; }
.apa-nbx__head svg { width: 22px; height: 22px; }
.apa-nbx__chip--g { color: #5eead4 !important; background: rgba(45, 212, 191, .14) !important; }
.apa-nbx__chip { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fbbf24; background: rgba(251, 191, 36, .14); border-radius: 999px; padding: 1px 8px; }
.apa-nbx__x { background: transparent; border: 0; color: #98a7b6; font-size: 22px; line-height: 1; padding: 2px 6px; cursor: pointer; border-radius: 6px; }
.apa-nbx__x:hover { color: #e7ecf3; background: #131a25; }
.apa-nbx__body { flex: 1; min-height: 0; overflow: hidden; padding: 14px 16px 12px; }
.apa-nbx__fit { transform-origin: top left; }
.apa-nbx h3 { font-size: 21px; line-height: 1.2; margin: 2px 0 6px; letter-spacing: -.01em; color: #e7ecf3; }
.apa-nbx h3 em { font-style: normal; color: #fbbf24; }
.apa-nbx__sub { color: #98a7b6; margin: 0 0 14px; }

.apa-nbx__show { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(45, 212, 191, .08), rgba(251, 191, 36, .06)); border: 1px solid rgba(148, 163, 184, .16); margin-bottom: 16px; min-height: 196px; }
.apa-nbx__l, .apa-nbx__r { background: #0a0e14; border: 1px solid rgba(148, 163, 184, .16); border-radius: 10px; padding: 9px; min-width: 0; }
.apa-nbx__show small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #98a7b6; margin-bottom: 6px; font-weight: 700; }
.apa-nbx__code { font: 11px/1.6 "JetBrains Mono", ui-monospace, monospace; color: #e2e8f0; white-space: pre; overflow: hidden; }
.apa-nbx__save { margin-top: 8px; display: inline-flex; gap: 5px; align-items: center; font-size: 10.5px; font-weight: 700; color: #5eead4; border: 1px solid rgba(45, 212, 191, .45); border-radius: 7px; padding: 3px 7px; transition: .2s; }
.apa-nbx__save.is-press { background: rgba(45, 212, 191, .12); transform: scale(.94); }
.apa-nbx__save svg { width: 13px; height: 13px; }
.apa-nbx__r { display: flex; flex-direction: column; gap: 6px; }
.apa-nbx__e { border-radius: 8px; background: #131a25; border: 1px solid rgba(148, 163, 184, .16); padding: 6px 7px; font-size: 10.5px; line-height: 1.45; color: #cbd5e1; opacity: 0; transform: translateY(-8px) scale(.96); transition: .35s ease; }
.apa-nbx__e.is-in { opacity: 1; transform: none; }
.apa-nbx__e i { font-style: normal; font-weight: 800; font-size: 9px; border-radius: 99px; padding: 0 6px; margin-right: 4px; background: rgba(45, 212, 191, .12); color: #5eead4; }
.apa-nbx__e--g i { background: rgba(255, 107, 138, .14); color: #ff6b8a; }
.apa-nbx__e--n i { background: rgba(167, 139, 250, .15); color: #c4b5fd; }
.apa-nbx__e code { font: 10px ui-monospace, monospace; color: #e2e8f0; background: none; padding: 0; }
.apa-nbx__fly { position: absolute; z-index: 2; font: 10px ui-monospace, monospace; background: rgba(45, 212, 191, .12); color: #5eead4; border: 1px solid rgba(45, 212, 191, .5); border-radius: 6px; padding: 2px 6px; pointer-events: none; opacity: 0; }

.apa-nbx .apa-nbx__g { display: flex; min-height: 0; font: 700 15px/1.2 Inter, system-ui, sans-serif; border: 1px solid #fff; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; padding: 12px 16px; background: #fff; color: #1f2937 !important; font-weight: 700; font-size: 15px; text-decoration: none !important; transition: box-shadow .15s, transform .15s; }
.apa-nbx__g:hover { box-shadow: 0 0 0 4px rgba(45, 212, 191, .3); transform: translateY(-1px); }
.apa-nbx__g svg { width: 19px; height: 19px; }
.apa-nbx__alt { text-align: center; font-size: 12.5px; color: #98a7b6; margin: 7px 0 0; }
.apa-nbx__alt a { color: #5eead4; font-weight: 700; text-decoration: none; }
.apa-nbx__rate { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; color: #cbd5e1; margin: 10px 0 12px; }
.apa-nbx__rate b { color: #e7ecf3; }
.apa-nbx__st { color: #fbbf24; letter-spacing: 1px; }
.apa-nbx__note { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: rgba(251, 191, 36, .07); border: 1px solid rgba(251, 191, 36, .3); font-size: 12.5px; line-height: 1.45; color: #cbd5e1; }
.apa-nbx__note svg { width: 22px; height: 22px; flex: none; }
.apa-nbx__note b { color: #e7ecf3; }
.apa-nbx h4 { font-size: 17px; line-height: 1.25; margin: 0 0 8px; color: #e7ecf3; }

.apa-nbx__rvs { position: relative; overflow: hidden; margin-top: 10px; }
.apa-nbx__track { display: flex; transition: transform .45s ease; }
.apa-nbx__rv { flex: 0 0 100%; margin: 0; padding: 10px 12px; border-radius: 12px; background: #131a25; border: 1px solid rgba(148, 163, 184, .16); display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.apa-nbx__rv blockquote { margin: 0; padding: 0; border: 0; font-size: 13px; line-height: 1.45; color: #e7ecf3; font-style: normal; }
.apa-nbx__rv figcaption { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #98a7b6; }
.apa-nbx__rv img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.apa-nbx__dots { display: flex; justify-content: center; gap: 5px; margin-top: 7px; }
.apa-nbx__dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 99px; background: rgba(148, 163, 184, .35); cursor: pointer; transition: width .2s, background .2s; }
.apa-nbx__dots button.is-on { width: 16px; background: #5eead4; }

.apa-nbx__vid { position: relative; max-width: 100%; margin-left: auto; margin-right: auto; border-radius: 14px; overflow: hidden; border: 1px solid rgba(148, 163, 184, .16); background: #000; margin-bottom: 8px; aspect-ratio: 16 / 9; cursor: pointer; }
.apa-nbx__vid:not([style*=width]) { width: 100%; }
.apa-nbx__vid img, .apa-nbx__vid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.apa-nbx__vid span { position: absolute; inset: 0; transition: background .2s; }
.apa-nbx__vid:hover span { background: rgba(45, 212, 191, .08); }
.apa-nbx__vid.is-playing span { display: none; }
.apa-nbx__vnote { font-size: 12px; color: #98a7b6; margin: 0; }

@keyframes apaNbxPulse { 50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); } }
@keyframes apaNbxWig { 20% { transform: rotate(-14deg) scale(1.2); } 40% { transform: rotate(10deg) scale(1.2); } 60% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .apa-nbx__track { transition: none; } .apa-nbx-tab i, .apa-nbx-tab.is-wiggle svg { animation: none; } .apa-nbx { transition: none; } }
.apa-nbx [hidden] { display: none !important; }
