:root {
    --primary-color: #00d4ff;
    --secondary-color: #0055ff;
    --bg-dark: #0a0b10;
    --card-bg: #161b22;
    --text-light: #e6edf3;
}

html[data-theme="light"] {
    color-scheme: light;
    background: #f4f7fb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* الشعار */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-svg {
    width: 50px;
    height: 50px;
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 2;
}

/* الهيدر */
header {
    padding: 20px 5%;
    justify-content: space-around;
    align-items: center;
    background: rgba(10, 11, 16, 0.9);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #30363d;
}

nav a {
    color: rgb(252, 247, 247);
    text-decoration: none;
    margin-right: 20px;
    transition: 0.3s;
}

nav a:hover {
    color: var(--primary-color);
}

#sidebar-toggle {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    border: 1px solid rgba(0,212,255,0.18);
    background: rgba(10,11,16,0.95);
    color: var(--text-light);
    box-shadow: 0 10px 28px rgba(0,0,0,0.25);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-row {
    justify-content: space-between;
}

html[dir="ltr"] .header-brand {
    text-align: left;
}

html[dir="rtl"] .header-brand {
    text-align: right;
}

html[dir="ltr"] .sidebar-menu {
    left: auto;
    right: 0;
}

.header-icon-btn .menu-icon {
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.menu-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-logo-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.menu-logo-mark svg,
.menu-logo-mark .zim-mark {
    width: 28px;
    height: 26px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 2004;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 14px 5% 18px;
    background: rgba(10,14,22,0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 20px 46px rgba(0,0,0,0.14);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 1200px);
    gap: 12px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    backdrop-filter: blur(18px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    margin-bottom: 14px;
}

.header-icon-btn,
.header-control-btn,
.lang-btn {
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.05);
    color: #f8fafc;
    cursor: pointer;
    transition: transform 0.24s cubic-bezier(0.2, 1, 0.3, 1), background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.08), 0 14px 34px rgba(0,0,0,0.12);
}

.header-icon-btn {
    min-width: 48px;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(0,212,255,0.12));
    border-color: rgba(255,255,255,0.16);
    box-shadow: 0 16px 32px rgba(0,0,0,0.16);
}

.header-icon-btn svg,
.header-control-btn svg,
.lang-btn svg {
    width: 18px;
    height: 18px;
    display: inline-flex;
    stroke: currentColor;
    fill: currentColor;
}

.header-icon-btn .menu-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.header-icon-btn .menu-icon {
    font-size: 1.3rem;
    color: #f5f7ff;
}

.menu-logo-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.button-label {
    display: none;
}

.header-icon-btn:hover,
.header-control-btn:hover,
.lang-btn:hover {
    background: rgba(0,212,255,0.18);
    transform: translateY(-2px);
    border-color: rgba(0,212,255,0.35);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.14), 0 22px 40px rgba(0,212,255,0.18);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.header-actions button {
    min-width: 56px;
}

.header-actions #theme-toggle {
    order: 1;
}

.header-actions #lang-toggle {
    order: 2;
}

.header-actions #sidebar-toggle {
    order: 3;
}

.header-control-btn {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,212,255,0.18), rgba(0,116,255,0.22));
    border-color: rgba(0,212,255,0.32);
    box-shadow: 0 18px 36px rgba(0,212,255,0.16);
}

.lang-btn {
    min-width: 74px;
    height: 50px;
    border-radius: 999px;
    padding: 0 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}

.logo-text {
    font-size: 1.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #a259ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.08em;
}

body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(0,212,255,0.05), transparent 24%),
                radial-gradient(circle at bottom right, rgba(162,89,255,0.03), transparent 18%),
                var(--bg-dark);
    color-scheme: dark;
    transition: background 0.4s ease, color 0.4s ease;
}

header,
.site-header,
section,
#sidebar-menu,
.hero-card,
.sidebar-item,
.sidebar-submenu a,
.btn-contact,
.btn-buy,
footer {
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

#sidebar-toggle {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.16);
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(0,212,255,0.12));
    color: #f5f7ff;
    box-shadow: 0 16px 32px rgba(0,0,0,0.16);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.24s ease, background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

#sidebar-toggle:hover {
    transform: translateY(-2px);
    background: rgba(0,212,255,0.22);
    border-color: rgba(0,212,255,0.30);
    box-shadow: 0 18px 36px rgba(0,0,0,0.18);
}

#theme-toggle {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(0,212,255,0.27);
    background: linear-gradient(135deg, #181a1b 55%, #00d4ff 100%);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 22px rgba(0,212,255,0.2);
    transition: transform 0.22s ease, background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

#theme-toggle:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #00d4ff 45%, #0055ff 100%);
    box-shadow: 0 16px 30px rgba(0,212,255,0.24);
}

#lang-toggle {
    min-width: 72px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.12);
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0 18px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

#lang-toggle:hover {
    background: rgba(0,212,255,0.18);
    transform: translateY(-1px);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.header-brand {
    text-align: start;
    margin-top: 0;
}

.header-home-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.header-home-link:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.header-home-link:hover .zim-mark {
    filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.55));
}

.zim-mark {
    width: 64px;
    height: 59px;
    display: block;
    flex-shrink: 0;
    overflow: visible;
    background: none;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.35));
    transition: filter 0.4s ease, transform 0.35s ease;
}

.zim-mark-side {
    width: 46px;
    height: 42px;
}

.zim-mark-sm {
    width: 28px;
    height: 26px;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.28));
}

.zim-mark .zim-spark {
    transform-box: fill-box;
    transform-origin: center;
    animation: zim-spark 2.8s ease-in-out infinite;
}

@keyframes zim-spark {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.brand-logo,
.sidebar-logo-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 22px rgba(0, 212, 255, 0.28), inset 0 0 12px rgba(0, 255, 255, 0.08);
    background: #05080d;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.1;
}

a.sidebar-logo {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(0,212,255,0.18), transparent 30%),
                radial-gradient(circle at bottom left, rgba(162,89,255,0.12), transparent 22%);
    pointer-events: none;
    z-index: 0;
}

.site-header > * {
    position: relative;
    z-index: 1;
}

.logo-text {
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    display: inline-block;
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #e8ffff, #00d4ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    margin-top: 0;
    color: #e8f7ff;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.95;
}

.menu-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    transition: transform 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(12,16,22,0.94);
    color: #f5f7ff;
}

.sidebar-item:hover {
    transform: translateX(-4px);
    background: rgba(0,212,255,0.18);
    box-shadow: 0 18px 36px rgba(0,212,255,0.16);
}

.sidebar-item-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0,212,255,0.16), rgba(162,89,255,0.15));
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: inset 0 2px 6px rgba(255,255,255,0.08), 0 10px 20px rgba(0,212,255,0.08);
    color: #f8fcff;
    transition: transform 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.sidebar-item:hover .sidebar-item-icon {
    transform: scale(1.05);
    box-shadow: inset 0 2px 10px rgba(255,255,255,0.12), 0 14px 28px rgba(0,212,255,0.18);
}

.sidebar-item-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: currentColor;
}

.sidebar-item-icon svg path,
.sidebar-item-icon svg circle,
.sidebar-item-icon svg rect,
.sidebar-item-icon svg polygon,
.sidebar-item-icon svg line {
    stroke: currentColor;
    fill: currentColor;
}

.icon-btn {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 18px 42px rgba(0,0,0,0.16);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.icon-btn:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 22px 50px rgba(0,0,0,0.2);
}

.icon-btn svg {
    width: 26px;
    height: 26px;
}

.expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    color: #e8f7ff;
    transition: transform 0.28s ease, background 0.28s ease;
}

.sidebar-home-btn:hover .expand-icon {
    background: rgba(0,212,255,0.14);
}

.sidebar-home-btn[aria-expanded="true"] .expand-icon {
    transform: rotate(180deg);
}

.sidebar-submenu a {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    color: #dbe6ff;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.sidebar-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-logo-mark {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    color: #ffffff;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00d4ff, #a259ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-logo-text {
    font-size: 0.95rem;
    color: #e8f7ff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 800;
}

.sidebar-close {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sidebar-close:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.1);
    border-color: rgba(0,212,255,0.25);
}

.sidebar-home-btn {
    cursor: pointer;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    align-items: center;
}

.sidebar-home-btn:focus-visible {
    outline: 2px solid rgba(0,212,255,0.9);
    outline-offset: 2px;
}

.sidebar-item {
    pointer-events: auto;
}

.expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255,255,255,0.07);
    transition: transform 0.28s ease, background 0.28s ease;
}

.sidebar-home-btn:hover .expand-icon {
    background: rgba(0,212,255,0.16);
}

.sidebar-submenu {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.35s ease, transform 0.35s ease;
    max-height: 240px;
    opacity: 1;
    transform: translateY(0);
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-right: 4px;
}

[dir="ltr"] .sidebar-submenu {
    margin-left: 4px;
    margin-right: 0;
}

.sidebar-submenu.is-collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
}

.sidebar-submenu a {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    color: #dbe6ff;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
}

.sidebar-submenu a:hover {
    background: rgba(0,212,255,0.16);
    color: #ffffff;
}

#sidebar-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px 22px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.32s ease;
    will-change: transform;
    z-index: 2100;
    background: rgba(8,12,18,0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}

html[dir="ltr"] #sidebar-menu {
    left: auto;
    right: 0;
    transform: translateX(100%);
    border-left: 1px solid rgba(255,255,255,0.08);
    border-right: none;
}

body.sidebar-open #sidebar-menu {
    transform: translateX(0) !important;
}

body.sidebar-open .site-header {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.32);
    z-index: 2050;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

@media (max-width: 900px) {
    #sidebar-menu {
        width: min(100vw, 340px);
        padding: 26px 20px;
    }
}

@media (max-width: 640px) {
    #sidebar-menu {
        width: 100vw;
        max-width: 100vw;
        padding: 24px 18px;
        border-right: none;
        border-left: none;
    }
}

body.sidebar-open #sidebar-overlay,
#sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

.light-mode #sidebar-toggle {
    background: rgba(255,255,255,0.94);
    border-color: rgba(148,163,184,0.4);
    color: #111827;
}

.light-mode #sidebar-toggle .menu-logo-mark {
    background: transparent;
    box-shadow: none;
}

.light-mode .sidebar-menu {
    background: rgba(255,255,255,0.96);
}

.hero-card {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: center;
    background: rgba(255,255,255,0.07);
    border-radius: 26px;
    padding: 34px;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 36px 90px rgba(0,0,0,0.26);
    backdrop-filter: blur(14px);
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(255,255,255,0.04));
    pointer-events: none;
    z-index: -1;
}

.hero-content h1 {
    font-size: clamp(2.6rem, 4vw, 3.4rem);
    line-height: 1.02;
    color: #ffffff;
}

.hero-content p {
    font-size: 1.05rem;
    color: #b9cad8;
    max-width: 580px;
    margin: 20px 0 0;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    color: rgba(0,212,255,0.8);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.hero-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.hero-actions .btn-buy,
.hero-actions .btn-contact {
    padding: 11px 18px;
    font-size: 0.94rem;
}

.hero-visual {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(0,212,255,0.12);
    filter: blur(22px);
    top: 12%;
    right: 10%;
}

.hero-visual::after {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(162,89,255,0.14);
    filter: blur(24px);
    bottom: 10%;
    left: 8%;
}

.hero-glow {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: radial-gradient(circle at 40% 30%, rgba(0,212,255,0.18), transparent 40%),
                radial-gradient(circle at 75% 75%, rgba(162,89,255,0.16), transparent 35%);
}

.hero-panel {
    position: relative;
    width: 100%;
    max-width: 320px;
    padding: 28px;
    border-radius: 22px;
    background: rgba(7,10,16,0.98);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 24px 60px rgba(0,0,0,0.25);
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(0,212,255,0.18);
    color: #dffaff;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-stats {
    margin-top: 24px;
    display: grid;
    gap: 12px;
}

.hero-stats span {
    display: block;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    color: #cee3ff;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.12);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-buy {
    background: linear-gradient(135deg, #00d4ff, #0055ff);
    color: #fff;
    border: none;
}

.btn-buy:hover,
.btn-contact:hover {
    transform: translateY(-3px);
}

.btn-contact:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(0,212,255,0.25);
}

.btn-contact:hover {
    background: rgba(0,212,255,0.18);
    transform: translateY(-2px);
}

body.light-mode {
    background: #f8fafc;
    color: #111827;
    color-scheme: light;
    transition: background 0.4s ease, color 0.4s ease;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 12% 20%, rgba(0,212,255,0.14), transparent 18%),
                      radial-gradient(circle at 80% 10%, rgba(162,89,255,0.12), transparent 18%),
                      radial-gradient(circle at 60% 85%, rgba(255,255,255,0.04), transparent 16%);
}

body.light-mode {
    background-image: radial-gradient(circle at 10% 14%, rgba(59,130,246,0.12), transparent 18%),
                      radial-gradient(circle at 88% 12%, rgba(99,102,241,0.12), transparent 16%),
                      radial-gradient(circle at 70% 88%, rgba(37,99,235,0.08), transparent 14%);
}

.light-mode section,
.light-mode #sidebar-menu,
.light-mode .hero-card {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border: 1px solid rgba(148,163,184,0.2);
}

.light-mode section.hero-animate {
    background: rgba(248,250,252,0.95);
}

.light-mode .hero-panel {
    background: rgba(248,250,252,0.96);
    border-color: rgba(148,163,184,0.2);
    box-shadow: 0 26px 72px rgba(15,23,42,0.1);
}

.light-mode .hero-chip {
    background: rgba(59,130,246,0.14);
    color: #1e3a8a;
    border: 1px solid rgba(59,130,246,0.2);
}

.light-mode .hero-visual .hero-glow {
    background: radial-gradient(circle at 40% 30%, rgba(37,99,235,0.22), transparent 40%),
                radial-gradient(circle at 75% 75%, rgba(99,102,241,0.16), transparent 35%);
}

.light-mode .hero-card .hero-stats span {
    background: rgba(15,23,42,0.05);
    color: #334155;
}

.light-mode .sidebar-item,
.light-mode .sidebar-submenu a,
.light-mode .btn-contact {
    background: rgba(255,255,255,0.88);
    color: #0f172a;
}

.light-mode #theme-toggle {
    background: linear-gradient(135deg, #f8fafc 55%, #60a5fa 100%);
    border-color: #60a5fa;
    color: #0f172a;
}

.light-mode #lang-toggle {
    background: rgba(99,102,241,0.12);
    color: #0f172a;
}

.light-mode header,
.light-mode .site-header {
    background: rgba(248,250,252,0.94);
    color: #0f172a;
    border-bottom-color: rgba(148,163,184,0.25);
}

.light-mode .header-actions {
    opacity: 0.98;
}

.light-mode .header-icon-btn,
.light-mode .header-control-btn,
.light-mode .lang-btn {
    background: rgba(255,255,255,0.9);
    border-color: rgba(148,163,184,0.5);
    color: #0f172a;
}

.light-mode .logo-text {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.light-mode .logo-subtitle {
    color: #0f172a;
}

.light-mode .hero-content h1 {
    color: #0f172a;
    background: none !important;
    -webkit-text-fill-color: initial !important;
}

.light-mode .hero-content p,
.light-mode .eyebrow {
    color: #475569;
}

.light-mode .btn-buy {
    background: linear-gradient(135deg, #00b7e6, #2563eb 58%, #7c3aed);
    color: #ffffff;
}

.light-mode .btn-contact {
    background: rgba(37,99,235,0.1);
    color: #1e3a8a;
    border-color: rgba(37,99,235,0.28);
}

.light-mode .sidebar-item,
.light-mode .sidebar-submenu a {
    background: rgba(255,255,255,0.92);
    color: #0f172a;
}

.light-mode .sidebar-item:hover,
.light-mode .sidebar-submenu a:hover {
    background: rgba(37,99,235,0.14);
}

.light-mode .hero-card {
    box-shadow: 0 26px 72px rgba(15, 23, 42, 0.12);
}

.light-mode footer {
    background: rgba(248,250,252,0.96);
    color: #475569;
}

.light-mode .section-title {
    color: #0f172a;
}

.light-mode .section-title::after {
    background: rgba(37,99,235,0.35);
}

.light-mode .cv-grid > div,
.light-mode .about-card > * {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border-color: rgba(148,163,184,0.2);
    box-shadow: 0 18px 42px rgba(15,23,42,0.08);
}

.light-mode .cv-grid h3 {
    color: #2563eb;
}

.light-mode .skills-grid .skill-btn {
    background: rgba(148,163,184,0.12);
    color: #0f172a;
    border-color: rgba(148,163,184,0.25);
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
}

.light-mode .skills-grid .skill-btn:hover {
    background: rgba(59,130,246,0.14);
}

.light-mode .hero-panel {
    background: rgba(255,255,255,0.96);
    border-color: rgba(148,163,184,0.2);
    box-shadow: 0 24px 60px rgba(15,23,42,0.12);
}

.light-mode .hero-stats span {
    background: rgba(15,23,42,0.05);
    color: #334155;
}

.light-mode .ss .icon-btn {
    background: rgba(241,245,249,0.96);
    color: #0f172a;
    border-color: rgba(148,163,184,0.2);
}

.light-mode .ss .icon-btn:hover {
    background: linear-gradient(90deg,var(--primary-color),var(--secondary-color));
    color: #ffffff;
}

.light-mode a,
.light-mode .header-link {
    color: #2563eb;
}

.light-mode a:hover,
.light-mode .header-link:hover {
    color: #1d4ed8;
}

.light-mode .header-home-link,
.light-mode .header-home-link:hover,
.light-mode a.sidebar-logo,
.light-mode a.sidebar-logo:hover,
.light-mode .sidebar-item,
.light-mode .shop-library-chip {
    color: inherit;
}

@media (max-width: 900px) {
    .site-header {
        padding: 18px 4% 20px;
    }
    .header-row {
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }
    .header-brand {
        width: 100%;
        text-align: center;
        order: 1;
    }
    .header-home-link {
        justify-content: center;
    }
    .header-actions {
        width: 100%;
        justify-content: center;
        gap: 10px;
        order: 2;
        flex-wrap: wrap;
    }
    .header-control-btn,
    .header-icon-btn,
    .lang-btn {
        height: 44px;
        min-width: 44px;
        padding: 0 12px;
    }
    .header-control-btn {
        width: 44px;
    }
    .lang-btn {
        min-width: 64px;
    }
    .logo-text {
        font-size: clamp(2.4rem, 6vw, 3.5rem);
    }
    .logo-subtitle {
        font-size: 0.92rem;
    }
    .hero-card {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    .floating-btns {
        top: 16px;
        right: 16px;
        flex-direction: row;
    }
    section {
        padding: 60px 6%;
    }
    .hero-panel {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding: 16px 4% 18px;
    }
    .header-row {
        flex-direction: column;
        align-items: stretch;
    }
    .header-brand {
        width: 100%;
        margin-bottom: 12px;
        text-align: center;
    }
    .header-actions {
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    .header-control-btn,
    .header-icon-btn,
    .lang-btn {
        height: 42px;
        min-width: 42px;
        padding: 0 10px;
    }
    .lang-btn {
        min-width: 60px;
    }
    .header-actions button {
        font-size: 0.92rem;
    }
    .logo-text {
        font-size: clamp(2.2rem, 7vw, 3rem);
    }
    .logo-subtitle {
        font-size: 0.88rem;
    }
    .hero-card {
        padding: 20px;
        gap: 18px;
    }
    section {
        padding: 48px 4%;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .floating-btns {
        right: 12px;
    }
}

/* قسم الهيرو */
.hero {
    height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle at center, #112240 0%, #0a0b10 100%);
    padding: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to left, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: #8b949e;
    max-width: 600px;
}

/* توازن نص الهيرو بين اللغتين بدون تغيير حجم الصورة */
section.hero-animate h1 {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.2;
    margin: 0 auto 12px;
    max-width: 900px;
}

section.hero-animate p {
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.7;
    margin: 0 auto;
    max-width: 760px;
}

/* الأقسام */
section {
    padding: 80px 10%;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto;
}

.section-block {
    background: rgba(12,16,22,0.96);
    border-radius: 20px;
    margin: 24px 0;
    box-shadow: 0 18px 48px rgba(0,0,0,0.15);
    padding: 34px 36px;
    transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.light-mode .section-block {
    background: rgba(255,255,255,0.96);
    color: #0f172a;
    border: 1px solid rgba(148,163,184,0.25);
    box-shadow: 0 22px 60px rgba(15,23,42,0.1);
}

.light-mode .section-block .section-title {
    color: #0f172a;
}

.light-mode .section-block p,
.light-mode .section-block li,
.light-mode .section-block h3 {
    color: #334155;
}

.light-mode .section-block ul {
    border-color: rgba(148,163,184,0.18);
}

.light-mode .ss.section-block {
    background: rgba(255,255,255,0.96);
}

.light-mode .cv-grid {
    gap: 32px;
}

.light-mode .skills-grid {
    gap: 16px;
}

.light-mode .skills-grid .skill-btn {
    background: rgba(248,250,252,0.92);
    border-color: rgba(148,163,184,0.3);
    color: #0f172a;
}

.light-mode .skills-grid .skill-btn:hover {
    background: rgba(59,130,246,0.16);
    color: #0f172a;
}

.light-mode .ss .icon-btn {
    background: rgba(241,245,249,0.96);
    color: #0f172a;
    border-color: rgba(148,163,184,0.2);
}

/* السيرة الذاتية */
.cv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

#about h3,
#about p,
#about ul {
    text-align: right;
}

[dir="ltr"] #about h3,
[dir="ltr"] #about p,
[dir="ltr"] #about ul {
    text-align: left;
}

#about ul {
    padding-right: 20px;
    padding-left: 0;
}

[dir="ltr"] #about ul {
    padding-left: 20px;
    padding-right: 0;
}

/* القدرات التقنية */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 18px;
    justify-items: center;
}

.skills-grid .btn-buy {
    min-width: 110px;
    font-size: 0.92rem;
    padding: 9px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.skill-tag {
    background: #1264d8;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    font-size: 0.9rem;
}

.skill-btn {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 16px;
    padding: 10px 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: background 0.25s, color 0.25s, border 0.25s, transform 0.25s;
}

.skill-btn:hover {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border-color: var(--secondary-color);
    box-shadow: 0 4px 16px rgba(0,212,255,0.15);
    transform: translateY(-2px);
}

/* المتجر والخدمات */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 25px;
}

.product-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #30363d;
    transition: 0.4s;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}

.product-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.btn-buy {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 26px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}

.btn-buy:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.18);
}

.btn-buy,
.hero-actions .btn-buy,
.hero-actions .btn-contact {
    font-size: 0.94rem;
}

.login-primary {
    background: linear-gradient(135deg, #ff8a00 0%, #ff3d00 100%);
    border: 1px solid rgba(255, 122, 0, 0.6);
    box-shadow: 0 10px 24px rgba(255, 77, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.25);
}

.login-primary:hover {
    background: linear-gradient(135deg, #ff9a1a 0%, #ff4d1a 100%);
    box-shadow: 0 14px 28px rgba(255, 77, 0, 0.35), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* ===== ZIM Global Theme — Code Lab Aesthetic ===== */
body.tai-page,
body.codes-page {
    position: relative;
    min-height: 100vh;
}

.tai-bg,
.codes-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#tai-matrix,
#codes-matrix {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.55;
}

.codes-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: codesGlowFloat 8s ease-in-out infinite;
}

.codes-glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #00d4ff 0%, transparent 70%);
    top: -150px;
    left: -100px;
}

.codes-glow-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #a259ff 0%, transparent 70%);
    bottom: -100px;
    right: -80px;
    animation-delay: -3s;
    animation-duration: 11s;
}

.codes-glow-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #0055ff 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
    animation-duration: 14s;
}

@keyframes codesGlowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(20px, -30px) scale(1.08); opacity: 0.45; }
}

.codes-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.codes-section {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 5% 60px;
}

.codes-hero {
    text-align: center;
    margin-bottom: 32px;
}

.codes-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(0,212,255,0.08);
    border: 1px solid rgba(0,212,255,0.25);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    letter-spacing: 0.04em;
}

.codes-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--primary-color); }
    50% { opacity: 0.5; box-shadow: 0 0 16px var(--primary-color); }
}

.codes-main-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    background: linear-gradient(135deg, #00d4ff, #0055ff, #a259ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.codes-subtitle {
    color: #9aa4b2;
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}

.codes-workspace {
    display: grid;
    gap: 16px;
}

.codes-lab {
    position: relative;
}

.codes-free-hint {
    font-size: 0.78rem;
    font-weight: 700;
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}

.codes-paywall {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: rgba(6, 10, 18, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.codes-paywall[hidden] {
    display: none !important;
}

.codes-paywall.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.codes-pay-card {
    width: min(520px, 100%);
    padding: 28px 22px 22px;
    border-radius: 18px;
    text-align: center;
    background: linear-gradient(180deg, rgba(22, 28, 40, 0.98), rgba(13, 17, 23, 0.98));
    border: 1px solid rgba(0, 212, 255, 0.22);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(0, 212, 255, 0.08);
}

.codes-pay-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #041018;
    background: linear-gradient(135deg, #00d4ff, #7c5cff);
}

.codes-pay-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: #f8fbff;
}

.codes-pay-subtitle {
    margin: 0 auto 18px;
    max-width: 36ch;
    color: #9aa4b2;
    line-height: 1.7;
}

.codes-pay-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.codes-pay-amount {
    font-size: 2.4rem;
    font-weight: 800;
    color: #00d4ff;
    line-height: 1;
}

.codes-pay-period {
    color: #9aa4b2;
    font-weight: 700;
}

.codes-pay-choose {
    margin: 0 0 12px;
    font-weight: 700;
    color: #d7e3ef;
}

.codes-pay-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.codes-pay-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    border-radius: 14px;
    cursor: pointer;
    color: #f8fbff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Cairo', sans-serif;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.codes-pay-method:hover {
    transform: translateY(-3px);
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 10px 24px rgba(0, 85, 255, 0.2);
}

.codes-pay-method-icon {
    font-size: 1.25rem;
    color: #00d4ff;
}

.codes-pay-method-name {
    font-weight: 800;
    font-size: 0.92rem;
}

.codes-pay-method-hint {
    font-size: 0.72rem;
    color: #8b98a8;
}

.codes-pay-note {
    margin: 16px 0 0;
    font-size: 0.8rem;
    color: #7d8a99;
}

@media (max-width: 640px) {
    .codes-pay-methods {
        grid-template-columns: 1fr;
    }
}

/* IDE Panel */
.ide-panel {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,212,255,0.15);
    box-shadow:
        0 0 0 1px rgba(0,212,255,0.05),
        0 20px 60px rgba(0,0,0,0.45),
        0 0 80px rgba(0,212,255,0.06);
    background: #1e1f29;
    transition: box-shadow 0.3s ease;
}

.ide-panel:focus-within {
    box-shadow:
        0 0 0 1px rgba(0,212,255,0.2),
        0 20px 60px rgba(0,0,0,0.5),
        0 0 100px rgba(0,212,255,0.12);
}

.ide-chrome {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #16171f;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ide-dots {
    display: flex;
    gap: 6px;
}

.ide-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.ide-dots .dot.red    { background: #ff5f57; }
.ide-dots .dot.yellow { background: #febc2e; }
.ide-dots .dot.green  { background: #28c840; }

.ide-filename {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    color: #9aa4b2;
    flex: 1;
}

.ide-lang-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(0,212,255,0.12);
    color: var(--primary-color);
    border: 1px solid rgba(0,212,255,0.2);
    letter-spacing: 0.03em;
}

.ide-editor-wrap {
    position: relative;
}

.ide-editor-wrap .CodeMirror {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    height: 320px !important;
    background: #282a36 !important;
}

.ide-editor-wrap .CodeMirror-gutters {
    background: #21222c !important;
    border-right: 1px solid rgba(255,255,255,0.06) !important;
}

.ide-editor-wrap .CodeMirror-linenumber {
    color: #6272a4 !important;
    padding: 0 8px 0 4px;
}

.ide-editor-wrap .CodeMirror-cursor {
    border-left: 2px solid #00d4ff !important;
}

.ide-editor-wrap.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.ide-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #16171f;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.82rem;
    flex-wrap: wrap;
}

.code-hint {
    font-size: 0.82rem;
    color: #6272a4;
}

.ide-char-count {
    font-family: 'JetBrains Mono', monospace;
    color: #6272a4;
    font-size: 0.78rem;
}

.ide-char-count.over-limit {
    color: #ff5555;
}

/* Actions Bar */
.code-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.code-actions-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.code-select {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(13,17,23,0.9);
    color: var(--text-light);
    border: 1px solid rgba(0,212,255,0.2);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    padding-left: 30px;
}

html[dir="ltr"] .code-select {
    background-position: right 10px center;
    padding-left: 14px;
    padding-right: 30px;
}

.code-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,212,255,0.12);
}

.code-run-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #00d4ff 0%, #0055ff 100%);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 8px 24px rgba(0,85,255,0.35);
    letter-spacing: 0.02em;
}

.code-run-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,85,255,0.45);
}

.code-run-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.code-run-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.code-run-btn.is-loading .code-run-spinner {
    display: inline-block;
}

.code-run-btn.is-loading .code-run-icon {
    display: none;
}

.code-run-btn.is-loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* AI Terminal Output */
.ai-terminal {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0,212,255,0.12);
    background: #0d1117;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.ai-terminal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ai-terminal-chrome {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #161b22;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ai-terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: #9aa4b2;
}

.ai-copy-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #9aa4b2;
    padding: 4px 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.ai-copy-btn:hover {
    background: rgba(0,212,255,0.12);
    color: var(--primary-color);
}

.ai-copy-btn.copied {
    color: #28c840;
    border-color: rgba(40,200,64,0.3);
}

.ai-terminal-body {
    position: relative;
    min-height: 120px;
    max-height: 480px;
    overflow-y: auto;
    padding: 20px;
}

.ai-result-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #c9d1d9;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.ai-result-text.ai-error {
    color: #ff7b72;
}

.ai-chat {
    display: none;
    flex-direction: column;
    max-height: min(72vh, 780px);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.12);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    background:
        radial-gradient(ellipse at top, rgba(0, 212, 255, 0.06), transparent 50%),
        #0b0f14;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.ai-chat.is-visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.ai-chat-chrome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-chat-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #9aa4b2;
}

.ai-chat-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    letter-spacing: 0.04em;
}

.ai-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 280px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.35) transparent;
}

.ai-chat-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: min(92%, 720px);
    animation: chatIn 0.28s ease;
}

.ai-chat-row.is-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-chat-row.is-ai {
    align-self: flex-start;
}

.ai-chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.08);
    color: #7af7ff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    border: 1px solid rgba(0, 229, 255, 0.28);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.25);
}

.ai-chat-bubble {
    border-radius: 16px;
    padding: 12px 14px;
    max-width: 100%;
    min-width: 0;
}

.ai-chat-row.is-user .ai-chat-bubble {
    background: linear-gradient(160deg, #1b2433, #121820);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 6px;
}

.ai-chat-row.is-ai .ai-chat-bubble {
    background: linear-gradient(160deg, rgba(0, 212, 255, 0.1), rgba(18, 24, 32, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-bottom-right-radius: 6px;
}

.ai-chat-meta {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.ai-chat-code {
    margin: 0;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #e6edf3;
    white-space: pre-wrap;
    word-break: break-word;
    direction: ltr;
    text-align: left;
}

.ai-chat-md {
    color: #dce3ea;
    font-size: 0.92rem;
    line-height: 1.75;
    word-break: break-word;
}

.ai-chat-md h1,
.ai-chat-md h2,
.ai-chat-md h3 {
    color: #fff;
    margin: 0.7em 0 0.35em;
    line-height: 1.3;
}

.ai-chat-md h1 { font-size: 1.15rem; }
.ai-chat-md h2 { font-size: 1.05rem; }
.ai-chat-md h3 { font-size: 0.98rem; }

.ai-chat-md p { margin: 0 0 0.7em; }
.ai-chat-md p:last-child { margin-bottom: 0; }

.ai-chat-md ul,
.ai-chat-md ol {
    margin: 0 0 0.7em;
    padding-inline-start: 1.3em;
}

.ai-chat-md code {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.82em;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 0.08em 0.38em;
    direction: ltr;
}

.ai-chat-md pre {
    background: #010409;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    margin: 0.6em 0;
}

.ai-chat-md pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.65;
    color: #c9d1d9;
}

.ai-chat-md a { color: var(--primary-color); }

.ai-chat-bubble.is-typing .ai-chat-md {
    min-height: 1.4em;
}

.ai-chat-bubble.is-error {
    border-color: rgba(255, 123, 114, 0.45);
    background: rgba(255, 123, 114, 0.08);
}

.ai-chat-bubble.is-error .ai-chat-md {
    color: #ff7b72;
}

.ai-chat-dots {
    display: inline-flex;
    gap: 5px;
    padding: 4px 2px;
}

.ai-chat-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: chatDot 1s infinite ease-in-out;
}

.ai-chat-dots span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatDot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

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

body.light-mode .ai-chat {
    background: #f4f7fb;
}

body.light-mode .ai-chat-chrome {
    background: #e8eef5;
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .ai-chat-brand {
    color: #475569;
}

body.light-mode .ai-chat-row.is-user .ai-chat-bubble {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .ai-chat-row.is-ai .ai-chat-bubble {
    background: #fff;
    border-color: rgba(0, 180, 216, 0.28);
}

body.light-mode .ai-chat-code,
body.light-mode .ai-chat-md {
    color: #1e293b;
}

body.light-mode .ai-chat-md h1,
body.light-mode .ai-chat-md h2,
body.light-mode .ai-chat-md h3 {
    color: #0f172a;
}

body.light-mode .ai-chat-md pre {
    background: #0f172a;
}

body.light-mode .ai-chat-md pre code {
    color: #e2e8f0;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.ai-loading-dots {
    display: flex;
    gap: 5px;
}

.ai-loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: dotBounce 1.2s ease-in-out infinite;
}

.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* OpenAI Settings Panel */
.ai-settings-panel {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.1);
    background: rgba(13, 17, 23, 0.9);
}

.ai-settings-toggle {
    margin-right: auto;
    background: transparent;
    border: none;
    color: #6272a4;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.ai-settings-toggle:hover {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.08);
}

.ai-settings-body {
    padding: 16px 20px 20px;
    display: grid;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-settings-body[hidden] {
    display: none;
}

.ai-settings-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9aa4b2;
    margin-bottom: 6px;
}

.ai-settings-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(10, 12, 18, 0.95);
    color: var(--text-light);
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.ai-settings-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

select.ai-settings-input {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300d4ff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}

html[dir="ltr"] select.ai-settings-input {
    background-position: right 12px center;
    padding-left: 14px;
    padding-right: 32px;
}

.ai-settings-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-settings-save {
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.ai-settings-save:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

.ai-settings-status {
    font-size: 0.82rem;
    color: #6272a4;
}

.ai-settings-status.is-ok {
    color: #28c840;
}

.ai-settings-status.is-warn {
    color: #febc2e;
}

.ai-settings-hint {
    font-size: 0.78rem;
    color: #6272a4;
    line-height: 1.5;
}

/* ===== ZIM Page — Global section overrides ===== */
body.tai-page .site-header,
body.tai-page footer {
    position: relative;
    z-index: 2;
}

body.tai-page header.site-header {
    position: sticky;
    top: 0;
    z-index: 2004;
    padding: 12px 5%;
    background: rgba(10, 14, 22, 0.72);
    backdrop-filter: blur(22px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.14);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(0, 212, 255, 0.05);
}

body.tai-page header.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.45), transparent);
    pointer-events: none;
}

body.tai-page .header-row {
    background: rgba(13, 17, 23, 0.65);
    border: 1px solid rgba(0, 212, 255, 0.12);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 40px rgba(0, 212, 255, 0.04);
}

body.tai-page .logo-text {
    background: linear-gradient(135deg, #00d4ff, #0055ff, #a259ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.tai-page .logo-subtitle {
    color: #e8f7ff;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

body.tai-page #sidebar-menu {
    background: rgba(10, 14, 22, 0.95);
    border-left: 1px solid rgba(0, 212, 255, 0.12);
    box-shadow: -8px 0 48px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 212, 255, 0.04);
}

body.tai-page .sidebar-item:hover,
body.tai-page .sidebar-home-btn:hover {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.2);
}

body.tai-page .sidebar-item-icon {
    color: var(--primary-color);
}

body.tai-page section,
body.tai-page .auth-card {
    position: relative;
    z-index: 1;
}

body.tai-page section {
    padding: 48px 5%;
}

body.tai-page .section-title {
    background: linear-gradient(135deg, #00d4ff, #0055ff, #a259ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
}

body.tai-page .section-title::after {
    background: linear-gradient(90deg, #00d4ff, #a259ff);
    width: 60px;
    height: 3px;
    border-radius: 2px;
}

body.tai-page .section-block,
body.tai-page .auth-card,
body.tai-page #shop,
body.tai-page #works,
body.tai-page .hero-animate .hero-card {
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.04),
        0 20px 60px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(0, 212, 255, 0.04);
    backdrop-filter: blur(12px);
}

body.tai-page section.hero-animate {
    background: transparent;
    padding: 60px 5% 40px !important;
}

body.tai-page .hero-animate::before {
    display: none;
}

body.tai-page .hero-animate .hero-card {
    border: 1px solid rgba(0, 212, 255, 0.15);
    transition: box-shadow 0.3s ease;
}

body.tai-page .hero-animate .hero-card:hover {
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.2),
        0 24px 60px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(0, 212, 255, 0.1);
}

body.tai-page .eyebrow,
body.tai-page .codes-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.25);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 16px;
    letter-spacing: 0.04em;
}

body.tai-page .hero-animate h1 {
    background: linear-gradient(135deg, #00d4ff, #0055ff, #a259ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.tai-page .product-card {
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 14px;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

body.tai-page .product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 212, 255, 0.08);
}

body.tai-page .cv-grid > div {
    background: rgba(22, 27, 34, 0.6);
    border: 1px solid rgba(0, 212, 255, 0.08);
    border-radius: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

body.tai-page .cv-grid > div:hover {
    border-color: rgba(0, 212, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.06);
}

body.tai-page .skill-btn {
    border: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.06);
    transition: all 0.25s ease;
}

body.tai-page .skill-btn:hover {
    background: rgba(0, 212, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

body.tai-page .auth-card {
    max-width: 720px;
    margin: 32px auto;
    padding: 0;
    overflow: hidden;
}

body.tai-page .auth-card > .codes-hero,
body.tai-page .auth-card > .section-title,
body.tai-page .auth-card > .auth-tabs,
body.tai-page .auth-card > .auth-panel,
body.tai-page .auth-card > .auth-errors,
body.tai-page .auth-card > .auth-success,
body.tai-page .auth-card > .profile-header,
body.tai-page .auth-card > .profile-section-title,
body.tai-page .auth-card > form,
body.tai-page .auth-card > a.btn-buy {
    padding-left: 28px;
    padding-right: 28px;
}

body.tai-page .auth-card > .section-title {
    padding-top: 28px;
}

body.tai-page .auth-card > form,
body.tai-page .auth-card > a.btn-buy:last-child {
    padding-bottom: 28px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin: 8px 0 18px;
}

.auth-tab {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    cursor: pointer;
}

.auth-tab.is-active {
    background: rgba(0, 212, 255, 0.16);
    border-color: rgba(0, 212, 255, 0.4);
    color: #e6edf3;
}

.auth-panel { display: none; }
.auth-panel.is-active { display: block; }

.auth-form {
    display: grid;
    gap: 12px;
}

body.tai-page .auth-card::before {
    content: '';
    display: block;
    height: 40px;
    background: #16171f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background-image:
        radial-gradient(circle at 20px 50%, #ff5f57 6px, transparent 6px),
        radial-gradient(circle at 40px 50%, #febc2e 6px, transparent 6px),
        radial-gradient(circle at 60px 50%, #28c840 6px, transparent 6px);
    background-repeat: no-repeat;
}

body.tai-page .tai-form-section {
    max-width: 760px;
    margin: 32px auto;
    padding: 0;
    overflow: hidden;
    background: rgba(13, 17, 23, 0.85);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

body.tai-page .tai-form-section::before {
    content: '';
    display: block;
    height: 40px;
    background: #16171f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background-image:
        radial-gradient(circle at 20px 50%, #ff5f57 6px, transparent 6px),
        radial-gradient(circle at 40px 50%, #febc2e 6px, transparent 6px),
        radial-gradient(circle at 60px 50%, #28c840 6px, transparent 6px);
    background-repeat: no-repeat;
}

body.tai-page .tai-form-section > * {
    padding-left: 28px;
    padding-right: 28px;
}

body.tai-page .tai-form-section > .section-title {
    padding-top: 24px;
}

body.tai-page .tai-form-section > form,
body.tai-page .tai-form-section > .auth-errors,
body.tai-page .tai-form-section > .auth-success {
    padding-bottom: 28px;
}

body.tai-page .tai-form-section form {
    display: grid;
    gap: 14px;
}

body.tai-page #shop {
    max-width: 1100px;
    margin: 32px auto;
    padding: 28px;
}

body.tai-page #works {
    max-width: 1080px;
    margin: 32px auto;
    padding: 28px;
}

body.tai-page .social-icons .icon-btn {
    transition: transform 0.25s, box-shadow 0.25s;
}

body.tai-page .social-icons .icon-btn:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
}

body.tai-page footer {
    text-align: center;
    padding: 24px 5%;
    color: #6272a4;
    font-size: 0.88rem;
    border-top: 1px solid rgba(0, 212, 255, 0.06);
}

body.tai-page .code-run-btn,
body.tai-page .login-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0055ff 100%);
    box-shadow: 0 8px 24px rgba(0, 85, 255, 0.35);
}

body.tai-page .about-list {
    list-style-type: disc;
    padding-right: 20px;
}

html[dir="ltr"] body.tai-page .about-list {
    padding-right: 0;
    padding-left: 20px;
}

body.tai-page .social-icons {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 20px;
    flex-wrap: wrap;
}

body.tai-page .product-price {
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
}

body.tai-page .profile-logout-btn {
    margin: 0 28px 28px;
    display: inline-block;
}

body.tai-page .auth-success {
    background: rgba(21, 51, 33, 0.8);
    color: #c9f7d4;
    border: 1px solid rgba(31, 90, 53, 0.6);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
}

/* Legacy shared styles (login/profile still use .code-search) */
.code-search {
    width: 100%;
    background: rgba(10,12,18,0.95);
    border: 1px solid rgba(0,212,255,0.35);
    color: var(--text-light);
    border-radius: 999px;
    padding: 14px 22px;
    font-size: 1rem;
    outline: none;
    transition: border 0.3s, box-shadow 0.3s;
}

.code-search:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0,212,255,0.15);
}

.code-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.code-action {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
    width: 100%;
    font-size: 0.95rem;
    padding: 12px 18px;
    line-height: 1.1;
}

@media (max-width: 600px) {
    .code-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .code-actions-left {
        flex-direction: column;
    }
    .code-run-btn {
        justify-content: center;
    }
}

.option-group {
    display: grid;
    gap: 10px;
}

.option-label {
    font-weight: 700;
    color: #cbd5e1;
}

.option-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.option-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0,212,255,0.25);
    background: rgba(12,16,22,0.9);
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.option-btn input {
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(0,212,255,0.5);
    display: inline-block;
    position: relative;
}

.option-btn input:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-btn:has(input:checked) {
    background: rgba(0,212,255,0.18);
    border-color: rgba(0,212,255,0.5);
    transform: translateY(-1px);
}

.auth-card {
    background: #0d1117;
    border-radius: 18px;
    margin: 24px auto;
    max-width: 720px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    padding: 32px;
}

/* Creative theme additions */
html, body { height: 100%; }

/* Animated gradient hero */
section.hero-animate {
    position: relative;
    overflow: visible;
    padding: 100px 5% !important;
    background: linear-gradient(135deg, rgba(2,6,23,0.7), rgba(10,18,30,0.85));
}
.hero-animate::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 400px at 10% 20%, rgba(0,212,255,0.06), transparent 12%), radial-gradient(500px 360px at 90% 80%, rgba(162,89,255,0.05), transparent 10%);
    pointer-events: none;
}
.hero-animate .hero-card {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 28px;
    align-items: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 16px;
    padding: 28px;
    border: 1px solid rgba(0,212,255,0.06);
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.hero-animate h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); line-height:1.05; }
.hero-animate p { color: #9fb7c9; font-size:1.05rem; }

/* Floating blobs */
.blob { position:absolute; border-radius:50%; filter:blur(40px); opacity:0.22; animation: float 9s ease-in-out infinite; }
.blob.b1{ width:420px;height:420px; background:linear-gradient(45deg,#00d4ff,#0055ff); left:-120px; top:-120px; }
.blob.b2{ width:300px;height:300px; background:linear-gradient(45deg,#a259ff,#00d4ff); right:-80px; bottom:-60px; animation-duration:12s; }
@keyframes float{ 0%{transform:translateY(0) rotate(0);}50%{transform:translateY(-28px) rotate(12deg);}100%{transform:translateY(0) rotate(0);} }

/* About card creative */
.cv-grid, .about-card { max-width:1100px; margin:0 auto; }
.cv-grid > div, .about-card > * { background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.004)); padding:18px; border-radius:12px; border:1px solid rgba(255,255,255,0.02); }
.cv-grid h3 { color: var(--primary-color); }
.btn-download, .btn-contact { transition: transform .18s ease, box-shadow .18s ease; }
.btn-download:hover, .btn-contact:hover { transform:translateY(-4px); box-shadow:0 18px 36px rgba(0,0,0,0.45); }

/* Light-mode overrides for Codes, Shop and Login pages */
body.light-mode .product-card {
    background: #ffffff;
    color: #0b1220;
    border: 1px solid #e6eef8;
    box-shadow: 0 8px 30px rgba(13,24,40,0.06);
}
body.light-mode .product-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
}
body.light-mode .btn-buy {
    background: linear-gradient(135deg, #00b7e6, #2563eb 58%, #7c3aed);
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

body.light-mode .btn-contact {
    background: rgba(37, 99, 235, 0.1);
    color: #1e3a8a;
    border-color: rgba(37, 99, 235, 0.28);
}
body.light-mode .codes-card {
    background: linear-gradient(180deg, #ffffff, #f7fbff);
    color: #0b1220;
    border: 1px solid #e6eef8;
    box-shadow: 0 12px 40px rgba(12,24,40,0.06);
}
body.light-mode .codes-illustration {
    background: #ffffff;
    border: 1px solid rgba(13,24,40,0.04);
    box-shadow: 0 12px 30px rgba(13,24,40,0.06);
}
body.light-mode .code-search {
    background: #ffffff;
    color: #0b1220;
    border: 1px solid rgba(3,64,120,0.06);
}
body.light-mode .auth-card {
    background: #ffffff;
    color: #0b1220;
    border: 1px solid #e6eef8;
    box-shadow: 0 8px 30px rgba(13,24,40,0.06);
}
body.light-mode .login-primary {
    background: linear-gradient(135deg, #ff8a00 0%, #ff3d00 100%);
    color: #fff;
}

/* Aggressive light-mode brightness overrides to remove remaining dim areas */
body.light-mode .product-card,
body.light-mode .codes-card,
body.light-mode .auth-card {
    background: #ffffff !important;
    color: #0b1220 !important;
    border: 1px solid #e6eef8 !important;
    box-shadow: 0 12px 40px rgba(10,20,40,0.06) !important;
}

body.light-mode .codes-illustration {
    background: #ffffff !important;
    border: 1px solid rgba(3,64,120,0.04) !important;
    box-shadow: 0 18px 40px rgba(10,20,40,0.06) !important;
    opacity: 1 !important;
    filter: none !important;
}

body.light-mode .code-search,
body.light-mode .code-input-wrap,
body.light-mode .code-actions,
body.light-mode .option-btn {
    background: #ffffff !important;
    color: #0b1220 !important;
    border: 1px solid rgba(3,64,120,0.06) !important;
}

body.light-mode .option-btn:has(input:checked) {
    background: rgba(0,212,255,0.12) !important;
    border-color: rgba(0,212,255,0.4) !important;
}

body.light-mode .product-card i {
    color: var(--primary-color) !important;
}

body.light-mode .codes-section {
    background: transparent !important;
}

/* Override inline dark backgrounds on shop section for light-mode */
body.light-mode #shop {
    background: #ffffff !important;
    color: #0b1220 !important;
    box-shadow: 0 8px 30px rgba(13,24,40,0.04) !important;
    border-radius: 12px !important;
    border: 1px solid #e6eef8 !important;
}

body.light-mode #works {
    background: #ffffff !important;
    color: #0b1220 !important;
    box-shadow: 0 8px 30px rgba(13,24,40,0.04) !important;
    border-radius: 12px !important;
    border: 1px solid #e6eef8 !important;
}

body.light-mode #shop .section-title {
    color: #0b1220 !important;
}

/* Ensure product cards inside inline-styled shop are fully bright */
body.light-mode #shop .product-card {
    background: #ffffff !important;
    color: #0b1220 !important;
    border: 1px solid #e6eef8 !important;
    box-shadow: 0 8px 30px rgba(13,24,40,0.04) !important;
}

body.light-mode #shop .product-card p,
body.light-mode #shop .product-card h3 {
    color: #0b1220 !important;
}

body.light-mode #shop .btn-buy {
    background: linear-gradient(135deg, #00b7e6 0%, #2563eb 58%, #7c3aed 120%) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22) !important;
}




/* Skills as glass cards */
.skills-grid { gap: 20px; display:flex; flex-wrap:wrap; justify-content:center; }
.skills-grid .skill-btn { min-width: 160px; padding:14px 20px; border-radius:14px; background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); box-shadow: 0 8px 22px rgba(0,0,0,0.45); border:1px solid rgba(255,255,255,0.03); }

/* Social icons modern */
.ss#social-icons-section { gap:14px; }
.ss .icon-btn { display:inline-flex; align-items:center; justify-content:center; width:46px; height:46px; border-radius:12px; background:rgba(255,255,255,0.02); color:#fff; text-decoration:none; font-weight:700; box-shadow:0 10px 24px rgba(0,0,0,0.45); border:1px solid rgba(255,255,255,0.02); transition:transform .16s ease, background .16s ease; }
.ss .icon-btn:hover { transform:translateY(-6px) scale(1.04); background:linear-gradient(90deg,var(--primary-color),var(--secondary-color)); }

/* Footer uplift */
footer { margin-top: 40px; padding: 28px 10%; text-align:center; color:#94a6b5; }

@media (max-width: 900px){
    .hero-animate .hero-card { grid-template-columns: 1fr; }
    .blob.b1, .blob.b2 { display:none; }
}

/* ===== Light mode — ZIM pages (must override dark tai-page rules) ===== */
body.tai-page.light-mode {
    background: #f4f7fb;
    color: #0f172a;
}

body.tai-page.light-mode .tai-bg,
body.tai-page.light-mode .codes-bg {
    opacity: 0.55;
}

body.tai-page.light-mode .codes-glow {
    opacity: 0.18;
    filter: blur(90px);
}

body.tai-page.light-mode .codes-grid-overlay {
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px);
}

body.tai-page.light-mode header.site-header {
    background: rgba(248, 250, 252, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

body.tai-page.light-mode header.site-header::after {
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.35), transparent);
}

body.tai-page.light-mode .header-row {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.tai-page.light-mode .zim-mark {
    filter:
        brightness(0.68)
        contrast(1.38)
        saturate(1.2)
        drop-shadow(0 0 8px rgba(14, 165, 233, 0.42))
        drop-shadow(0 5px 12px rgba(15, 23, 42, 0.16));
}

body.tai-page.light-mode .header-home-link:hover .zim-mark {
    filter:
        brightness(0.64)
        contrast(1.42)
        saturate(1.28)
        drop-shadow(0 0 12px rgba(14, 165, 233, 0.55))
        drop-shadow(0 6px 14px rgba(15, 23, 42, 0.18));
}

body.tai-page.light-mode .brand-logo,
body.tai-page.light-mode .sidebar-logo-img {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

body.tai-page.light-mode .logo-text {
    background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.tai-page.light-mode .logo-subtitle {
    color: #0f172a;
}

body.tai-page.light-mode #sidebar-menu {
    background: rgba(255, 255, 255, 0.97);
    border-left: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

body.tai-page.light-mode .sidebar-item,
body.tai-page.light-mode .sidebar-home-btn {
    background: rgba(248, 250, 252, 0.95);
    color: #0f172a;
    border-color: rgba(148, 163, 184, 0.22);
}

body.tai-page.light-mode .sidebar-item:hover,
body.tai-page.light-mode .sidebar-home-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
}

body.tai-page.light-mode .sidebar-submenu a {
    background: rgba(241, 245, 249, 0.95);
    color: #1e293b;
}

body.tai-page.light-mode .sidebar-logo-text,
body.tai-page.light-mode .sidebar-close {
    color: #334155;
}

body.tai-page.light-mode section.hero-animate,
body.tai-page.light-mode .codes-section,
body.tai-page.light-mode section {
    background: transparent !important;
    border: none;
    box-shadow: none;
    color: #0f172a;
}

body.tai-page.light-mode .section-title,
body.tai-page.light-mode .hero-animate h1,
body.tai-page.light-mode .codes-main-title {
    background: linear-gradient(135deg, #2563eb, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

body.tai-page.light-mode .section-title::after {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
}

body.tai-page.light-mode .section-block,
body.tai-page.light-mode .auth-card,
body.tai-page.light-mode #shop,
body.tai-page.light-mode #works,
body.tai-page.light-mode .hero-animate .hero-card,
body.tai-page.light-mode .tai-form-section {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08) !important;
    color: #0f172a;
}

body.tai-page.light-mode .hero-animate .hero-card:hover {
    box-shadow: 0 22px 56px rgba(37, 99, 235, 0.12) !important;
}

body.tai-page.light-mode .eyebrow,
body.tai-page.light-mode .codes-badge {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.22);
    color: #1d4ed8;
}

body.tai-page.light-mode .hero-content p,
body.tai-page.light-mode .codes-subtitle {
    color: #475569;
}

body.tai-page.light-mode .cv-grid > div {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(148, 163, 184, 0.22);
    color: #0f172a;
}

body.tai-page.light-mode .cv-grid h3 {
    color: #2563eb;
}

body.tai-page.light-mode .product-card {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
    color: #0f172a !important;
}

body.tai-page.light-mode .product-price {
    color: #2563eb;
}

body.tai-page.light-mode .skill-btn {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
    color: #0f172a;
}

body.tai-page.light-mode .skill-btn:hover {
    background: rgba(37, 99, 235, 0.16);
}

body.tai-page.light-mode footer {
    background: transparent;
    color: #64748b;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

body.tai-page.light-mode .auth-card::before,
body.tai-page.light-mode .tai-form-section::before {
    background: #e8eef6;
    border-bottom-color: rgba(148, 163, 184, 0.25);
}

body.tai-page.light-mode .auth-tab {
    color: #334155;
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.35);
}

body.tai-page.light-mode .auth-tab.is-active {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.35);
    color: #1e3a8a;
}

body.tai-page.light-mode .option-label,
body.tai-page.light-mode .profile-section-title,
body.tai-page.light-mode .profile-name,
body.tai-page.light-mode .profile-score,
body.tai-page.light-mode .profile-hint {
    color: #334155;
}

body.tai-page.light-mode .ide-panel,
body.tai-page.light-mode .ai-settings-panel,
body.tai-page.light-mode .ai-terminal {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

body.tai-page.light-mode .ide-chrome,
body.tai-page.light-mode .ide-footer,
body.tai-page.light-mode .ai-terminal-chrome {
    background: #eef3f9;
    border-color: rgba(148, 163, 184, 0.22);
}

body.tai-page.light-mode .ide-filename,
body.tai-page.light-mode .code-hint,
body.tai-page.light-mode .ide-char-count,
body.tai-page.light-mode .ai-terminal-title,
body.tai-page.light-mode .ai-settings-hint,
body.tai-page.light-mode .ai-settings-field label {
    color: #64748b;
}

body.tai-page.light-mode .ide-lang-badge {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.2);
}

body.tai-page.light-mode .code-select,
body.tai-page.light-mode .ai-settings-input,
body.tai-page.light-mode .code-search {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

body.tai-page.light-mode .ai-result-text {
    color: #1e293b;
}

body.tai-page.light-mode .ai-terminal-body {
    background: #f8fafc;
}

body.tai-page.light-mode .option-btn {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

body.light-mode .ide-editor-wrap .CodeMirror {
    background: #ffffff !important;
}

body.light-mode .ide-editor-wrap .CodeMirror-gutters {
    background: #f1f5f9 !important;
    border-right: 1px solid rgba(148, 163, 184, 0.25) !important;
}

body.tai-page.light-mode .codes-free-hint {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.22);
}

body.tai-page.light-mode .codes-paywall {
    background: rgba(241, 245, 249, 0.78);
}

body.tai-page.light-mode .codes-pay-card {
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
}

body.tai-page.light-mode .codes-pay-title,
body.tai-page.light-mode .codes-pay-choose,
body.tai-page.light-mode .codes-pay-method {
    color: #0f172a;
}

body.tai-page.light-mode .codes-pay-subtitle,
body.tai-page.light-mode .codes-pay-period,
body.tai-page.light-mode .codes-pay-method-hint,
body.tai-page.light-mode .codes-pay-note {
    color: #64748b;
}

body.tai-page.light-mode .codes-pay-amount {
    color: #2563eb;
}

body.tai-page.light-mode .codes-pay-method {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.35);
}

body.tai-page.light-mode .codes-pay-method:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.35);
}

.profile-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 22px;
}

.profile-meta > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 212, 255, 0.12);
}

.profile-meta span {
    font-size: 0.78rem;
    color: #8b98a8;
}

.profile-meta strong {
    color: #f8fbff;
    font-size: 0.95rem;
}

body.tai-page.light-mode .profile-meta > div {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.28);
}

body.tai-page.light-mode .profile-meta span {
    color: #64748b;
}

body.tai-page.light-mode .profile-meta strong {
    color: #0f172a;
}

@media (max-width: 640px) {
    .profile-meta {
        grid-template-columns: 1fr;
    }
}

.admin-dash {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 24px auto 64px;
    padding: 28px;
    border-radius: 18px;
    background: rgba(13, 17, 23, 0.92);
    border: 1px solid rgba(0, 212, 255, 0.14);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.admin-dash-head {
    margin-bottom: 22px;
}

.admin-dash-sub {
    color: #9aa4b2;
    margin: 8px 0 0;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.admin-stat {
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(0, 212, 255, 0.1), rgba(18, 24, 32, 0.95));
    border: 1px solid rgba(0, 212, 255, 0.18);
}

.admin-stat-label {
    display: block;
    color: #8b98a8;
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.admin-stat-value {
    font-size: 2rem;
    color: #f8fbff;
    letter-spacing: 0.04em;
}

.admin-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table th {
    background: #161b22;
    color: #9aa4b2;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-table td {
    color: #dce3ea;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 0.82rem;
}

.admin-table tbody tr:hover td {
    background: rgba(0, 212, 255, 0.05);
}

.admin-empty {
    text-align: center;
    color: #8b98a8 !important;
    font-family: 'Cairo', sans-serif !important;
}

@media (max-width: 720px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
    .admin-dash {
        margin: 12px;
        padding: 18px;
    }
}

.shop-modal {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: rgba(6, 10, 18, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.shop-modal[hidden] {
    display: none !important;
}

.shop-modal-card {
    position: relative;
}

.shop-modal-close {
    position: absolute;
    top: 10px;
    inset-inline-end: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fbff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.shop-modal-close:hover {
    background: rgba(0, 212, 255, 0.2);
}

.shop-contact-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.shop-contact-icon {
    width: 110px;
    min-height: 96px;
    padding: 14px 10px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-contact-icon span {
    color: #fff;
}

.shop-contact-icon:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.shop-contact-icon.is-whatsapp {
    background: #25d366;
}

.shop-contact-icon.is-instagram {
    background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.shop-contact-icon.is-telegram {
    background: #229ed9;
}

.product-card .btn-buy {
    width: 100%;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 28px;
}

.work-card {
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.work-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 212, 255, 0.08);
}

.work-card-preview {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0d1117;
}

.work-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.45s ease;
}

.work-card:hover .work-card-preview img {
    transform: scale(1.04);
}

.work-card-body {
    padding: 22px 24px 26px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.work-card h3 {
    margin: 0 0 10px;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.work-card p {
    margin: 0 0 18px;
    color: #c9d1d9;
    line-height: 1.7;
    flex: 1;
}

.work-card .btn-buy {
    width: 100%;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    margin-top: auto;
    box-sizing: border-box;
}

body.tai-page.light-mode .work-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.25);
}

body.tai-page.light-mode .work-card h3 {
    color: #2563eb;
}

body.tai-page.light-mode .work-card p {
    color: #334155;
}

body.light-mode #works .work-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.25);
}

.shop-series-sub {
    max-width: 640px;
    margin: 8px auto 0;
    color: #8b98a8;
}

.shop-library {
    margin-bottom: 22px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.06);
}

.shop-library-title {
    margin: 0 0 6px;
    color: #7dd3fc;
    font-size: 1.05rem;
}

.shop-library-hint {
    margin: 0 0 12px;
    color: #8b98a8;
    font-size: 0.92rem;
}

.shop-library-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.shop-library-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.28);
    color: #e8eefb;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
}

.shop-library-chip:hover {
    background: rgba(0, 212, 255, 0.22);
}

.profile-library {
    margin: 18px 0 8px;
    padding-top: 4px;
}

.series-bundle {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 22px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    align-items: center;
    gap: 8px;
    text-align: start;
    background:
        radial-gradient(420px 180px at 12% 20%, rgba(251, 191, 36, 0.18), transparent 58%),
        radial-gradient(380px 200px at 92% 88%, rgba(0, 212, 255, 0.1), transparent 55%),
        linear-gradient(160deg, rgba(28, 22, 10, 0.96), rgba(18, 22, 32, 0.96));
    border: 1px solid rgba(251, 191, 36, 0.38);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 34px rgba(251, 191, 36, 0.1);
}

.series-scatter {
    position: relative;
    height: 230px;
    display: grid;
    place-items: center;
}

.scatter-glow {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.32), rgba(0, 212, 255, 0.08) 55%, transparent 72%);
    filter: blur(8px);
    animation: aiPulse 4.6s ease-in-out infinite;
}

.scatter-book {
    position: absolute;
    width: 92px;
    height: 124px;
    object-fit: contain;
    background: #070b12;
    border-radius: 8px;
    border: 1px solid rgba(255, 232, 163, 0.45);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(251, 191, 36, 0.28),
        0 0 22px rgba(0, 212, 255, 0.12);
    transition: transform 0.35s ease;
}

.scatter-book.s1 { transform: translate(-54px, 10px) rotate(-18deg); }
.scatter-book.s2 { transform: translate(-10px, -18px) rotate(-4deg); z-index: 2; }
.scatter-book.s3 { transform: translate(32px, 8px) rotate(10deg); z-index: 3; }
.scatter-book.s4 { transform: translate(68px, 22px) rotate(18deg); }

.series-bundle:hover .scatter-book.s1 { transform: translate(-62px, 6px) rotate(-22deg); }
.series-bundle:hover .scatter-book.s2 { transform: translate(-12px, -26px) rotate(-6deg); }
.series-bundle:hover .scatter-book.s3 { transform: translate(38px, 4px) rotate(12deg); }
.series-bundle:hover .scatter-book.s4 { transform: translate(78px, 18px) rotate(22deg); }

.series-bundle-copy {
    position: relative;
    z-index: 1;
    padding: 6px 8px 6px 4px;
}

.series-bundle-mark {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.series-bundle-kicker,
.series-bundle-save {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.series-bundle-kicker {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.series-bundle-save {
    background: rgba(52, 211, 153, 0.14);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.series-bundle h3 {
    margin: 0 0 8px;
    font-size: 1.45rem;
    color: #ffe8a3;
}

.series-bundle p {
    margin: 0 0 14px;
    max-width: 620px;
    color: #b8c0cc;
    line-height: 1.7;
}

.series-bundle-price {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.series-old-price {
    color: #8b98a8;
    text-decoration: line-through;
    font-size: 1.05rem;
}

.series-bundle .product-price {
    color: #fbbf24;
    font-size: 1.8rem;
    font-weight: 800;
}

.series-bundle .btn-buy,
.series-bundle .btn-owned {
    min-width: 220px;
}

.series-bundle .btn-owned {
    display: inline-flex;
    justify-content: center;
    text-decoration: none;
    margin-top: 12px;
}

.shop-books-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.book-card {
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 16px;
    overflow: visible;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.book-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 212, 255, 0.42);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36), 0 0 28px rgba(0, 212, 255, 0.16);
}

.book-card.is-owned {
    border-color: rgba(52, 211, 153, 0.35);
}

.book-cover {
    position: relative;
    flex: 0 0 150px;
    width: 150px;
    height: 200px;
    max-height: none;
    margin: 10px 0 10px 10px;
    border-radius: 12px;
    background: #0d1117;
    overflow: hidden;
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.4),
        0 0 18px rgba(0, 212, 255, 0.28),
        0 0 28px rgba(162, 89, 255, 0.14);
}

[dir="rtl"] .book-cover {
    margin: 10px 10px 10px 0;
}

.book-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.35);
}

.book-cover::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -30%;
    width: 46%;
    height: 180%;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transform: translateX(-120%) rotate(18deg);
    animation: coverShine 4.8s ease-in-out infinite;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center top;
    display: block;
    background: #070b12;
}

.book-vol {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    z-index: 3;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(8, 12, 20, 0.78);
    border: 1px solid rgba(0, 212, 255, 0.28);
    color: #7dd3fc;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    font-family: 'JetBrains Mono', monospace;
}

.book-card-body {
    padding: 14px 16px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    text-align: start;
}

.book-card-body h3 {
    margin: 0 0 6px;
    font-size: 0.96rem;
    line-height: 1.45;
    color: #e8eefb;
}

.book-card-body p {
    margin: 0 0 10px;
    color: #8b98a8;
    font-size: 0.82rem;
    line-height: 1.65;
    flex: 1;
}

.book-card-body .product-price {
    margin-bottom: 2px;
    font-size: 1.15rem;
}

.book-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.book-card-body .btn-buy,
.book-card-body .btn-trial {
    width: 100%;
    box-sizing: border-box;
    text-decoration: none;
    text-align: center;
    margin-top: 0;
    padding: 9px 16px;
    font-size: 0.88rem;
}

.btn-trial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.4);
    background: rgba(8, 16, 28, 0.78);
    color: #b8e7ff;
    font-family: inherit;
    font-weight: 800;
    letter-spacing: 0.2px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-trial:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.75);
    background: rgba(0, 212, 255, 0.14);
    box-shadow: 0 8px 22px rgba(0, 212, 255, 0.2);
    color: #e8fbff;
}

.book-card-body .btn-open-book {
    margin-top: 0;
}

#shop .btn-buy {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: linear-gradient(135deg, #00d4ff 0%, #0055ff 58%, #7c3aed 120%);
    box-shadow:
        0 0 16px rgba(0, 212, 255, 0.32),
        0 8px 22px rgba(0, 85, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

#shop .btn-buy::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.28) 48%, transparent 72%);
    transform: translateX(-120%);
    animation: coverShine 3.6s ease-in-out infinite;
}

#shop .btn-buy:hover {
    background: linear-gradient(135deg, #7dd3fc 0%, #00d4ff 40%, #a259ff 100%);
    box-shadow:
        0 0 24px rgba(0, 212, 255, 0.5),
        0 10px 26px rgba(162, 89, 255, 0.28);
}

#shop .series-bundle .btn-buy {
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #00d4ff 130%);
    color: #111827;
    box-shadow:
        0 0 18px rgba(251, 191, 36, 0.42),
        0 8px 22px rgba(245, 158, 11, 0.28);
}

@keyframes coverShine {
    0%, 62% { transform: translateX(-130%) rotate(18deg); }
    78% { transform: translateX(180%) rotate(18deg); }
    100% { transform: translateX(180%) rotate(18deg); }
}

.ai-build-panel {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 8px;
    padding: 22px;
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.22);
    background:
        radial-gradient(420px 180px at 8% 10%, rgba(0, 212, 255, 0.16), transparent 58%),
        radial-gradient(380px 200px at 100% 90%, rgba(162, 89, 255, 0.16), transparent 55%),
        linear-gradient(160deg, rgba(13, 18, 28, 0.96), rgba(18, 12, 32, 0.94));
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35), 0 0 40px rgba(0, 212, 255, 0.06);
}

.ai-build-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at 20% 40%, #000 20%, transparent 72%);
}

.ai-build-visual {
    position: relative;
    min-height: 210px;
    display: grid;
    place-items: center;
}

.ai-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(18px);
    pointer-events: none;
}

.ai-orb-a {
    width: 120px;
    height: 120px;
    background: rgba(0, 212, 255, 0.22);
    animation: aiPulse 4.8s ease-in-out infinite;
}

.ai-orb-b {
    width: 90px;
    height: 90px;
    background: rgba(162, 89, 255, 0.2);
    transform: translate(46px, 28px);
    animation: aiPulse 5.6s ease-in-out infinite reverse;
}

.ai-core {
    width: min(210px, 100%);
    height: auto;
    position: relative;
    z-index: 1;
    animation: aiSpin 22s linear infinite;
}

.ai-chip {
    position: absolute;
    bottom: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: rgba(8, 12, 20, 0.72);
    color: #7dd3fc;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    font-family: 'JetBrains Mono', monospace;
}

.ai-build-copy {
    position: relative;
    z-index: 1;
    padding: 8px 8px 4px 4px;
}

.shop-service-kicker {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 212, 255, 0.12);
    color: #7dd3fc;
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-build-copy h3 {
    margin: 0 0 8px;
    font-size: clamp(1.2rem, 2.4vw, 1.7rem);
    line-height: 1.35;
    background: linear-gradient(135deg, #e8eefb, #00d4ff 55%, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ai-build-copy > p {
    margin: 0 0 14px;
    color: #8b98a8;
    line-height: 1.75;
    max-width: 54ch;
}

.ai-build-feats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.ai-feat {
    padding: 12px 12px 11px;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.16);
    background: rgba(8, 14, 24, 0.55);
}

.ai-feat-ico {
    display: block;
    margin-bottom: 6px;
    color: #00d4ff;
    font-size: 0.95rem;
}

.ai-feat strong {
    display: block;
    color: #d7e6f5;
    font-size: 0.82rem;
    line-height: 1.5;
    font-weight: 700;
}

.ai-build-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ai-build-cta .product-price {
    margin: 0;
    font-size: 1.7rem;
    color: #7dd3fc;
}

.ai-build-cta .btn-buy {
    margin-top: 0;
    min-width: 180px;
}

@keyframes aiPulse {
    0%, 100% { opacity: .55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

@keyframes aiSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-owned[hidden],
.btn-open-book[hidden],
.btn-buy-book[hidden] {
    display: none !important;
}

body.tai-page.light-mode .shop-series-sub,
body.tai-page.light-mode .book-card-body p,
body.tai-page.light-mode .shop-library-hint,
body.tai-page.light-mode .ai-build-copy > p,
body.tai-page.light-mode .series-bundle p {
    color: #64748b;
}

body.tai-page.light-mode .btn-trial {
    background: #f8fafc;
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.28);
}

body.tai-page.light-mode .ai-build-panel {
    background:
        radial-gradient(420px 180px at 8% 10%, rgba(37, 99, 235, 0.1), transparent 58%),
        radial-gradient(380px 200px at 100% 90%, rgba(124, 58, 237, 0.1), transparent 55%),
        #ffffff;
    border-color: rgba(148, 163, 184, 0.28);
}

body.tai-page.light-mode .book-card-body h3,
body.tai-page.light-mode .series-bundle h3,
body.tai-page.light-mode .ai-feat strong {
    color: #0f172a;
}

body.tai-page.light-mode .ai-build-copy h3 {
    background: linear-gradient(135deg, #0f172a, #2563eb 55%, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (max-width: 980px) {
    .shop-books-grid {
        grid-template-columns: 1fr;
    }
    .series-bundle,
    .ai-build-panel {
        grid-template-columns: 1fr;
        padding: 18px;
        text-align: center;
    }
    .series-bundle-mark,
    .series-bundle-price {
        justify-content: center;
    }
    .series-bundle p {
        margin-left: auto;
        margin-right: auto;
    }
    .series-scatter {
        height: 200px;
    }
    .ai-build-visual {
        min-height: 170px;
    }
    .ai-core {
        width: min(160px, 46vw);
    }
}

@media (max-width: 640px) {
    body.tai-page #shop {
        margin: 16px 10px;
        padding: 16px 12px;
    }
    .book-cover {
        flex-basis: 112px;
        width: 112px;
        height: 150px;
        margin: 8px;
    }
    .book-card-body {
        padding: 10px 10px 12px;
    }
    .book-card-body h3 {
        font-size: 0.84rem;
    }
    .book-card-body p {
        font-size: 0.74rem;
        margin-bottom: 8px;
    }
    .scatter-book {
        width: 72px;
        height: 98px;
    }
    .scatter-book.s1 { transform: translate(-42px, 10px) rotate(-16deg); }
    .scatter-book.s2 { transform: translate(-8px, -14px) rotate(-4deg); }
    .scatter-book.s3 { transform: translate(24px, 8px) rotate(10deg); }
    .scatter-book.s4 { transform: translate(52px, 18px) rotate(16deg); }
    .ai-build-feats {
        grid-template-columns: 1fr;
    }
    .ai-build-cta {
        width: 100%;
        justify-content: center;
    }
    .ai-build-cta .btn-buy {
        width: 100%;
    }
    .series-bundle {
        padding: 16px 12px;
    }
    .series-bundle .btn-buy,
    .series-bundle .btn-owned {
        min-width: 0;
        width: 100%;
    }
}

/* ===== Platform extras: Code Lab rename, Try With Me, Blog, Reviews, Notify ===== */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-bottom: 12px;
}
.sidebar-item.is-active {
    border-color: rgba(0, 212, 255, 0.55);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(162, 89, 255, 0.16));
    box-shadow: 0 0 28px rgba(0, 212, 255, 0.22);
}

.news-ticker {
    position: sticky;
    top: 86px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 4% 0;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 60, 90, 0.45);
    background: linear-gradient(90deg, rgba(255, 32, 72, 0.18), rgba(10, 12, 20, 0.92) 18%, rgba(10, 12, 20, 0.92));
    box-shadow: 0 10px 40px rgba(255, 40, 80, 0.16), inset 0 0 20px rgba(255, 80, 120, 0.08);
    overflow: hidden;
}
.news-ticker[hidden] { display: none !important; }
.news-ticker-badge {
    flex: 0 0 auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: #ff2d55;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 0 18px rgba(255, 45, 85, 0.55);
}
.news-ticker-mask {
    overflow: hidden;
    flex: 1;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.news-ticker-track {
    display: flex;
    align-items: center;
    gap: 18px;
    white-space: nowrap;
    width: max-content;
    animation: tai-ticker 32s linear infinite;
}
html[dir="rtl"] .news-ticker-track { animation-name: tai-ticker-rtl; }
.news-ticker-item {
    color: #e8f4ff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.news-ticker-item:hover { color: #00d4ff; }
.news-ticker-sep { color: rgba(0, 212, 255, 0.55); }
.news-ticker.is-loading,
.news-ticker.is-error {
    border-radius: 18px;
}
.news-ticker.is-loading .news-ticker-track,
.news-ticker.is-error .news-ticker-track {
    animation: none;
    width: 100%;
    white-space: normal;
    gap: 0;
}
.news-ticker-status {
    display: block;
    width: 100%;
    color: #e8f4ff;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.45;
    white-space: normal;
}
.news-ticker.is-loading .news-ticker-status {
    background: linear-gradient(90deg, rgba(232, 244, 255, 0.45), #fff, rgba(232, 244, 255, 0.45));
    background-size: 180% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: tai-skel-shimmer 1.4s ease-in-out infinite;
}
.news-ticker.is-error {
    border-color: rgba(0, 212, 255, 0.28);
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.12), rgba(10, 12, 20, 0.92) 22%, rgba(10, 12, 20, 0.92));
}
.news-ticker.is-error .news-ticker-badge {
    background: #1a6d8c;
    box-shadow: none;
}
.news-ticker.is-error .news-ticker-status { color: #cfe8f8; }
@keyframes tai-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@keyframes tai-ticker-rtl {
    from { transform: translateX(0); }
    to { transform: translateX(50%); }
}

.reviews-section { margin: 28px 5%; }
.reviews-head {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.reviews-sub { color: #9eb4ce; max-width: 520px; }
.reviews-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.reviews-stats strong {
    font-size: 2rem;
    background: linear-gradient(135deg, #ffe08a, #00d4ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.reviews-stars-lg { color: #ffd24a; letter-spacing: 3px; }
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.review-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(0, 212, 255, 0.16);
    background: linear-gradient(180deg, rgba(18, 24, 36, 0.95), rgba(10, 12, 20, 0.92));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}
.review-card-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.review-avatar {
    width: 42px; height: 42px; border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #00d4ff, #a259ff);
    color: #041018; font-weight: 800; font-size: 0.78rem;
}
.review-stars { display: block; color: #ffd24a; letter-spacing: 2px; font-size: 0.82rem; }
.review-card p { color: #c9d8ea; font-size: 0.92rem; }
.reviews-empty { color: #9eb4ce; }

.review-modal, .blog-modal {
    position: fixed; inset: 0; z-index: 12000;
    background: rgba(4, 8, 14, 0.72);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.review-modal[hidden], .blog-modal[hidden] { display: none !important; }
.review-modal-card, .blog-modal-card {
    width: min(560px, 100%);
    background: linear-gradient(180deg, #151b28, #0c1018);
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: 24px;
    padding: 22px;
    box-shadow: 0 30px 80px rgba(0, 212, 255, 0.16);
    position: relative;
}
.review-star-picker { display: flex; gap: 8px; margin: 10px 0 16px; }
.review-star-picker button {
    background: transparent; border: 0; color: #3a4a5c; font-size: 1.6rem; cursor: pointer;
}
.review-star-picker button.is-on,
.review-star-picker button:hover { color: #ffd24a; }
.review-modal-card textarea, .try-panel textarea {
    width: 100%; min-height: 140px; resize: vertical;
    border-radius: 16px; border: 1px solid rgba(0, 212, 255, 0.22);
    background: rgba(6, 10, 16, 0.8); color: inherit; padding: 14px;
    font-family: inherit;
}
.blog-modal-close {
    position: absolute; top: 12px; inset-inline-end: 12px;
    border: 0; background: transparent; color: #fff; font-size: 1.2rem; cursor: pointer;
}

.try-section, .blog-section { position: relative; z-index: 2; margin: 24px 5% 48px; }
.try-hero, .blog-hero { text-align: center; margin-bottom: 28px; }
.try-subtitle, .blog-subtitle { color: #9eb4ce; max-width: 680px; margin: 8px auto 0; }
.try-live-badge { display: inline-flex; }
.try-login-gate {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(6, 10, 16, 0.72);
    backdrop-filter: blur(10px);
    border-radius: 28px;
}
.try-login-gate[hidden] { display: none !important; }
.try-login-card {
    width: min(420px, 100%);
    text-align: center;
    padding: 24px 20px;
    border-radius: 22px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: linear-gradient(180deg, rgba(18, 24, 36, 0.98), rgba(8, 12, 20, 0.96));
    box-shadow: 0 20px 50px rgba(0, 212, 255, 0.18);
}
.try-login-card h3 { margin: 12px 0 8px; }
.try-login-card p { color: #b7c8dc; margin-bottom: 16px; }
.try-shell { display: grid; gap: 22px; position: relative; }
.try-shell.is-locked .try-panel {
    pointer-events: none;
    filter: blur(3px) saturate(0.7);
}
body.light-mode .try-login-gate { background: rgba(255, 255, 255, 0.62); }
body.light-mode .try-login-card {
    background: #fff;
    color: #15202b;
    border-color: rgba(0, 85, 180, 0.22);
}
body.light-mode .try-login-card p { color: #4a5b6d; }
.try-panel {
    border-radius: 28px;
    padding: 18px;
    border: 1px solid rgba(0, 212, 255, 0.35);
    background: radial-gradient(circle at top, rgba(0, 212, 255, 0.12), transparent 42%), rgba(8, 12, 20, 0.92);
    box-shadow: 0 0 0 1px rgba(162, 89, 255, 0.18), 0 20px 60px rgba(0, 212, 255, 0.12), inset 0 0 40px rgba(0, 212, 255, 0.05);
    animation: try-glow 4.8s ease-in-out infinite;
}
@keyframes try-glow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(162, 89, 255, 0.18), 0 20px 60px rgba(0, 212, 255, 0.12); }
    50% { box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.4), 0 24px 70px rgba(162, 89, 255, 0.22); }
}
.try-panel-chrome {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #8fdfff; font-size: 0.78rem; letter-spacing: 0.12em;
}
.try-orb { width: 9px; height: 9px; border-radius: 50%; background: #00d4ff; box-shadow: 0 0 10px #00d4ff; }
.try-orb:nth-child(2) { background: #ffd24a; box-shadow: 0 0 10px #ffd24a; }
.try-orb:nth-child(3) { background: #ff5d8f; box-shadow: 0 0 10px #ff5d8f; }
.try-free-hint { margin-inline-start: auto; letter-spacing: 0; color: #b7f0ff; }
.try-panel textarea { min-height: 200px; font-size: 1rem; }
.try-panel-foot { display: flex; justify-content: space-between; gap: 12px; color: #8aa0b8; font-size: 0.82rem; margin: 8px 0 14px; }
.try-run-btn {
    position: relative; width: 100%;
    border: 0; border-radius: 16px; padding: 14px 18px;
    color: #041018; font-weight: 800; cursor: pointer;
    background: linear-gradient(135deg, #00d4ff, #7c5cff);
    box-shadow: 0 12px 32px rgba(0, 212, 255, 0.28);
    overflow: hidden;
}
.try-run-btn.is-loading { opacity: 0.7; pointer-events: none; }
.try-run-glow {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: translateX(-120%);
    animation: try-shimmer 2.2s infinite;
}
@keyframes try-shimmer { to { transform: translateX(120%); } }
.try-result {
    border-radius: 28px; padding: 20px;
    border: 1px solid rgba(162, 89, 255, 0.3);
    background: rgba(10, 14, 22, 0.92);
    transform: translateY(12px); opacity: 0; transition: 0.4s ease;
}
.try-result.is-in { transform: none; opacity: 1; }
.try-score-card { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; }
.try-ring-wrap { position: relative; width: 140px; height: 140px; margin: auto; }
.try-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.try-ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 10; }
.try-ring-fg { fill: none; stroke: url(#none); stroke: #00d4ff; stroke-width: 10; stroke-linecap: round; filter: drop-shadow(0 0 8px #00d4ff); }
.try-ring-label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.try-ring-label b { font-size: 2rem; line-height: 1; }
.try-axes { display: grid; gap: 10px; }
.try-axis span { display: block; font-size: 0.82rem; color: #c5d8ee; margin-bottom: 4px; }
.try-axis i {
    display: block; height: 8px; width: 0; border-radius: 99px;
    background: linear-gradient(90deg, #00d4ff, #a259ff);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.45);
    transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.try-notes { margin-top: 18px; }
.try-notes ol { margin: 8px 1.2em 0; color: #d7e6f7; }
.try-ctas { display: grid; gap: 10px; margin-top: 18px; }
.try-cta {
    display: block; text-align: center; text-decoration: none;
    border-radius: 16px; padding: 14px 16px; font-weight: 800; border: 0; cursor: pointer; font-family: inherit;
}
.try-cta-book {
    color: #041018;
    background: linear-gradient(135deg, #ffe08a, #00d4ff);
    box-shadow: 0 0 28px rgba(255, 224, 138, 0.35);
}
.try-cta-sub {
    color: #e8f7ff;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(0, 212, 255, 0.2));
    border: 1px solid rgba(0, 212, 255, 0.4) !important;
}
.try-pay-card { border-color: rgba(255, 224, 138, 0.35); }
.try-dual-cta { display: grid; gap: 12px; margin: 12px 0; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
a.blog-card {
    display: block;
    text-decoration: none;
    color: inherit;
}
.news-article-card {
    max-width: 760px;
    margin: 0 auto 24px;
    padding: 24px 22px;
    border-radius: 24px;
    border: 1px solid rgba(0, 212, 255, 0.18);
    background: rgba(12, 16, 24, 0.92);
    color: #d5e4f5;
    line-height: 1.85;
    font-size: 1.05rem;
}
.news-article-nav {
    text-align: center;
    margin-bottom: 40px;
}
.blog-card {
    position: relative;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(0, 212, 255, 0.16);
    background: rgba(12, 16, 24, 0.92);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 212, 255, 0.16); }
.blog-card.is-breaking { border-color: rgba(255, 45, 85, 0.45); }
.blog-flash {
    display: inline-block; margin-bottom: 8px; padding: 2px 8px; border-radius: 999px;
    background: #ff2d55; color: #fff; font-size: 0.72rem; font-weight: 800;
}
.blog-source { color: #00d4ff; font-size: 0.78rem; letter-spacing: 0.06em; }
.blog-card h2 { font-size: 1.05rem; margin: 8px 0; }
.blog-card p { color: #b7c8dc; font-size: 0.9rem; }
.blog-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: #8aa0b8; font-size: 0.78rem; }
.blog-more {
    border: 0; background: transparent; color: #00d4ff; cursor: pointer; font-weight: 700; font-family: inherit;
}
.blog-empty { color: #9eb4ce; text-align: center; padding: 24px; }
.blog-loading { width: 100%; }
.blog-skel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.blog-skeleton {
    cursor: default;
    pointer-events: none;
    min-height: 168px;
}
.blog-skel-line {
    display: block;
    height: 12px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(0, 212, 255, 0.18), rgba(255,255,255,0.05));
    background-size: 180% 100%;
    animation: tai-skel-shimmer 1.4s ease-in-out infinite;
}
.blog-skel-line.is-title { height: 18px; width: 78%; }
.blog-skel-line.is-short { width: 38%; }
@keyframes tai-skel-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -80% 0; }
}
.blog-unavailable {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    padding: 28px 18px;
    text-align: center;
    border-radius: 22px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    background: rgba(12, 16, 24, 0.88);
}
.blog-unavailable-icon {
    color: #00d4ff;
    font-size: 1.4rem;
}
.blog-unavailable p {
    margin: 0;
    max-width: 28rem;
    color: #d5e4f5;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.7;
}
.ai-unavailable {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 12px;
    text-align: center;
}
.ai-unavailable-icon {
    color: #00d4ff;
    font-size: 1.25rem;
}
.ai-unavailable p {
    margin: 0;
    max-width: 26rem;
    color: #d5e4f5;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.7;
}
.ai-unavailable-where {
    margin-top: 8px !important;
    max-width: 26rem;
    color: #9eb4ce !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    line-height: 1.6;
}
.blog-modal-card h2 { margin: 10px 0; }
.blog-modal-card time { color: #8aa0b8; font-size: 0.8rem; }
.blog-modal-card p { margin: 12px 0 18px; color: #d5e4f5; }

.tai-news-toasts {
    position: fixed; bottom: 20px; z-index: 13000;
    display: flex; flex-direction: column; gap: 10px;
    inset-inline-end: 20px; width: min(340px, calc(100vw - 28px));
    pointer-events: none;
}
.tai-news-toast {
    pointer-events: auto;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(0, 212, 255, 0.28);
    background: rgba(10, 14, 22, 0.94);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    opacity: 0; transform: translateY(10px); transition: 0.28s ease;
}
.tai-news-toast.is-in { opacity: 1; transform: none; }
.tai-news-toast-kicker { display: block; color: #00d4ff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; }
.tai-news-toast p { color: #d5e4f5; font-size: 0.88rem; margin-top: 4px; }

.tai-push-banner {
    position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 13001;
    width: min(380px, calc(100vw - 28px));
    display: flex; gap: 12px; justify-content: space-between; align-items: center;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    background: rgba(12, 16, 24, 0.96);
    box-shadow: 0 18px 50px rgba(0, 212, 255, 0.16);
}
.tai-push-banner p { color: #b7c8dc; font-size: 0.82rem; }
.tai-push-actions { display: flex; flex-direction: column; gap: 6px; }
.tai-push-yes, .tai-push-no {
    border: 0; border-radius: 10px; padding: 7px 10px; cursor: pointer; font-family: inherit; font-weight: 700;
}
.tai-push-yes { background: linear-gradient(135deg, #00d4ff, #7c5cff); color: #041018; }
.tai-push-no { background: transparent; color: #9eb4ce; }

body.light-mode .news-ticker {
    background: linear-gradient(90deg, rgba(255, 45, 85, 0.14), #fff 22%);
    border-color: rgba(255, 45, 85, 0.3);
}
body.light-mode .news-ticker-item { color: #1b2430; }
body.light-mode .news-ticker-status { color: #1b2430; }
body.light-mode .news-ticker.is-error {
    background: linear-gradient(90deg, rgba(0, 150, 200, 0.12), #fff 22%);
    border-color: rgba(0, 120, 180, 0.28);
}
body.light-mode .blog-unavailable,
body.light-mode .ai-unavailable {
    color: #15202b;
}
body.light-mode .blog-unavailable {
    background: #fff;
    border-color: rgba(0, 85, 180, 0.18);
}
body.light-mode .blog-unavailable p,
body.light-mode .ai-unavailable p { color: #15202b; }
body.light-mode .review-card,
body.light-mode .try-panel,
body.light-mode .try-result,
body.light-mode .blog-card,
body.light-mode .news-article-card,
body.light-mode .review-modal-card,
body.light-mode .blog-modal-card,
body.light-mode .tai-news-toast,
body.light-mode .tai-push-banner {
    background: #fff;
    color: #15202b;
    border-color: rgba(0, 85, 180, 0.18);
}
body.light-mode .review-card p,
body.light-mode .blog-card p,
body.light-mode .try-subtitle,
body.light-mode .blog-subtitle,
body.light-mode .reviews-sub { color: #4a5b6d; }
body.light-mode .try-panel textarea,
body.light-mode .review-modal-card textarea {
    background: #f4f7fb; color: #15202b;
}
body.light-mode .try-cta-sub { color: #123; background: #e8f6ff; }

@media (max-width: 800px) {
    .try-score-card { grid-template-columns: 1fr; }
    .reviews-stats { align-items: flex-start; }
    .news-ticker { top: 72px; margin: 6px 10px 0; border-radius: 18px; }
    .tai-push-banner { inset-inline-start: 10px; bottom: 10px; }
}

/* Dual-theme polish: logo, shop, blog, try, profile, admin */
body.tai-page.light-mode .header-home-link,
body.tai-page.light-mode .header-home-link:hover,
body.tai-page.light-mode a.sidebar-logo,
body.tai-page.light-mode a.sidebar-logo:hover {
    color: inherit;
}

body.tai-page.light-mode .logo-subtitle,
body.tai-page.light-mode .sidebar-logo-text {
    color: #0f172a;
    text-shadow: none;
}

body.tai-page .logo-subtitle,
body.tai-page .sidebar-logo-text {
    text-shadow: 0 0 18px rgba(0, 212, 255, 0.18);
}

body.tai-page.light-mode .sidebar-item-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.1));
    border-color: rgba(148, 163, 184, 0.32);
    color: #1e3a8a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.tai-page.light-mode .expand-icon {
    background: rgba(37, 99, 235, 0.08);
    color: #1e3a8a;
}

body.tai-page.light-mode .sidebar-item.is-active,
body.tai-page.light-mode .sidebar-home-btn.is-active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(124, 58, 237, 0.1));
    border-color: rgba(37, 99, 235, 0.38);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.12);
}

body.tai-page.light-mode .btn-buy,
body.tai-page.light-mode #shop .btn-buy {
    background: linear-gradient(135deg, #00b7e6 0%, #2563eb 58%, #7c3aed 120%) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22) !important;
}

body.tai-page.light-mode .book-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

body.tai-page.light-mode .book-card:hover {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.12);
}

body.tai-page.light-mode .book-cover {
    background: #e8eef6;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12), 0 0 16px rgba(37, 99, 235, 0.12);
}

body.tai-page.light-mode .book-cover img {
    background: #f1f5f9;
}

body.tai-page.light-mode .book-vol {
    background: rgba(255, 255, 255, 0.92);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.28);
}

body.tai-page.light-mode .shop-library {
    background: rgba(37, 99, 235, 0.06);
    border-color: rgba(37, 99, 235, 0.22);
}

body.tai-page.light-mode .shop-library-title {
    color: #1d4ed8;
}

body.tai-page.light-mode .shop-library-chip,
body.tai-page.light-mode .shop-library-chip:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
    color: #1e3a8a;
}

body.tai-page.light-mode .series-bundle {
    background:
        radial-gradient(420px 180px at 12% 20%, rgba(251, 191, 36, 0.16), transparent 58%),
        radial-gradient(380px 200px at 92% 88%, rgba(37, 99, 235, 0.1), transparent 55%),
        #ffffff;
    border-color: rgba(217, 119, 6, 0.35);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

body.tai-page.light-mode .series-bundle-kicker {
    color: #b45309;
    background: rgba(251, 191, 36, 0.18);
}

body.tai-page.light-mode .scatter-book {
    background: #fff;
    border-color: rgba(217, 119, 6, 0.35);
}

body.tai-page.light-mode .shop-modal {
    background: rgba(241, 245, 249, 0.72);
}

body.tai-page.light-mode .shop-modal-close {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

body.tai-page.light-mode .admin-dash {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

body.tai-page.light-mode .admin-dash-sub,
body.tai-page.light-mode .admin-stat-label,
body.tai-page.light-mode .admin-empty {
    color: #64748b !important;
}

body.tai-page.light-mode .admin-stat {
    background: linear-gradient(160deg, rgba(37, 99, 235, 0.08), #f8fafc);
    border-color: rgba(37, 99, 235, 0.18);
}

body.tai-page.light-mode .admin-stat-value,
body.tai-page.light-mode .admin-table td {
    color: #0f172a;
}

body.tai-page.light-mode .admin-table-wrap {
    border-color: rgba(148, 163, 184, 0.25);
}

body.tai-page.light-mode .admin-table th {
    background: #eef2f7;
    color: #475569;
}

body.tai-page.light-mode .admin-table th,
body.tai-page.light-mode .admin-table td {
    border-bottom-color: rgba(148, 163, 184, 0.2);
}

body.tai-page.light-mode .admin-table tbody tr:hover td {
    background: rgba(37, 99, 235, 0.06);
}

body.tai-page.light-mode .blog-card h2,
body.tai-page.light-mode .try-login-card h3,
body.tai-page.light-mode .try-ring-label,
body.tai-page.light-mode .try-notes ol,
body.tai-page.light-mode .blog-modal-card h2,
body.tai-page.light-mode .blog-modal-card p {
    color: #0f172a;
}

body.tai-page.light-mode .blog-source,
body.tai-page.light-mode .blog-more {
    color: #0369a1;
}

body.tai-page.light-mode .blog-card-foot,
body.tai-page.light-mode .blog-modal-card time,
body.tai-page.light-mode .try-panel-foot,
body.tai-page.light-mode .try-panel-chrome,
body.tai-page.light-mode .try-free-hint {
    color: #64748b;
}

body.tai-page.light-mode .blog-modal-close {
    color: #0f172a;
}

body.tai-page.light-mode .try-axis span,
body.tai-page.light-mode .tai-news-toast p,
body.tai-page.light-mode .tai-push-banner p {
    color: #334155;
}

body.tai-page.light-mode .try-ring-bg {
    stroke: rgba(15, 23, 42, 0.12);
}

body.tai-page.light-mode .try-panel {
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 42%), #ffffff;
    box-shadow: 0 18px 48px rgba(37, 99, 235, 0.1);
}

body.tai-page.light-mode .try-result {
    background: #f8fafc;
}

body.tai-page.light-mode .review-modal,
body.tai-page.light-mode .blog-modal {
    background: rgba(15, 23, 42, 0.35);
}

body.tai-page.light-mode .ai-chat-avatar {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.12);
}

body.tai-page.light-mode .hero-chip {
    color: #1e3a8a;
}

body.tai-page.light-mode .ss .icon-btn {
    color: #0f172a;
}

body.tai-page.light-mode .product-card h3,
body.tai-page.light-mode .product-card p {
    color: #0f172a !important;
}

@media (prefers-reduced-motion: reduce) {
    .zim-mark,
    .header-home-link,
    .blob,
    .zim-mark .zim-spark {
        animation: none !important;
        transition: none !important;
    }
}

.zim-vip-ribbon {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(6, 16, 28, 0.78);
    border: 1px solid rgba(125, 211, 252, 0.38);
    box-shadow: 0 0 28px rgba(0, 196, 255, 0.22);
    backdrop-filter: blur(16px);
    color: #e8f6ff;
    font-size: 13px;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.zim-vip-ribbon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6af6ff;
    box-shadow: 0 0 10px #6af6ff;
}

.zim-vip-ribbon-sep {
    width: 1px;
    height: 14px;
    background: rgba(125, 211, 252, 0.4);
}

.zim-vip-toast {
    position: fixed;
    top: 88px;
    left: 50%;
    transform: translate(-50%, -12px);
    z-index: 5001;
    padding: 14px 20px;
    border-radius: 16px;
    background: rgba(6, 18, 32, 0.92);
    border: 1px solid rgba(106, 246, 255, 0.35);
    color: #e8f6ff;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
    max-width: min(92vw, 420px);
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.zim-vip-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

body.light-mode .zim-vip-ribbon,
body.light-mode .zim-vip-toast {
    background: rgba(241, 248, 255, 0.92);
    color: #0b2740;
    border-color: rgba(14, 116, 176, 0.28);
}

.zim-vip-account-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin: 0 0 18px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.32);
    color: #e8f7ff;
    text-align: center;
    box-shadow: 0 0 28px rgba(0, 212, 255, 0.08);
}

.zim-vip-account-banner[hidden] {
    display: none !important;
}

.zim-vip-account-banner strong {
    color: #00d4ff;
    font-size: 1.02rem;
}

.zim-vip-account-banner span:last-child {
    color: #9aa4b2;
    font-size: 0.88rem;
}

body.tai-page.light-mode .zim-vip-account-banner {
    background: rgba(0, 85, 255, 0.08);
    border-color: rgba(0, 85, 255, 0.22);
    color: #0f172a;
}

body.tai-page.light-mode .zim-vip-account-banner strong {
    color: #0055ff;
}

body.tai-page.light-mode .zim-vip-account-banner span:last-child {
    color: #475569;
}

.kind-pick {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 4px 0 16px;
}

.kind-card {
    appearance: none;
    text-align: right;
    padding: 16px 14px;
    border-radius: 16px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    background: rgba(8, 16, 32, 0.45);
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(16px);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.kind-card strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
    color: #f4fbff;
}

.kind-card span {
    display: block;
    font-size: 12px;
    color: #8eabc4;
    line-height: 1.6;
}

.kind-card:hover,
.kind-card.is-active {
    transform: translateY(-2px);
    border-color: rgba(106, 246, 255, 0.55);
    box-shadow: 0 0 24px rgba(0, 196, 255, 0.16);
}

.kind-card.is-active {
    background: linear-gradient(180deg, rgba(58, 164, 255, 0.18), rgba(8, 16, 32, 0.55));
}

.kind-note,
.auth-kind-login-hint,
.kind-price-banner {
    color: #9fb6cc;
    font-size: 13px;
    line-height: 1.8;
    margin: 0 0 14px;
}

.kind-price-banner {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(106, 246, 255, 0.28);
    background: rgba(8, 18, 32, 0.55);
    color: #7ad7ff;
}

body.light-mode .kind-card {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(14, 116, 176, 0.18);
}

body.light-mode .kind-card strong { color: #0b2740; }
body.light-mode .kind-card span { color: #3d5a73; }

@media (max-width: 640px) {
    .kind-pick { grid-template-columns: 1fr; }
}

/* ===== Fully responsive layout (phones, tablets, desktop) ===== */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
}

.zim-mark,
.zim-mark-sm,
.zim-mark-side {
    height: auto;
}

.codes-pay-card,
.shop-modal-card,
.blog-modal-card,
.review-modal-card {
    max-width: 100%;
}

@media (max-width: 1100px) {
    .cv-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 900px) {
    body.tai-page header.site-header {
        padding: 10px 3%;
    }
    body.tai-page .header-row {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 6px 8px;
        margin-bottom: 0;
    }
    body.tai-page .header-brand,
    .header-brand {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        text-align: start;
        margin-bottom: 0;
        order: 0;
    }
    body.tai-page .header-home-link,
    .header-home-link {
        justify-content: flex-start;
    }
    body.tai-page .header-actions,
    .header-actions {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 8px;
        order: 0;
    }
    body.tai-page .zim-mark,
    .zim-mark {
        width: 46px;
        height: 42px;
    }
    .logo-subtitle {
        font-size: 0.86rem;
        letter-spacing: 0.08em;
    }
    section.hero-animate {
        padding: 36px 4% 28px !important;
    }
    body.tai-page .auth-card {
        margin: 16px 12px 40px;
    }
    body.tai-page .auth-card > .codes-hero,
    body.tai-page .auth-card > .section-title,
    body.tai-page .auth-card > .auth-tabs,
    body.tai-page .auth-card > .auth-panel,
    body.tai-page .auth-card > .auth-errors,
    body.tai-page .auth-card > .auth-success,
    body.tai-page .auth-card > .profile-header,
    body.tai-page .auth-card > .profile-section-title,
    body.tai-page .auth-card > form,
    body.tai-page .auth-card > a.btn-buy {
        padding-left: 16px;
        padding-right: 16px;
    }
    .news-ticker {
        top: 74px;
        margin: 6px 3% 0;
        border-radius: 16px;
        padding: 6px 8px;
    }
    .codes-pay-card {
        padding: 22px 14px 16px;
    }
    .zim-vip-ribbon {
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        transform: none;
        justify-content: center;
        flex-wrap: wrap;
        border-radius: 18px;
        font-size: 12px;
        padding: 8px 12px;
        text-align: center;
    }
    .zim-vip-toast {
        top: 76px;
        width: calc(100% - 24px);
        max-width: none;
    }
}

@media (max-width: 640px) {
    body.tai-page .header-row,
    .header-row {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    body.tai-page .header-brand,
    .header-brand {
        flex: 1 1 auto;
    }
    body.tai-page .header-actions,
    .header-actions {
        flex: 1 1 auto;
        justify-content: flex-end;
    }
    .hero-content h1,
    .hero-animate h1,
    .codes-main-title {
        font-size: clamp(1.45rem, 7vw, 2.1rem);
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
    .book-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .book-cover {
        flex-basis: auto;
        width: min(160px, 58vw);
        height: 210px;
        margin: 12px auto 0;
    }
    .book-card-body {
        width: 100%;
    }
    .book-card-actions {
        width: 100%;
    }
    .profile-header,
    .profile-meta {
        grid-template-columns: 1fr;
    }
    .shop-modal,
    .codes-paywall {
        padding: 12px 8px;
        align-items: flex-end;
    }
    footer {
        padding: 22px 4%;
        font-size: 0.82rem;
    }
    .btn-buy,
    .btn-trial,
    .btn-contact {
        min-height: 44px;
    }
    .news-ticker.is-loading,
    .news-ticker.is-error {
        border-radius: 14px;
        align-items: flex-start;
    }
    .news-ticker-status {
        font-size: 0.8rem;
    }
    .blog-unavailable {
        min-height: 140px;
        padding: 22px 12px;
    }
}

@media (max-width: 420px) {
    body.tai-page .header-actions,
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    .news-ticker-badge {
        display: none;
    }
    .vip-stats {
        grid-template-columns: 1fr;
    }
}