/* dashboard.css - extracted from inline <style> blocks.
   Order below MUST match the original document order:
   top-part (head) -> nav-part (body start) -> survey_popup (body end).
   Linked from top-part.html AFTER bootstrap.min.css. */

/* ===== top-part.html <head> block ===== */
#loading-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            /* No background here: loading.css draws the translucent veil. An
               opaque colour on this id outranked it and blanked the page. */
        }

        #notification-container {
            display: flex;
            flex-direction: column;
            gap: 12px;
            position: fixed;
            top: 24px;
            inset-inline-end: 24px;
            z-index: 9999;
            max-width: min(380px, calc(100vw - 32px));
        }

        /* The dashboard is a fixed app frame: the document itself never
           scrolls, only .app-scroll does. See the APP SHELL SCROLLING section
           further down for the rest of the chain. */
        html, body {
            height: 100%;
            overflow: hidden;
        }
        body {
          font-family: "Noto Kufi Arabic", sans-serif;
          font-optical-sizing: auto;
          font-style: normal;
        }

        ::selection {
            background-color: #4b81aa;
            color: #fff;
        }

        @keyframes l36-1 {
            0% {
                -webkit-mask-position: 0 0, 0 0
            }
            20% {
                -webkit-mask-position: .5ch 0, 0 0
            }
            40% {
                -webkit-mask-position: 100% 0, 0 0
            }
            60% {
                -webkit-mask-position: 4.5ch 0, 0 0
            }
            80% {
                -webkit-mask-position: 6.5ch 0, 0 0
            }
            100% {
                -webkit-mask-position: 2.5ch 0, 0 0
            }
        }

        @keyframes l36-2 {
            100% {
                transform: translateY(0.2px)
            }
        }

        .loader {
            --loader-border-color: var(--bs-primary);
            --loader-inner-border-color: var(--bs-secondary);
            width: 48px;
            height: 48px;
            border: 3px solid var(--loader-border-color);
            border-radius: 50%;
            display: inline-block;
            position: relative;
            box-sizing: border-box;
            animation: rotation 1s linear infinite;
        }

        .loader::after {
            content: '';
            box-sizing: border-box;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 3px solid;
            border-color: var(--loader-inner-border-color) transparent;
        }

        @keyframes rotation {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }

        /* ── Modern toast notifications ── */
        .notification-toast {
            --nt-accent: var(--mk-accent, #4746B4);
            --nt-accent-2: var(--mk-accent, #4746B4);
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 14px 40px 14px 14px;
            background: rgba(255, 255, 255, 0.92);
            -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
            color: #1e293b;
            border: 1px solid rgba(15, 23, 42, 0.06);
            border-radius: 14px;
            box-shadow: 0 12px 34px rgba(2, 6, 23, 0.16), 0 2px 6px rgba(2, 6, 23, 0.08);
            font-size: 0.9rem;
            line-height: 1.45;
            transform: translateY(-14px) scale(0.97);
            opacity: 0;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
        }

        .notification-toast.show {
            transform: translateY(0) scale(1);
            opacity: 1;
        }

        .notification-toast::before {
            content: '';
            position: absolute;
            inset-inline-start: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: linear-gradient(180deg, var(--nt-accent), var(--nt-accent-2));
        }

        .notification-toast .nt-icon {
            flex: 0 0 auto;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: grid;
            place-items: center;
            font-size: 0.82rem;
            color: #fff;
            background: linear-gradient(135deg, var(--nt-accent), var(--nt-accent-2));
            box-shadow: none;
        }

        .notification-toast .nt-body {
            flex: 1 1 auto;
            min-width: 0;
            padding-top: 2px;
        }

        .notification-toast .nt-msg {
            font-weight: 500;
            overflow-wrap: anywhere;
        }

        .notification-toast .nt-title {
            font-weight: 700;
            margin-bottom: 2px;
        }

        .notification-toast .nt-title + .nt-msg {
            font-weight: 400;
        }

        .notification-toast .nt-link {
            display: inline-block;
            margin-top: 4px;
            font-weight: 600;
            color: var(--nt-accent);
            text-decoration: underline;
        }

        .notification-toast .nt-close {
            position: absolute;
            inset-inline-end: 8px;
            top: 8px;
            border: none;
            background: transparent;
            color: #94a3b8;
            width: 24px;
            height: 24px;
            border-radius: 8px;
            cursor: pointer;
            display: grid;
            place-items: center;
            transition: background 0.15s, color 0.15s;
        }

        .notification-toast .nt-close:hover {
            background: rgba(15, 23, 42, 0.06);
            color: #475569;
        }

        .notification-toast .nt-progress {
            position: absolute;
            inset-inline: 0;
            bottom: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--nt-accent), var(--nt-accent-2));
            opacity: 0.6;
            transform-origin: left center;
            animation-name: nt-progress;
            animation-timing-function: linear;
            animation-fill-mode: forwards;
        }

        @keyframes nt-progress {
            from { transform: scaleX(1); }
            to { transform: scaleX(0); }
        }

        .notification-toast.success { --nt-accent: #16a34a; --nt-accent-2: #22c55e; }
        .notification-toast.error   { --nt-accent: #dc2626; --nt-accent-2: #f43f5e; }
        .notification-toast.warning { --nt-accent: #d97706; --nt-accent-2: #f59e0b; }
        .notification-toast.info    { --nt-accent: #2563eb; --nt-accent-2: #3b82f6; }

        @media (prefers-color-scheme: dark) {
            .notification-toast {
                background: rgba(30, 41, 59, 0.94);
                color: #e2e8f0;
                border-color: rgba(255, 255, 255, 0.08);
            }
            .notification-toast .nt-close:hover { background: rgba(255, 255, 255, 0.08); color: #cbd5e1; }
        }

        /* ── Modern form validation errors ── */
        .form-control.is-invalid,
        .form-select.is-invalid,
        .is-invalid {
            border-color: #f43f5e !important;
            box-shadow: 0 0 0 0.18rem rgba(244, 63, 94, 0.15) !important;
        }
        .invalid-feedback,
        ul.errorlist li,
        .errorlist li {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            color: #e11d48;
            font-size: 0.82rem;
            font-weight: 500;
            margin-top: 0.35rem;
        }
        /* Error icon: an inline SVG (circle + exclamation) used as a mask, so it takes the text
           colour and needs no icon font. */
        .invalid-feedback::before,
        ul.errorlist li::before,
        .errorlist li::before {
            content: '';
            flex: none;
            display: inline-block;
            width: 14px;
            height: 14px;
            background-color: currentColor;
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") no-repeat center / contain;
        }
        .invalid-feedback::before { margin-inline-end: .4rem; vertical-align: -2px; }
        ul.errorlist, .errorlist {
            list-style: none;
            padding: 0;
            margin: 0.35rem 0 0;
        }
/* Help video marker styles - Modern Design */
        .help-video-marker {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 15px;
            height: 15px;
            min-width: 15px;
            border-radius: 50%;
            background: var(--bs-dark);
            color: var(--bs-light);
            font-weight: 600;
            font-size: 0;
            cursor: pointer;
            margin-inline-start: 10px;
            padding: 0;
            border: none;
            transition: all 0.35s cubic-bezier(0.23, 1, 0.320, 1);
            vertical-align: middle;
            position: relative;
            flex-shrink: 0;
        }

        .help-video-marker::before {
            content: '?';
            font-size: 10px;
            font-weight: 700;
            display: block;
            line-height: 1;
        }

        [dir='rtl'] .help-video-marker::before {
            content: '؟';
        }

        .help-video-marker:hover {

            transform: translateY(-4px) scale(1.13);
        }

        .help-video-marker:active {
            transform: translateY(-2px) scale(1.06);
        }

        .help-video-marker:focus {
            outline: none;
        }

        .help-video-guide-overlay {
            position: fixed;
            inset: 0;
            z-index: 2500;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(15, 23, 42, 0.55);
            backdrop-filter: blur(3px);
        }

        .help-video-guide-overlay.show {
            display: flex;
        }

        .help-video-guide-card {
            width: min(100%, 360px);
            background: var(--bs-body-bg, #fff);
            color: var(--bs-body-color, #212529);
            border-radius: 18px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
            padding: 18px 18px 16px;
            text-align: center;
        }

        .help-video-guide-icon {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            margin: 0 auto 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: var(--bs-dark);
            color: var(--bs-white);
            font-size: 1.1rem;
            font-weight: 700;
        }

        .help-video-guide-title {
            margin: 0 0 8px;
            font-size: 1rem;
            font-weight: 700;
        }

        .help-video-guide-text {
            margin: 0;
            color: var(--bs-secondary-color, #6c757d);
            font-size: 0.95rem;
            line-height: 1.5;
        }

        .help-video-guide-actions {
            display: flex;
            justify-content: center;
            margin-top: 16px;
        }

        .help-video-guide-dismiss {
            min-width: 120px;
        }

        .help-video-playlist-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: 60vh;
            overflow-y: auto;
            padding: 2px;
        }

        .help-video-playlist-item {
            border: 1px solid var(--bs-border-color, #dee2e6);
            border-radius: 12px;
            background: var(--bs-body-bg, #fff);
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            text-align: start;
            color: inherit;
            transition: all 0.2s ease;
        }

        .help-video-playlist-item:hover,
        .help-video-playlist-item:focus-visible {
            border-color: var(--bs-primary);
            background: rgba(var(--bs-primary-rgb), 0.08);
            outline: none;
        }

        .help-video-playlist-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--bs-primary);
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            flex-shrink: 0;
        }

        .help-video-playlist-text {
            min-width: 0;
            flex: 1;
        }

        .help-video-playlist-title {
            font-weight: 600;
            line-height: 1.3;
            word-break: break-word;
        }

/* ===== nav-part.html sidebar/topbar ===== */
/* ════════════════════════════════════════════════════
   MOKNAH — Mobile-First SaaS Shell
   Sidebar (dark) + Header (light) + Bottom Nav (mobile)
   ════════════════════════════════════════════════════ */

/* ── Sidebar variables ── */
.app-sidebar {
  --sb-bg: #0b1120;
  --sb-bg2: #1e1b4b;
  --sb-text: #e2e8f0;
  --sb-muted: #94a3b8;
  --sb-border: rgba(255,255,255,.07);
  --sb-active-bg: rgba(var(--mk-accent-rgb, 71, 70, 180),.16);
  --sb-active-color: #c7d2fe;
  --sb-hover-bg: rgba(255,255,255,.05);
  --sb-w: 264px;

  width: var(--sb-w) !important;
  /* gradient matches service_hub hero */
  background: linear-gradient(180deg, #0b1120 0%, #131233 60%, #0f1a3a 100%);
  border: none !important;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,.35);
  /* NOTE: do NOT set position here — Bootstrap's offcanvas-lg needs
     position:fixed below lg to stay out of flow. Desktop sets position:sticky
     (which still anchors the ::before glow). */
}
/* soft indigo glow blob, like service_hub hero */
.app-sidebar::before {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--mk-accent-rgb, 71, 70, 180),.22) 0%, transparent 70%);
  top: -120px; inset-inline-end: -80px;
  pointer-events: none;
  z-index: 0;
}
.app-sidebar > * { position: relative; z-index: 1; }

/* ── Sidebar header ── */
.sb-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sb-border);
  background: transparent;
}
.sb-header {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.sb-logo { height: 28px; width: auto;filter: brightness(0) invert(1); }

.sb-close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 9px;
  color: var(--sb-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sb-close-btn:hover { background: rgba(255,255,255,.15); color: var(--sb-text); }

/* ── Sidebar nav scroll area ── */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .625rem 0 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sb-section { margin-bottom: 1rem; }

.sb-section-label {
  padding: .5rem 1.25rem .25rem;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sb-muted);
  opacity: .7;
}

.sb-menu { list-style: none; margin: 0; padding: 0 .625rem; }

/* ── Sidebar nav link — modern rounded pill ── */
.sb-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .5rem .6rem;
  margin: 2px 0;
  border-radius: 11px;
  color: var(--sb-muted);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  transition: background .18s, color .18s;
  position: relative;
}
.sb-link:hover {
  background: var(--sb-hover-bg);
  color: var(--sb-text);
}
.sb-link.active {
  background: var(--mk-accent-bg, rgba(71,70,180,.08));
  color: var(--sb-active-color);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(165,180,252,.18);
}

/* ── Nav icon box ── */
.sb-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  flex-shrink: 0;
  font-size: .78rem;
  transition: background .18s, color .18s, box-shadow .18s, transform .18s;
}
.sb-link:hover .sb-icon { background: rgba(255,255,255,.12); color: var(--sb-text); }
/* active icon = glowing gradient chip, just like service_hub tile icons */
.sb-link.active .sb-icon {
  background: var(--mk-accent-solid, #4746B4);
  color: #fff;
  box-shadow: none;
}

/* Locked (upgrade-required) nav items */
/* Plan chip: lock + the plan's real (translated) name. Tinted at rest, fills
   solid when the locked item is hovered, so it reads as "unlock with <plan>". */
.sb-pro-badge {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px; border-radius: 7px;
  font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap;
  color: var(--mk-accent, #4746B4);
  background: var(--mk-accent-bg, rgba(71,70,180,.1));
  border: 1px solid color-mix(in srgb, var(--mk-accent, #4746B4) 22%, transparent);
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
[dir="rtl"] .sb-pro-badge { padding: 2px 6px 2px 8px; }
.sb-pro-badge .mk-i { width: 12px; height: 12px; stroke-width: 2.2; }
.sb-link-locked:hover .sb-pro-badge {
  color: #fff;
  background: var(--mk-accent-solid, var(--mk-accent, #4746B4));
  border-color: transparent;
}
.sb-link-locked { opacity: .75; }
.sb-link-locked:hover { opacity: 1; }

/* ── Nav badges ── */
.sb-badge {
  font-size: .55rem; padding: 2px 6px; border-radius: 10px;
  margin-inline-start: auto; font-weight: 700; letter-spacing: .04em;
}
.sb-badge-blue  { background: #3b82f6; color: #fff; }
.sb-badge-amber { background: #f59e0b; color: #422006; }
.sb-badge-red   { background: #ef4444; color: #fff; animation: sb-blink 1.2s ease infinite; }
.sb-badge-slate { background: rgba(255,255,255,.15); color: var(--sb-muted); }
@keyframes sb-blink { 50% { transform: scale(1.1); } }

/* ── Collapse arrow ── */
.sb-arrow {
  margin-inline-start: auto;
  font-size: .65rem;
  color: var(--sb-muted);
  transition: transform .25s ease;
  flex-shrink: 0;
}
.sb-link[aria-expanded="true"] .sb-arrow { transform: rotate(90deg); }

/* ── Submenu ── */
.sb-submenu {
  list-style: none; margin: 0; padding: .125rem 0 .125rem 1rem;
  background: rgba(0,0,0,.15);
}
.sb-sublink {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem 1.25rem .45rem 2.25rem;
  color: var(--sb-muted);
  text-decoration: none;
  font-size: .8rem;
  transition: color .15s, background .15s;
  position: relative;
}
.sb-sublink::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: .45;
}
.sb-sublink:hover { color: var(--sb-text); background: rgba(255,255,255,.03); }
.sb-sublink.active { color: var(--sb-active-color); font-weight: 600; }
.sb-sublink.active::before { opacity: 1; }

/* ── Sidebar footer ── */
.sb-foot {
  flex-shrink: 0;
  padding: .75rem;
  border-top: 1px solid var(--sb-border);
  background: rgba(0,0,0,.2);
}

.sb-btn-monitor {
  display: flex; align-items: center; gap: .6rem;
    justify-content:center;
  width: 100%;
  padding: .6rem .875rem;
  background: rgba(239,68,68,.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 11px;
  font-size: .82rem; font-weight: 600;
  text-decoration: none;
  transition: all .15s;
  margin-bottom: .5rem;
}
.sb-btn-monitor:hover { background: rgba(239,68,68,.22); color: #fca5a5; border-color: rgba(239,68,68,.4); }
.monitor-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.sb-btn-logout {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%;
  padding: .6rem .875rem;
  background: rgba(255,255,255,.05);
  color: var(--sb-muted);
  border: 1px solid var(--sb-border);
  border-radius: 11px;
  font-size: .82rem; font-weight: 600;
  text-decoration: none;
  transition: all .15s;
}
.sb-btn-logout:hover {
  background: rgba(239,68,68,.12);
  color: #f87171;
  border-color: rgba(239,68,68,.2);
}

/* ════════════════════════════════════════════════════
   APP HEADER (topbar)
   ════════════════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  height: 58px;
  /* flex: none, not just flex-shrink: 0 — the header is an item of the
     .app-main column, and anything that lets it grow turns `height` into a
     minimum. (It used to carry id="content", which matched a vendored
     `flex: 1 0 auto` rule; max-height: fit-content was the band-aid for that
     and capped the header at its content height, 64.4px, instead of 58px.) */
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 1rem;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}

.hdr-start {
  display: flex;
  align-items: center;
  gap: .375rem;
  flex-shrink: 0;
}

.hdr-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-shrink: 0;
}

.hdr-hamburger {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  border-radius: 8px;
  color: var(--bs-secondary-color, var(--bs-secondary));
  cursor: pointer;
  transition: background .15s, color .15s;
}
.hdr-hamburger:hover { background: rgba(var(--bs-primary-rgb),.08); color: var(--bs-primary); }

.hdr-logo { height: 26px; width: auto; }

/* Desktop credits pill */
.hdr-credits-pill {
  align-items: center;
  gap: .4rem;
  height: 34px;
  padding: 0 .875rem;
  background: rgba(var(--bs-primary-rgb), .08);
  border: 1px solid rgba(var(--bs-primary-rgb), .18);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--bs-primary);
  white-space: nowrap;
}
.hdr-credits-pill i { font-size: .72rem; }
a.hdr-credits-pill { text-decoration: none; transition: background .15s, border-color .15s; }
a.hdr-credits-pill:hover, a.hdr-credits-pill:focus-visible { background: rgba(var(--bs-primary-rgb), .15); border-color: rgba(var(--bs-primary-rgb), .35); color: var(--bs-primary); }
.hdr-credits-pill .hdr-credits-go { font-size: .55rem; opacity: .55; margin-inline-start: .1rem; }
[dir="rtl"] .hdr-credits-pill .hdr-credits-go { transform: scaleX(-1); }
.hdr-credits-sep { opacity: .4; font-weight: 400; }

/* Header action buttons */
.hdr-btn {
  position: relative;height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  border-radius: 8px;
  color: var(--bs-secondary-color, var(--bs-secondary));
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.hdr-btn:hover { background: rgba(var(--bs-primary-rgb),.08); color: var(--bs-primary); }
.hdr-btn:focus { outline: 2px solid rgba(var(--bs-primary-rgb),.4); outline-offset: 1px; }

.hdr-btn-label {
  display: none; /* shown on md+ via flex */
  align-items: center;
  gap: .4rem;
  height: 34px;
  padding: 0 .875rem;
  background: var(--bs-primary);
  color: #fff !important;
  border-radius: 8px;
  font-size: .8rem; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s, transform .1s;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}
.hdr-btn-label:hover { opacity: .88; color: #fff; transform: translateY(-1px); }

@media (min-width: 768px) {
  .hdr-btn-label { display: flex; }
}

/* Notification badge dot */
.hdr-badge {
  position: absolute;
  top: 6px; inset-inline-end: 6px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--bs-body-bg);
}

/* Language toggle */
.hdr-lang {
  height: 34px;
  padding: 0 .625rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  font-size: .78rem; font-weight: 700;
  color: var(--bs-body-color);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.hdr-lang:hover { border-color: var(--bs-primary); background: rgba(var(--bs-primary-rgb),.04); color: var(--bs-primary); }

/* User dropdown trigger — modern pill */
.hdr-user {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .25rem;
  padding-inline-end: .5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--bs-body-color);
  text-decoration: none;
  transition: background .18s, border-color .18s, box-shadow .18s;
  flex-shrink: 0;
}
.hdr-user::after { display: none; } /* kill default bootstrap caret */
.hdr-user:hover,
.hdr-user[aria-expanded="true"] {
  background: rgba(var(--bs-primary-rgb),.06);
  border-color: rgba(var(--bs-primary-rgb),.18);
}
.hdr-user[aria-expanded="true"] .hdr-user-chevron { transform: rotate(180deg); }
.hdr-user-chevron { transition: transform .2s ease; }

/* Avatar with online ring */
.mk-avatar-wrap { position: relative; flex-shrink: 0; line-height: 0; }
.mk-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
  object-fit: cover;
  background-image: linear-gradient(135deg, var(--mk-accent, #4746B4) 0%, var(--mk-accent, #4746B4) 100%);
  color: #fff;
}
.mk-avatar-dot {
  position: absolute;
  bottom: 0; inset-inline-end: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--bs-body-bg);
}
.mk-avatar-lg {
  width: 48px; height: 48px;
  font-size: 1.1rem;
}

/* Modern dropdown menu */
.user-dd-menu {
  min-width: 290px;
  border: 1px solid var(--bs-border-color);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.06);
}
.user-dd-header {
  position: relative;
  padding: 1.125rem 1rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #f1f5f9;
}
.user-dd-header .mk-avatar { box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.user-dd-name { font-weight: 700; font-size: .92rem; color: #f8fafc; }
.user-dd-email { font-size: .76rem; color: #94a3b8; }
.user-dd-online {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .25rem;
  font-size: .66rem; font-weight: 600;
  color: #4ade80;
}
.user-dd-online::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25);
}

/* Plan block */
.user-dd-plan { padding: .875rem 1rem; border-bottom: 1px solid var(--bs-border-color); }
.user-dd-plan-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .5rem;
}
.user-dd-plan-label {
  font-size: .64rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--bs-secondary-color, var(--bs-secondary));
}
.user-dd-plan-badge {
  font-size: .72rem; font-weight: 700;
  padding: .15rem .55rem; border-radius: 999px;
  background: rgba(var(--bs-primary-rgb),.12); color: var(--bs-primary);
}
.user-dd-progress {
  height: 6px; border-radius: 999px;
  background: rgba(var(--bs-secondary-rgb),.18);
  overflow: hidden;
}
.user-dd-progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--bs-primary), var(--mk-accent, #4746B4));
}
.user-dd-credits { font-size: .72rem; color: var(--bs-secondary-color, var(--bs-secondary)); margin-top: .4rem; }

/* Menu items */
.user-dd-items { padding: .375rem; }
.user-dd-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .625rem;
  border-radius: 10px;
  color: var(--bs-body-color);
  text-decoration: none;
  font-size: .84rem; font-weight: 500;
  transition: background .14s, color .14s;
}
.user-dd-item:hover { background: rgba(var(--bs-primary-rgb),.08); color: var(--bs-primary); }
.user-dd-item-logout:hover { background: rgba(239,68,68,.1); color: #ef4444; }

/* Icon chip in dropdowns */
.dd-icon-wrap {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: rgba(var(--bs-primary-rgb),.1);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
  transition: background .14s, transform .14s;
}
.user-dd-item:hover .dd-icon-wrap { transform: scale(1.06); }

/* ── Shared modern dropdown (feedback + notifications) ── */
.hdr-dd-menu {
  width: 340px!important;
  max-width: calc(100vw - 1rem)!important;
  padding: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.06);
}
.hdr-dd-head {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .875rem 1rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  color: #f1f5f9;
}
.hdr-dd-head-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1);
  color: #c7d2fe;
  font-size: .8rem;
  flex-shrink: 0;
}
.hdr-dd-head-title { font-weight: 700; font-size: .9rem; }
.hdr-dd-head-sub { font-size: .68rem; color: #94a3b8; }

/* Feedback form polish */
.fb-textarea {
  border-radius: 10px;
  border: 1.5px solid var(--bs-border-color);
  font-size: .85rem;
  resize: none;
  transition: border-color .15s, box-shadow .15s;
}
.fb-textarea:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb),.15);
}
.fb-label { font-size: .78rem; font-weight: 600; color: var(--bs-body-color); margin-bottom: .35rem; }
.fb-submit {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  width: 100%; height: 42px;
  background: var(--bs-primary); color: #fff;
  border: none; border-radius: 10px;
  font-size: .85rem; font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb),.3);
}
.fb-submit:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(var(--bs-primary-rgb),.38); }

/* Notification dropdown */
.notify-scrollable { overflow-y: auto; max-height: 300px; }
.notify-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
  text-decoration: none;
  transition: background .14s;
}
.notify-item:hover { background: rgba(var(--bs-primary-rgb),.05); }
.notify-item-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0,0,0,.12);
}
.notify-item-icon.bg-success { background: linear-gradient(135deg,#10b981,#059669) !important; }
.notify-item-icon.bg-danger  { background: linear-gradient(135deg,#ef4444,#dc2626) !important; }
.notify-item-icon.bg-warning { background: linear-gradient(135deg,#f59e0b,#d97706) !important; }
.notify-item-icon.bg-info    { background: var(--mk-accent-solid, #4746B4) !important; }
@keyframes notify-item-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.notify-item-enter { animation: notify-item-in .35s ease both; }
.notify-empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  background: rgba(var(--bs-primary-rgb),.08);
  color: var(--bs-primary);
  font-size: 1.5rem;
}

.notify-actions {
  display: flex; align-items: center;
  border-top: 1px solid var(--bs-border-color);
}
.notify-action-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .55rem .75rem;
  font-size: .78rem;
  color: var(--bs-secondary-color, var(--bs-secondary));
  background: none; border: none;
  cursor: pointer; text-decoration: none;
  transition: color .15s;
}
.notify-action-btn:hover { color: var(--bs-primary); }
.notify-divider { width: 1px; height: 20px; background: var(--bs-border-color); }

@keyframes notify-shake {
  0%,100% { transform: rotate(0); }
  15%      { transform: rotate(8deg); }
  30%      { transform: rotate(-8deg); }
  45%      { transform: rotate(5deg); }
  60%      { transform: rotate(-5deg); }
  75%      { transform: rotate(3deg); }
}
.notify-shake { display: inline-block; animation: notify-shake 2s ease infinite; }

/* Star rating */
.star-rating { position: relative; cursor: pointer; }
.star-rating input { position: absolute; opacity: 0; width: 100%; height: 100%; z-index: 2; cursor: pointer; }
.star-rating label { color: #d1d5db; font-size: 1.35rem; cursor: pointer; margin: 0; transition: color .15s; }
.star-rating:hover label { color: #f59e0b; }
.fas.fa-star { color: #f59e0b; }

/* Feedback nudge */
.feedback-nudge-popover {
  position: fixed; z-index: 1085;
  width: min(320px, calc(100vw - 24px));
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
  padding: 12px;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  cursor: pointer;
}
.feedback-nudge-popover.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.feedback-nudge-popover::before {
  content: '';
  position: absolute; top: -8px; right: 30px;
  width: 14px; height: 14px;
  background: var(--bs-body-bg);
  border-left: 1px solid var(--bs-border-color);
  border-top: 1px solid var(--bs-border-color);
  transform: rotate(45deg);
}
.feedback-nudge-title { font-size: 14px; font-weight: 700; color: var(--bs-primary); margin-bottom: 6px; }
.feedback-nudge-text  { font-size: 13px; color: var(--bs-body-color); margin-bottom: 10px; line-height: 1.45; }
#feedbackNudgeTarget.feedback-nudge-active #feedbackDropdown::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(var(--bs-primary-rgb),.45);
  animation: feedbackNudgePulse 1.6s ease-out infinite;
}
@keyframes feedbackNudgePulse {
  0%   { transform: scale(.95); opacity: .9; }
  100% { transform: scale(1.2);  opacity: 0; }
}

/* Subscription warning */
.mk-sub-warning {
  border-radius: 0;
  border-inline: none;
  border-top: none;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ════════════════════════════════════════════════════ */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1030;
  height: 62px;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 .25rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 1; max-width: 80px;
  padding: 6px 0;
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
  background: none; border: none; cursor: pointer;
  border-radius: 10px;
  transition: color .15s;
  position: relative;
}
.bn-item.active { color: var(--bs-primary); }
.bn-item:hover  { color: var(--bs-primary); }

.bn-icon { font-size: 1.15rem; line-height: 1; }
.bn-label { font-size: .6rem; font-weight: 600; line-height: 1; white-space: nowrap; }

.bn-badge {
  position: absolute;
  top: 2px; inset-inline-end: 8px;
  background: #ef4444; color: #fff;
  font-size: .55rem; padding: 1px 4px;
  border-radius: 8px; font-weight: 700;
}

/* ════════════════════════════════════════════════════
   LAYOUT (desktop sidebar + content side-by-side)
   ════════════════════════════════════════════════════ */

/* App main content wrapper */
/* ════════════════════════════════════════════════════
   APP SHELL SCROLLING

   The dashboard scrolls like an application, not like a document: <html> and
   <body> are locked (see the top of this file) and .app-scroll is the single
   scrolling element. The sidebar and the header are therefore genuinely
   fixed — they are siblings of the scroller, not sticky children of the page —
   so neither can drift, and the scrollbar belongs to the content column alone
   instead of running the full height of the window beside the sidebar.

   The chain only works if every ancestor of the scroller is height-bounded and
   min-height-released. A flex item defaults to min-height:auto, which refuses
   to shrink below its content; without `min-height: 0` the column grows to fit
   its content and the overflow never happens — the classic reason an
   overflow:auto child scrolls nothing.

   100dvh, with 100vh as the fallback, because mobile 100vh is measured against
   the viewport with the URL bar retracted and leaves the bottom of the app cut
   off until the user scrolls.
   ════════════════════════════════════════════════════ */

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  /* Fallback for the handful of pages that {% include %} the shell instead of
     extending middle_page.html — acc/edit_group_permissions, chat/menu,
     projects/workspace, requests/view_request, transcription/file_detail,
     admin/blank. They drop content straight into .app-main with no .app-scroll
     wrapper, and with the document locked they would simply be clipped. Here
     the column scrolls itself instead.

     A browser without :has() gets overflow-y:auto on both, which costs nothing:
     .app-scroll is flex:1 with min-height:0, so it consumes the overflow and
     .app-main is left with nothing to scroll. */
  overflow-y: auto;
}

.app-main:has(> .app-scroll) {
  overflow: hidden;
}

.app-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* Reserve the gutter so content does not jump sideways when a short page
     grows past one screen and the scrollbar appears. */
  scrollbar-gutter: auto;
  /* Keeps the footer at the bottom on pages shorter than the viewport, which
     is what .app-content's flex-grow-1 was doing against the old page flow. */
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1 0 auto;
}

/* The vertical scrollbar is placed by the element's own direction, so in Arabic
   (dir="rtl") it lands on the left — the opposite edge from the sidebar — and
   in English it lands on the right, again opposite. Nothing to force. */

.app-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--bs-border-color) transparent;
}

.app-scroll::-webkit-scrollbar {
  width: 10px;
}

.app-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.app-scroll::-webkit-scrollbar-thumb {
  background-color: var(--bs-border-color);
  border-radius: 999px;
  /* Transparent border + background-clip is the usual way to inset a webkit
     thumb; padding does nothing on a scrollbar part. */
  border: 3px solid transparent;
  background-clip: content-box;
}

.app-scroll:hover::-webkit-scrollbar-thumb {
  background-color: var(--bs-secondary-color, var(--bs-secondary));
}

/* Mobile: full-width + bottom padding for bottom nav */
@media (max-width: 991.98px) {
  .app-main { padding-bottom: 62px; }
}

/* Desktop (lg+): sidebar always shown as sticky side panel */
@media (min-width: 992px) {
  #wrapper {
    display: flex;
    align-items: stretch;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  /* Override Bootstrap offcanvas-lg behavior to show sidebar inline */
  .app-sidebar.offcanvas-lg {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    transform: none !important;
    visibility: visible !important;
    z-index: auto !important;
    flex-shrink: 0;
    transition: width .25s ease, opacity .2s ease;
  }
  .mobile-bottom-nav { display: none !important; }

  /* Collapsed state — desktop only */
  #wrapper.sidebar-collapsed .app-sidebar.offcanvas-lg {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }
}

/* Desktop sidebar collapse toggle — hidden on mobile */
.hdr-sidebar-toggle {
  width: 38px; height: 38px;
  display: none;
  align-items: center; justify-content: center;
  background: none; border: none;
  border-radius: 8px;
  color: var(--bs-secondary-color, var(--bs-secondary));
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.hdr-sidebar-toggle:hover { background: rgba(var(--bs-primary-rgb),.08); color: var(--bs-primary); }
@media (min-width: 992px) {
  .hdr-sidebar-toggle { display: flex; }
}

/* RTL support */
[dir="rtl"] .sb-link { border-inline-start: none; border-inline-end: 3px solid transparent; }
[dir="rtl"] .sb-link.active { border-inline-end-color: var(--sb-active-color); }

/* ===== survey_popup.html (via bot-part) ===== */
.mk-survey-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 10000;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(3px);
            animation: mkSFadeIn .3s ease;
        }

        .mk-survey-overlay.active {
            display: flex;
        }

        @keyframes mkSFadeIn {
            from {
                opacity: 0
            }
            to {
                opacity: 1
            }
        }

        @keyframes mkSSlideUp {
            from {
                transform: translateY(30px);
                opacity: 0
            }
            to {
                transform: translateY(0);
                opacity: 1
            }
        }

        .mk-survey-modal {
            background: var(--bs-body-bg, #fff);
            border: 1px solid var(--bs-border-color, transparent);
            border-radius: 20px;
            width: 95%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
            animation: mkSSlideUp .4s ease;
            position: relative;
        }

        .mk-survey-header {
            background: linear-gradient(135deg, var(--mk-accent, #4746B4) 0%, var(--mk-accent, #4746B4) 100%);
            color: #fff;
            padding: 26px 28px;
            border-radius: 20px 20px 0 0;
            position: relative;
            overflow: hidden;
        }

        .mk-survey-header::after {
            content: '';
            position: absolute;
            inset-inline-end: -40px;
            top: -40px;
            width: 140px;
            height: 140px;
            background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
            pointer-events: none;
        }

        .mk-survey-header h3 {
            margin: 0 0 6px;
            font-size: 1.3rem;
        }

        .mk-survey-header p {
            margin: 0;
            opacity: .9;
            font-size: .9rem;
        }

        .mk-survey-header .badge-reward {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: rgba(255, 255, 255, .2);
            padding: 6px 14px;
            border-radius: 20px;
            font-size: .85rem;
            margin-top: 10px;
        }

        .mk-survey-close {
            position: absolute;
            top: 16px;
            inset-inline-end: 16px;
            background: rgba(255, 255, 255, .2);
            border: none;
            color: #fff;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background .2s;
        }

        .mk-survey-close:hover {
            background: rgba(255, 255, 255, .35);
        }

        .mk-survey-body {
            padding: 28px;
        }

        .mk-survey-progress {
            display: flex;
            gap: 6px;
            margin-bottom: 24px;
        }

        .mk-survey-progress-step {
            flex: 1;
            height: 5px;
            border-radius: 3px;
            background: var(--bs-secondary-bg, #e9ecef);
            transition: background .3s ease;
        }

        .mk-survey-progress-step.active {
            background: var(--mk-accent, #4746B4);
        }

        .mk-survey-progress-step.done {
            background: #10b981;
        }

        .mk-survey-step {
            display: none;
        }

        .mk-survey-step.active {
            display: block;
        }

        /* Required questions: a marker on the title, and a message when Next is pressed unanswered. */
        .mk-survey-req { color: #dc2626; margin-inline-start: 4px; font-weight: 700; }
        html.dark .mk-survey-req { color: #f87171; }
        .mk-survey-err { margin-top: 10px; font-size: .85rem; font-weight: 600; color: #b91c1c; }
        html.dark .mk-survey-err { color: #f87171; }
        .mk-survey-err.is-shake { animation: mk-survey-shake .32s ease; }
        @keyframes mk-survey-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
        @media (prefers-reduced-motion: reduce) { .mk-survey-err.is-shake { animation: none; } }

        .mk-survey-step h5 {
            font-size: 1.05rem;
            font-weight: 600;
            margin-bottom: 16px;
            color: var(--bs-body-color);
        }

        .mk-survey-step h5 .step-num {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 9px;
            background: var(--mk-accent-solid, #4746B4);
            color: #fff;
            font-size: .8rem;
            margin-inline-end: 8px;
            box-shadow: none;
        }

        .mk-survey-option {
            display: block;
            padding: 12px 16px;
            border: 2px solid var(--bs-border-color, #dee2e6);
            border-radius: 12px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all .2s;
            font-size: .92rem;
        }

        .mk-survey-option:hover {
            border-color: var(--mk-accent, #4746B4);
            background: rgba(var(--mk-accent-rgb, 71, 70, 180), .05);
        }

        .mk-survey-option input[type="radio"] {
            margin-inline-end: 8px;
        }

        .mk-survey-option.selected {
            border-color: var(--mk-accent, #4746B4);
            background: rgba(var(--mk-accent-rgb, 71, 70, 180), .08);
        }

        .mk-nps-scale {
            display: flex;
            gap: 4px;
            justify-content: center;
            flex-wrap: wrap;
            margin: 16px 0;
        }

        .mk-nps-btn {
            width: 42px;
            height: 42px;
            border: 2px solid var(--bs-border-color, #dee2e6);
            border-radius: 10px;
            background: var(--bs-body-bg, #fff);
            color: var(--bs-body-color);
            font-weight: 600;
            cursor: pointer;
            transition: all .2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mk-nps-btn:hover {
            border-color: var(--mk-accent, #4746B4);
            transform: scale(1.1);
        }

        .mk-nps-btn.selected {
            background: var(--mk-accent-solid, #4746B4);
            border-color: transparent;
            color: #fff;
            transform: scale(1.1);
            box-shadow: none;
        }

        .mk-nps-labels {
            display: flex;
            justify-content: space-between;
            font-size: .75rem;
            color: var(--bs-secondary-color, #6c757d);
            margin-top: 4px;
        }

        .mk-survey-textarea {
            width: 100%;
            border: 2px solid var(--bs-border-color, #dee2e6);
            border-radius: 10px;
            padding: 10px 14px;
            font-size: .9rem;
            resize: vertical;
            min-height: 60px;
            background: var(--bs-body-bg, #fff);
            color: var(--bs-body-color);
            transition: border-color .2s;
        }

        .mk-survey-textarea:focus {
            outline: none;
            border-color: var(--mk-accent, #4746B4);
        }

        .mk-survey-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 24px;
            gap: 12px;
        }

        .mk-survey-btn {
            padding: 10px 24px;
            border-radius: 10px;
            border: none;
            font-weight: 600;
            cursor: pointer;
            transition: all .2s;
            font-size: .9rem;
        }

        .mk-survey-btn-primary {
            background: var(--mk-accent-solid, #4746B4);
            color: #fff;
            box-shadow: none;
        }

        .mk-survey-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: none;
            filter: brightness(1.05);
        }

        .mk-survey-btn-primary:disabled {
            background: #a5b4fc;
            box-shadow: none;
            transform: none;
            cursor: not-allowed;
        }

        .mk-survey-btn-secondary {
            background: var(--bs-secondary-bg, #e9ecef);
            color: var(--bs-primary);
        }

        .mk-survey-btn-secondary:hover {
            background: var(--bs-tertiary-bg, #dee2e6);
        }

        .mk-survey-thankyou {
            text-align: center;
            padding: 40px 20px;
        }

        .mk-survey-thankyou .icon {
            font-size: 3rem;
            margin-bottom: 16px;
        }

        .mk-survey-thankyou .credits-badge {
            display: inline-block;
            background: linear-gradient(135deg, #10b981, #059669);
            color: #fff;
            padding: 8px 20px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 1.1rem;
            margin: 12px 0;
        }

        .mk-survey-inline-banner {
            display: none;
            background: rgba(var(--mk-accent-rgb, 71, 70, 180), .08);
            border: 1px solid rgba(var(--mk-accent-rgb, 71, 70, 180), .2);
            border-radius: 10px;
            padding: 12px 16px;
            margin-top: 12px;
            font-size: .88rem;
            animation: mkSFadeIn .5s ease;
        }

        .mk-survey-inline-banner a {
            color: var(--mk-accent, #4746B4);
            font-weight: 600;
            text-decoration: none;
            margin-inline-start: 4px;
        }

        .mk-survey-inline-banner a:hover {
            text-decoration: underline;
        }

        /* ============================
       Stage 3 — Floating Card
       ============================ */
        #mkSurveyFloatingCard {
            position: fixed;
            bottom: 24px;
            inset-inline-end: 24px;
            z-index: 9999;
            opacity: 0;
            transform: translateY(20px);
            transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            pointer-events: none;
        }

        #mkSurveyFloatingCard.mk-s3-visible {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        .mk-s3-card {
            background: var(--bs-body-bg, #fff);
            border: 1px solid var(--bs-border-color, #dee2e6);
            border-radius: 14px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
            padding: 20px;
            display: flex;
            align-items: flex-start;
            gap: 14px;
            max-width: 380px;
            position: relative;
        }

        .mk-s3-close {
            position: absolute;
            top: 8px;
            inset-inline-end: 10px;
            background: none;
            border: none;
            color: var(--bs-secondary-color, #6c757d);
            font-size: 0.85rem;
            cursor: pointer;
            padding: 4px;
            line-height: 1;
            opacity: 0.6;
            transition: opacity 0.2s;
        }

        .mk-s3-close:hover {
            opacity: 1;
        }

        .mk-s3-icon {
            font-size: 2rem;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .mk-s3-body {
            flex: 1;
            padding-inline-end: 16px;
        }

        .mk-s3-title {
            margin: 0 0 10px;
            font-size: 0.9rem;
            line-height: 1.5;
            color: var(--bs-body-color);
        }

        .mk-s3-cta {
            background: var(--mk-accent-solid, #4746B4);
            color: #fff;
            border: none;
            padding: 8px 18px;
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            box-shadow: none;
            transition: transform .2s, box-shadow .2s, filter .2s;
        }

        .mk-s3-cta:hover {
            transform: translateY(-1px);
            box-shadow: none;
            filter: brightness(1.05);
        }

        @media (max-width: 480px) {
            #mkSurveyFloatingCard {
                bottom: 12px;
                inset-inline-end: 12px;
                left: 12px;
            }

            .mk-s3-card {
                max-width: 100%;
            }
        }

/* ── Language switcher ─────────────────────────────────────────────── */
.lang-menu.hdr-dd-menu { width: 260px !important; padding: .4rem !important; }
.lang-menu__head {
  padding: .35rem .6rem .45rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--bs-secondary-color);
}
.lang-menu form { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.lang-menu__item {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .45rem .6rem;
  border: 0; border-radius: 10px; background: none; color: var(--bs-body-color); text-align: start; cursor: pointer;
  transition: background .12s;
}
.lang-menu__item:hover, .lang-menu__item:focus-visible { background: rgba(var(--bs-primary-rgb), .08); outline: none; }
.lang-menu__code {
  flex: none; width: 30px; height: 24px; display: grid; place-items: center; border-radius: 6px;
  font-size: .66rem; font-weight: 700; letter-spacing: .04em; color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color);
}
.lang-menu__names { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.lang-menu__native { font-size: .88rem; font-weight: 600; }
.lang-menu__en { font-size: .72rem; color: var(--bs-secondary-color); }
.lang-menu__check { flex: none; font-size: .7rem; color: var(--bs-primary); visibility: hidden; }
.lang-menu__item.is-current { background: rgba(var(--bs-primary-rgb), .12); }
.lang-menu__item.is-current .lang-menu__code { color: var(--bs-primary); border-color: rgba(var(--bs-primary-rgb), .45); background: rgba(var(--bs-primary-rgb), .1); }
.lang-menu__item.is-current .lang-menu__native { color: var(--bs-primary); }
.lang-menu__item.is-current .lang-menu__check { visibility: visible; }

/* Make scrollable tables the containing block for absolutely-positioned
   children (e.g. Bootstrap's .visually-hidden column labels). Without this,
   under RTL those children land outside the scroll container, are not clipped
   by it, and widen the whole document: on mobile the page renders shifted
   sideways (seen on the Audio Studio project list). */
.table-responsive { position: relative; }

/* ════════════════════════════════════════════════════
   APP FRAME — list pages keep their chrome on screen.
   On list pages (base_page.html) the title, stats, filters, toolbar and
   pagination stay put and the table rows scroll inside the card.
   Rule: this is only used when it actually fits. If the page cannot fit the
   screen (short phones with stats + filters), middle_page.html's framer adds
   .mk-frame-off and the page simply scrolls like a normal page: never a
   scrolling box inside a scrolling page. Form pages are never boxed.
   ════════════════════════════════════════════════════ */
.app-content:has(> .mk-page-wrap > .mk-card):not(:has(> .mk-frame-off)) {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.app-content > .mk-page-wrap:has(> .mk-card):not(.mk-frame-off) {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;   /* flex items otherwise grow to their widest table */
  width: 100%;    /* auto inline margins would shrink-wrap it to the table */
  align-self: center;
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
}
.app-content > .mk-page-wrap:not(.mk-frame-off) > * { flex: none; min-width: 0; max-width: 100%; }

.app-content > .mk-page-wrap:not(.mk-frame-off) > .mk-card {
  flex: 1 1 auto;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.mk-page-wrap:not(.mk-frame-off) > .mk-card > * { flex: none; min-width: 0; }
.mk-page-wrap:not(.mk-frame-off) > .mk-card > #content-holder {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mk-page-wrap:not(.mk-frame-off) > .mk-card > #content-holder > * { flex: none; min-width: 0; }
.mk-page-wrap:not(.mk-frame-off) > .mk-card > #content-holder > .table-responsive {
  flex: 1 1 auto;
  min-height: 200px;
  overflow: auto;
  padding-top: 0 !important;
}
.mk-page-wrap:not(.mk-frame-off) > .mk-card > #content-holder > .table-responsive > table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bs-body-bg);
  box-shadow: inset 0 -1px 0 var(--bs-border-color);
}

/* Custom pages: sticky title row (set by the framer in middle_page.html). */
.mk-sticky-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--mk-bg, var(--bs-body-bg));
  padding-block: .75rem;
  box-shadow: 0 1px 0 var(--bs-border-color);
}

/* App frame on phones: keep the fixed part short so the content card gets
   the room. Stat cards become one swipeable row instead of a 2x2 grid. */
@media (max-width: 767.98px) {
  .mk-page-wrap > .mk-stats-row {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    margin-bottom: 12px !important;
  }
  .mk-page-wrap > .mk-stats-row::-webkit-scrollbar { display: none; }
  .mk-page-wrap > .mk-stats-row > * { flex: 0 0 46% !important; max-width: 46% !important; scroll-snap-align: start; }
  .mk-page-wrap > .mk-stats-row .stat-card,
  .mk-page-wrap > .mk-stats-row [class*="stat-card"] { padding-block: 10px !important; }
  .mk-page-wrap > .mk-page-header { margin-bottom: .9rem; }
}
