html, body {
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}
body.maq-trial-entry {
    margin: 0;
    color: var(--text-main);
    font-family: "Tajawal", "Cairo", sans-serif;
    background:
        radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 58%),
        var(--bg-core, #0f1720);
    overscroll-behavior: none;
    touch-action: manipulation;
}
.maq-trial-entry-header {
    position: absolute;
    top: 0;
    inset-inline: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 10px;
    padding: max(10px, calc(env(safe-area-inset-top) + 4px)) 14px 8px;
    pointer-events: none;
}
.maq-trial-entry-header .theme-toggle,
.maq-trial-entry-back,
.maq-trial-header-logo {
    pointer-events: auto;
}
.maq-trial-entry-back {
    grid-column: 1;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 82%, transparent);
    color: var(--text-main);
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.maq-trial-header-logo {
    grid-column: 2;
    justify-self: center;
    display: block;
    height: 40px;
    width: auto;
}
:root:not([data-theme="light"]) .maq-trial-header-logo {
    filter: brightness(0) invert(1);
}
.maq-trial-entry-header .theme-toggle {
    grid-column: 3;
    justify-self: end;
}
.maq-trial-entry-main {
    box-sizing: border-box;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding:
        max(62px, calc(env(safe-area-inset-top) + 50px))
        12px
        max(14px, env(safe-area-inset-bottom));
    overflow: hidden;
}
.maq-trial-entry-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(100%, 400px);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    padding: 14px 12px 12px;
    border-radius: 26px;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 90%, transparent);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}
.maq-trial-entry-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 0 10px;
    padding: 2px 0 4px;
    border: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}
.maq-trial-title-frame {
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background:
        linear-gradient(
            165deg,
            rgba(255, 255, 255, 0.14) 0%,
            rgba(255, 255, 255, 0.07) 55%,
            rgba(255, 255, 255, 0.04) 100%
        );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 10px 22px -16px rgba(0, 0, 0, 0.5);
}
.maq-trial-entry-head h1 {
    margin: 0;
    min-width: 0;
    flex: 0 1 auto;
    font-family: "Tajawal", "Cairo", sans-serif;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.maq-trial-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-rows: max-content minmax(0, 1fr);
    align-content: stretch;
    gap: 10px;
    overflow: hidden;
}
.maq-trial-section {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.maq-trial-section.is-playback {
    align-self: start;
    height: fit-content;
    max-height: none;
    overflow: visible;
}
.maq-trial-section.is-live {
    min-height: 0;
    height: 100%;
}
/* بث فعّال الآن: المسجّلة مقفلة + بلور، والمباشرة مفعّلة أسفلها */
body.maq-trial-live-now .maq-trial-section.is-playback.is-locked,
body.maq-trial-live-now .maq-trial-section.is-playback.is-dimmed {
    opacity: 0.52;
    filter: blur(1.2px) saturate(0.8);
    transition: opacity 0.35s ease, filter 0.35s ease;
    pointer-events: none;
    user-select: none;
}
body.maq-trial-live-now .maq-trial-section.is-playback.is-locked .maq-trial-item.is-locked,
body.maq-trial-live-now .maq-trial-item.is-locked {
    pointer-events: none;
}
body.maq-trial-live-now .maq-trial-btn.is-enter.is-locked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: not-allowed;
    opacity: 0.9;
    background: color-mix(in srgb, var(--text-sec) 18%, transparent);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-sec);
    box-shadow: none;
    pointer-events: none;
}
body.maq-trial-live-now .maq-trial-section.is-live.is-live-priority {
    border-color: color-mix(in srgb, #e25555 45%, rgba(255, 255, 255, 0.16));
    background:
        linear-gradient(180deg, color-mix(in srgb, #e25555 12%, transparent), transparent 42%),
        rgba(255, 255, 255, 0.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px color-mix(in srgb, #e25555 22%, transparent),
        0 10px 28px rgba(226, 85, 85, 0.16);
}
body.maq-trial-live-now .maq-trial-section.is-live.is-live-priority .maq-trial-section-head {
    background: color-mix(in srgb, #e25555 10%, transparent);
}
body.maq-trial-live-now .maq-trial-section.is-live.is-live-priority .maq-trial-btn.is-enter:not(.is-locked) {
    background: linear-gradient(135deg, #e25555, #c43d3d);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 18px rgba(226, 85, 85, 0.28);
}
.maq-trial-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border-radius: 14px;
}
.maq-trial-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
    flex-shrink: 0;
}
.maq-trial-section.is-live .maq-trial-section-icon {
    border-color: color-mix(in srgb, #e25555 30%, transparent);
    background: color-mix(in srgb, #e25555 14%, transparent);
    color: #e25555;
}
.maq-trial-section-copy {
    min-width: 0;
    flex: 1;
}
.maq-trial-section-copy h2 {
    margin: 0;
    font-family: "Tajawal", "Cairo", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.maq-trial-section-copy span {
    display: block;
    margin-top: 6px;
    color: var(--text-sec);
    font-family: "Tajawal", sans-serif;
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.maq-trial-empty[hidden] {
    display: none !important;
}
.maq-trial-empty {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 10px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 55%, transparent);
    color: var(--text-sec);
    font-family: "Tajawal", sans-serif;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.maq-trial-section.is-live .maq-trial-empty {
    flex: 1 1 auto;
}
.maq-trial-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
}
.maq-trial-section.is-playback .maq-trial-list {
    flex: 0 0 auto;
    overflow: visible;
}
.maq-trial-section.is-live .maq-trial-list {
    flex: 1 1 auto;
    min-height: 0;
    /* تمرير داخلي فقط عند امتلاء مواعيد البث — لا تمرير وهمي والمساحة فارغة */
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.maq-trial-section.is-live .maq-trial-list:empty {
    overflow: hidden;
}
.maq-trial-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--border-glass) 80%, transparent);
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}
.maq-trial-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.maq-trial-item-meta {
    min-width: 0;
    flex: 1;
}
.maq-trial-item-meta strong {
    display: block;
    font-family: "Tajawal", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.maq-trial-item-meta span {
    display: block;
    margin-top: 3px;
    color: var(--text-sec);
    font-family: "Tajawal", sans-serif;
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.maq-trial-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}
.maq-trial-chip.is-live {
    background: color-mix(in srgb, #e25555 14%, transparent);
    color: #e25555;
}
.maq-trial-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.maq-trial-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    border: 0;
    font-family: "Tajawal", sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.maq-trial-btn.is-enter {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--primary) 80%, transparent);
}
.maq-trial-btn.is-remind {
    background: transparent;
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 34%, transparent);
}
.maq-trial-btn.is-remind.is-on {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.maq-trial-btn:disabled {
    opacity: 0.65;
    cursor: default;
}
/* نفس نمط تلميح الميكروفون في قاعة الطالب */
.maq-trial-toast {
    position: fixed;
    left: 50%;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
    z-index: 40;
    white-space: nowrap;
    max-width: min(92vw, 360px);
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 6px 10px;
    border-radius: 10px;
    background: #2a3942;
    color: #e9edef;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    transform: translateX(-50%) translateY(4px);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.maq-trial-toast.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (max-width: 380px) {
    .maq-trial-entry-main { padding-inline: 10px; }
    .maq-trial-entry-card { padding: 14px 10px 12px; border-radius: 22px; }
    .maq-trial-header-logo { height: 36px; }
    .maq-trial-entry-head { padding: 0 0 2px; }
    .maq-trial-entry-head h1 { font-size: 0.88rem; }
    .maq-trial-section-copy span { margin-top: 5px; }
    .maq-trial-body { gap: 8px; }
    .maq-trial-section { padding: 8px; border-radius: 16px; }
    .maq-trial-btn { min-height: 40px; font-size: 0.84rem; }
}

/* نهاري هادئ خاص بلوحة التجريبية فقط — لا يؤثر خارج /maqamat/trial/board */
html[data-theme="light"] body.maq-trial-entry {
    --tb-ink: #1c1917;
    --tb-muted: #57534e;
    --tb-line: #d6d3d1;
    --tb-page: #f3eee4;
    --tb-card: #fffdf8;
    --tb-panel: #efe8db;
    --tb-tile: #ffffff;
    --tb-green: #00664d;
    --tb-green-soft: #e4f4ee;
    --tb-red: #b42318;
    --tb-red-soft: #fce8e6;
    color: var(--tb-ink);
    background:
        radial-gradient(120% 70% at 50% -8%, rgba(0, 102, 77, 0.1), transparent 55%),
        var(--tb-page);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-entry-back,
html[data-theme="light"] body.maq-trial-entry .theme-toggle {
    border: 1px solid #cfc8bc;
    background: #fffdf8;
    color: var(--tb-ink);
    box-shadow: 0 6px 14px -10px rgba(28, 25, 23, 0.28);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-entry-card {
    border: 1px solid #d6d0c4;
    background: var(--tb-card);
    box-shadow: 0 16px 32px -18px rgba(28, 25, 23, 0.28);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-entry-head h1 {
    color: var(--tb-ink);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-section {
    border: 1px solid #d2cbbf;
    background: var(--tb-panel);
    box-shadow: none;
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-title-frame {
    border: 1px solid #d2cbbf;
    background: var(--tb-tile);
    box-shadow: 0 4px 12px -10px rgba(28, 25, 23, 0.22);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-section-copy h2,
html[data-theme="light"] body.maq-trial-entry .maq-trial-item-meta strong {
    color: var(--tb-ink);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-section-copy span,
html[data-theme="light"] body.maq-trial-entry .maq-trial-item-meta span,
html[data-theme="light"] body.maq-trial-entry .maq-trial-empty {
    color: var(--tb-muted);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-section-icon {
    border-color: color-mix(in srgb, var(--tb-green) 35%, #fff);
    background: var(--tb-green-soft);
    color: var(--tb-green);
}
html[data-theme="light"] body.maq-trial-entry.maq-trial-live-now .maq-trial-section.is-playback.is-locked,
html[data-theme="light"] body.maq-trial-entry.maq-trial-live-now .maq-trial-section.is-playback.is-dimmed {
    opacity: 0.5;
}
html[data-theme="light"] body.maq-trial-entry.maq-trial-live-now .maq-trial-btn.is-enter.is-locked {
    background: color-mix(in srgb, var(--text-sec) 12%, #fff);
    border-color: var(--border-glass);
    color: var(--text-sec);
}
html[data-theme="light"] body.maq-trial-entry.maq-trial-live-now .maq-trial-section.is-live.is-live-priority {
    border-color: color-mix(in srgb, #e25555 35%, var(--border-glass));
    background:
        linear-gradient(180deg, color-mix(in srgb, #e25555 8%, transparent), transparent 40%),
        color-mix(in srgb, var(--glass) 80%, #fff);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-section.is-live .maq-trial-section-icon {
    border-color: color-mix(in srgb, var(--tb-red) 28%, #fff);
    background: var(--tb-red-soft);
    color: var(--tb-red);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-empty {
    border: 1px dashed #cfc8bc;
    background: #f7f2e8;
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-item {
    border: 1px solid #d2cbbf;
    background: var(--tb-tile);
    box-shadow: 0 6px 14px -12px rgba(28, 25, 23, 0.22);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-chip {
    background: var(--tb-green-soft);
    color: var(--tb-green);
    border: 1px solid #b7e0d2;
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-chip.is-live {
    background: var(--tb-red-soft);
    color: var(--tb-red);
    border: 1px solid #f0c2bc;
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-btn.is-enter {
    background: var(--tb-green);
    color: #fff;
    box-shadow: 0 10px 18px -12px rgba(0, 102, 77, 0.45);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-btn.is-remind {
    background: #fffdf8;
    color: var(--tb-green);
    border: 1px solid color-mix(in srgb, var(--tb-green) 45%, #fff);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-btn.is-remind.is-on {
    background: var(--tb-green-soft);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-toast {
    background: #2a3942;
    color: #e9edef;
}

/* شاشة ما بعد التجربة — نفس شكل بطاقة الاشتراك في القاعة */
.maq-trial-next-card {
    justify-content: flex-start;
}
.maq-trial-next-lead {
    margin: 0 0 18px;
    color: var(--text-sec);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.55;
    text-align: center;
}
.maq-trial-next-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.maq-trial-next-wa {
    margin-top: auto;
    padding-top: 18px;
    text-align: center;
}
.maq-trial-next-wa p {
    margin: 0 0 10px;
    color: var(--text-sec);
    font-size: 0.8rem;
    font-weight: 500;
}
.maq-trial-btn.is-wa {
    background: #1f9f52;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: none;
}
.maq-trial-subscribe-card {
    width: min(100%, 360px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 22px 18px 18px;
    border-radius: 20px;
    background: color-mix(in srgb, #15202b 94%, #1c2c3a);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
}
.maq-trial-subscribe-kicker {
    margin: 0;
    color: #7dffc4;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.maq-trial-subscribe-card h1 {
    margin: 0;
    color: #e8eef2;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.55;
}
.maq-trial-subscribe-body {
    margin: 0;
    color: #9eb0bd;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.65;
}
.maq-trial-subscribe-preview {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #c5d0d8;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.55;
    text-align: right;
}
.maq-trial-subscribe-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    margin-top: 4px;
    padding: 0 16px;
    border-radius: 999px;
    background: #1f9f52;
    color: #ffffff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}
.maq-trial-subscribe-wa i { color: #ffffff; font-size: 1.05rem; }
.maq-trial-subscribe-decline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #d7e0e7;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}
.maq-trial-subscribe-back {
    color: #8b98a5;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-top: 2px;
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-next-lead,
html[data-theme="light"] body.maq-trial-entry .maq-trial-next-wa p {
    color: var(--tb-muted, #57534e);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-subscribe-card {
    background: #fff;
    border-color: rgba(15, 23, 32, 0.08);
    box-shadow: 0 14px 32px rgba(15, 23, 32, 0.08);
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-subscribe-card h1 { color: #1c2c3a; }
html[data-theme="light"] body.maq-trial-entry .maq-trial-subscribe-body { color: #5b6b76; }
html[data-theme="light"] body.maq-trial-entry .maq-trial-subscribe-preview {
    background: #f4f7f9;
    border-color: rgba(15, 23, 32, 0.06);
    color: #3d4b55;
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-subscribe-decline {
    border-color: rgba(15, 23, 32, 0.12);
    color: #2a3942;
}
html[data-theme="light"] body.maq-trial-entry .maq-trial-subscribe-back { color: #6b7a86; }

/* اختيار الباقة */
.maq-pkg-board.maq-trial-entry-card {
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    width: min(100%, 390px);
    max-width: 390px;
    height: min(844px, calc(100dvh - max(76px, calc(env(safe-area-inset-top) + 64px)) - max(14px, env(safe-area-inset-bottom))));
    min-height: 0;
    max-height: 844px;
}
body.maq-trial-entry:has(.maq-pkg-board) .maq-trial-entry-header {
    width: min(100%, 390px);
    margin-inline: auto;
}
body.maq-trial-entry:has(.maq-pkg-board) .maq-trial-entry-main {
    width: min(100%, 390px);
    margin-inline: auto;
}
.maq-pkg-board {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.maq-pkg-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 10px;
    padding: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--glass) 78%, transparent);
    border: 1px solid var(--border-glass);
    flex: 0 0 auto;
}
.maq-pkg-tab {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-sec);
    font-family: "Tajawal", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.maq-pkg-tab.is-on {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
    color: var(--primary);
    box-shadow: 0 6px 16px -12px color-mix(in srgb, var(--primary) 70%, transparent);
}
.maq-plan {
    --plan-ink: #ffffff;
    --plan-soft: #b6e0c8;
    --plan-gold: #ffe9a8;
    --plan-gold-deep: #f0d78a;
    --plan-line: rgba(255, 255, 255, 0.14);
    --plan-check: #7ee7b8;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 0 14px;
    border-radius: 36px;
    border: 1px solid rgba(95, 212, 162, 0.22);
    overflow: hidden;
    isolation: isolate;
    color: var(--plan-ink);
    background:
        radial-gradient(ellipse 85% 42% at 50% -4%, rgba(46, 150, 110, 0.5), transparent 55%),
        linear-gradient(180deg, #1a4033 0%, #123028 52%, #14322c 100%);
    box-shadow:
        0 28px 60px -34px rgba(0, 0, 0, 0.85),
        inset 0 1px 0 rgba(255, 233, 168, 0.08);
}
.maq-plan::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 84%, rgba(255, 233, 168, 0.06), transparent 28%),
        radial-gradient(circle at 90% 68%, rgba(46, 150, 110, 0.12), transparent 26%);
}
.maq-plan-band {
    position: relative;
    flex: 0 0 auto;
}
.maq-plan-gift {
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 36px;
    inset-inline-start: 18px;
    width: 64px;
    height: auto;
    padding: 14px 6px 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    color: #0c1c16;
    background: linear-gradient(180deg, #ffe9a8 0%, #f3d98a 100%);
    border-start-start-radius: 36px;
    border-start-end-radius: 0;
    border-end-start-radius: 999px;
    border-end-end-radius: 999px;
    box-shadow: 0 14px 22px -16px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}
.maq-plan-gift-label {
    font-family: "Cairo", "Tajawal", sans-serif;
    font-size: 1.08rem;
    font-weight: 500;
    line-height: 1;
}
.maq-plan-gift-value {
    display: flex;
    flex-direction: row;
    direction: ltr;
    align-items: baseline;
    gap: 1px;
    font-family: "Cairo", "Tajawal", sans-serif;
    font-size: 1.38rem;
    font-weight: 500;
    line-height: 1;
}
.maq-plan-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: stretch;
    margin: 0 0 12px;
    padding: 0;
    flex: 0 0 auto;
    border-radius: 35px 35px 0 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -1px 0 rgba(255, 233, 168, 0.32);
}
.maq-plan-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding-block: 16px;
    padding-inline-end: 16px;
    padding-inline-start: 78px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.maq-plan-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 0;
    flex: 1;
    text-align: center;
}
.maq-plan-title {
    margin: 0;
    width: 100%;
    font-family: "Cairo", "Tajawal", sans-serif;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--plan-gold);
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-align: center;
}
.maq-plan-rate {
    --rate-stack-gap: 3px;
    --rate-gold-line: rgba(255, 233, 168, 0.32);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 12px;
    padding: 6px 18px 6px;
    padding-inline-start: 82px;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}
.maq-plan-rate-main {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: var(--rate-stack-gap);
    flex: 0 0 auto;
    width: max-content;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transform: translateX(-14px);
}
.maq-plan-rate-main strong {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: "Cairo", "Tajawal", sans-serif;
    font-size: 3.55rem;
    font-weight: 800;
    color: var(--plan-gold);
    line-height: 0.95;
    letter-spacing: 0.02em;
    text-shadow: none;
}
.maq-plan-rate-main strong .maq-plan-dot {
    display: inline-block;
    width: 0.2em;
    height: 0.2em;
    margin: 0 0.02em 0 0.06em;
    border-radius: 50%;
    background: currentColor;
    vertical-align: baseline;
    transform: translateY(0.02em);
}
.maq-plan-rate-main > span {
    display: block;
    align-self: flex-end;
    margin-top: 0;
    font-family: "Tajawal", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 233, 168, 0.78);
    line-height: 1;
}
.maq-plan-feats-label {
    position: relative;
    z-index: 1;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    margin: -2px 0 0;
    padding: 8px 18px 10px;
    box-sizing: border-box;
    text-align: center;
    font-family: "Cairo", "Tajawal", sans-serif;
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--plan-gold);
    letter-spacing: 0.01em;
    background: rgba(8, 22, 18, 0.45);
    border-block: 1px solid rgba(255, 233, 168, 0.42);
    box-shadow: none;
}
.maq-plan-list {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 4px 18px 2px;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}
.maq-plan-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--plan-line);
    color: var(--plan-ink);
    font-family: "Tajawal", sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    min-height: 0;
    flex: 0 0 auto;
}
.maq-plan-list li:last-child {
    border-bottom: 0;
}
.maq-plan-list li span {
    min-width: 0;
    flex: 1;
    overflow: visible;
    white-space: normal;
    text-align: start;
    color: rgba(255, 255, 255, 0.92);
}
.maq-plan-list i {
    flex: 0 0 auto;
    width: 1em;
    color: var(--plan-check);
    font-size: 0.82rem;
}
.maq-pkg-actions {
    margin-top: 10px;
    flex: 0 0 auto;
}
.maq-pkg-actions .maq-trial-btn {
    border-radius: 999px;
}
html[data-theme="light"] body.maq-trial-entry .maq-pkg-board.maq-trial-entry-card {
    background: transparent;
}
html[data-theme="light"] body.maq-trial-entry .maq-pkg-tabs {
    background: #fff;
    border-color: #e7e5e4;
}
html[data-theme="light"] body.maq-trial-entry .maq-pkg-tab {
    color: var(--tb-muted, #57534e);
}
html[data-theme="light"] body.maq-trial-entry .maq-pkg-tab.is-on {
    background: color-mix(in srgb, var(--primary) 10%, #fff);
    color: var(--primary);
}
html[data-theme="light"] body.maq-trial-entry .maq-plan {
    border-color: rgba(255, 255, 255, 0.08);
    color: #f4faf7;
}
html[data-theme="light"] body.maq-trial-entry .maq-pend-summary span {
    color: var(--tb-muted, #57534e);
}
html[data-theme="light"] body.maq-trial-entry .maq-pkg-tabs {
    background: #fff;
}
html[data-theme="light"] body.maq-trial-entry .maq-pkg-tab {
    background: transparent;
}
html[data-theme="light"] body.maq-trial-entry .maq-pkg-tab.is-on {
    background: color-mix(in srgb, var(--primary) 10%, #fff);
}

.maq-pay-card.maq-trial-entry-card {
    width: min(100%, 390px);
    max-width: 390px;
    height: min(844px, calc(100dvh - max(76px, calc(env(safe-area-inset-top) + 64px)) - max(14px, env(safe-area-inset-bottom))));
    min-height: 0;
    max-height: 844px;
    padding: 10px 12px 10px;
    justify-content: flex-start;
    overflow: hidden;
}
body.maq-trial-entry:has(.maq-pay-card) .maq-trial-entry-header,
body.maq-trial-entry:has(.maq-pay-card) .maq-trial-entry-main {
    width: min(100%, 390px);
    margin-inline: auto;
}
.maq-pay-card .maq-trial-entry-head {
    margin: 0 0 4px;
    padding: 0;
}
.maq-pay-card .maq-trial-entry-head h1 {
    font-size: 1.05rem;
    margin: 0;
}
.maq-pay-card .maq-trial-next-lead {
    margin: 0 0 8px;
    font-size: 0.78rem;
    line-height: 1.35;
}
.maq-pay-card .maq-pend-summary {
    margin: 0 0 8px;
    gap: 5px;
    flex: 0 0 auto;
}
.maq-pay-card .maq-pend-summary li {
    padding: 7px 10px;
    border-radius: 12px;
}
.maq-pay-card .maq-pend-summary span {
    font-size: 0.72rem;
}
.maq-pay-card .maq-pend-summary strong {
    font-size: 0.82rem;
}
.maq-pay-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 8px;
    flex: 0 0 auto;
}
.maq-pay-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 70%, transparent);
    color: var(--text);
    font-family: "Cairo", "Tajawal", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.maq-pay-method img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.maq-pay-method.is-on {
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    color: var(--primary);
}
.maq-pay-method:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.maq-pay-number-box {
    margin: 0 0 8px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 65%, transparent);
    flex: 0 0 auto;
}
.maq-pay-number-k {
    margin: 0 0 6px;
    color: var(--text-sec);
    font-size: 0.72rem;
    font-weight: 600;
}
.maq-pay-number {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 11px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--text);
    cursor: pointer;
    font: inherit;
}
.maq-pay-number strong {
    direction: ltr;
    unicode-bidi: isolate;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.maq-pay-number span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
}
.maq-pay-hint {
    margin: 6px 0 0;
    color: var(--text-sec);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
}
.maq-pay-steps {
    margin: 0 0 8px;
    padding: 0 16px 0 0;
    color: var(--text-sec);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.4;
    flex: 1 1 auto;
    min-height: 0;
}
.maq-pay-steps li + li {
    margin-top: 2px;
}
.maq-pay-card .maq-trial-next-actions {
    margin-top: auto;
    gap: 7px;
    flex: 0 0 auto;
}
.maq-pay-card .maq-trial-btn {
    min-height: 42px;
    font-size: 0.84rem;
}
html[data-theme="light"] body.maq-trial-entry .maq-pay-hint,
html[data-theme="light"] body.maq-trial-entry .maq-pay-number-k,
html[data-theme="light"] body.maq-trial-entry .maq-pay-steps {
    color: var(--tb-muted, #57534e);
}

.maq-pend-summary {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.maq-pend-summary li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 65%, transparent);
}
.maq-pend-summary span {
    color: var(--text-sec);
    font-size: 0.78rem;
    font-weight: 500;
}
.maq-pend-summary strong {
    font-size: 0.88rem;
    font-weight: 700;
}
html[data-theme="light"] body.maq-trial-entry .maq-pend-summary span {
    color: var(--tb-muted, #57534e);
}

/* تسجيل الطالب */
.maq-signup-card {
    justify-content: flex-start;
    overflow: auto;
}
.maq-signup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.maq-signup-card .maq-trial-next-lead {
    margin-bottom: 12px;
}
.maq-signup-row {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
    gap: 10px;
}
.maq-signup-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.maq-signup-field > span:first-child {
    color: color-mix(in srgb, var(--text-main) 72%, var(--text-sec));
    font-size: 0.8rem;
    font-weight: 700;
    padding-inline: 2px;
}
.maq-signup-input {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 72%, transparent);
}
.maq-signup-input:focus-within {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border-glass));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.maq-signup-input i {
    color: var(--primary);
    font-size: 0.9rem;
    width: 1em;
    text-align: center;
    flex: 0 0 auto;
}
.maq-signup-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-family: "Tajawal", sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
}
.maq-signup-input input::placeholder {
    color: color-mix(in srgb, var(--text-sec) 78%, transparent);
    font-weight: 500;
}
.maq-signup-hint {
    margin: -2px 0 0;
    color: var(--text-sec);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.45;
}
.maq-signup-error {
    margin: 0;
    color: #e25555;
    font-size: 0.84rem;
    font-weight: 600;
}
.maq-signup-form .maq-trial-btn {
    margin-top: auto;
}
.maq-signup-choice {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.maq-signup-choice-label {
    color: color-mix(in srgb, var(--text-main) 72%, var(--text-sec));
    font-size: 0.8rem;
    font-weight: 700;
    padding-inline: 2px;
}
.maq-signup-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.maq-signup-chip {
    min-height: 40px;
    padding: 0 8px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: color-mix(in srgb, var(--glass) 72%, transparent);
    color: var(--text-main);
    font-family: "Tajawal", sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}
.maq-signup-chip.is-on {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border-glass));
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}
.maq-signup-field em {
    font-style: normal;
    font-weight: 500;
    opacity: 0.72;
}
.maq-signup-soft[hidden],
.maq-signup-child-note[hidden],
#signup-phone-wrap[hidden] {
    display: none !important;
}
.maq-signup-child-note {
    margin: 0;
    padding: 8px 11px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border-glass));
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: color-mix(in srgb, var(--primary) 55%, var(--text-main));
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}
html[data-theme="light"] body.maq-trial-entry .maq-signup-child-note {
    background: color-mix(in srgb, var(--primary) 9%, #fff);
    color: color-mix(in srgb, var(--primary) 35%, #292524);
}
html[data-theme="light"] body.maq-trial-entry .maq-signup-choice-label {
    color: var(--tb-muted, #57534e);
}
html[data-theme="light"] body.maq-trial-entry .maq-signup-chip {
    background: #fff;
    border-color: #e7e5e4;
}
html[data-theme="light"] body.maq-trial-entry .maq-signup-chip.is-on {
    background: color-mix(in srgb, var(--primary) 10%, #fff);
}
html[data-theme="light"] body.maq-trial-entry .maq-signup-field > span:first-child,
html[data-theme="light"] body.maq-trial-entry .maq-signup-hint {
    color: var(--tb-muted, #57534e);
}
html[data-theme="light"] body.maq-trial-entry .maq-signup-input {
    background: #fff;
    border-color: #e7e5e4;
}
@media (max-width: 360px) {
    .maq-signup-row {
        grid-template-columns: 1fr;
    }
}
