/* 2026-11-25 new design (styles/tpl/v2). Loaded after the old styles; every rule starts with .v2 (the <body> class)
   so the old design is untouched when it is chosen (?design=old). Colours per site: [data-brand]. */

/* ===== tokens ===== */
.v2[data-brand="seraj"] { --brand: #1572B6; --brand-deep: #0D4C7D; --brand-tint: #E4F0FA; --cta: #F6B920; --cta-deep: #C48E00; --cta-ink: #14243A; --ink: #14243A; --muted: #5A6A7E; --paper: #F5F8FB; --card: #FFFFFF; --line: #DCE5EE; --hero: #1572B6; --hero-ink: #FFFFFF; --hero-soft: rgba(255,255,255,.16); --margin-line: rgba(255,150,150,.55); --logo-ink: #0D4C7D; }
.v2[data-brand="kw"] { --brand: #00A38F; --brand-deep: #00705F; --brand-tint: #DCF4EF; --cta: #F8A23B; --cta-deep: #C7740F; --cta-ink: #1F2B37; --ink: #1F2B37; --muted: #57686F; --paper: #F4F8F7; --card: #FFFFFF; --line: #D6E5E1; --hero: #00A38F; --hero-ink: #FFFFFF; --hero-soft: rgba(255,255,255,.17); --margin-line: rgba(255,190,120,.7); --logo-ink: #232F3B; }
.v2[data-brand="bd"] { --brand: #8E6512; --brand-deep: #5F430A; --brand-tint: #F4EBD6; --cta: #D4A23A; --cta-deep: #9C7417; --cta-ink: #1D1B18; --ink: #1D1B18; --muted: #6A6255; --paper: #FAF8F3; --card: #FFFFFF; --line: #E8E0CF; --hero: #1F1D1A; --hero-ink: #F6EBD0; --hero-soft: rgba(246,235,208,.12); --margin-line: rgba(212,162,58,.55); --logo-ink: #1D1B18; }
.v2 { --ok: #1E9E5A; --ok-tint: #E2F5EA; --no: #D93F45; --no-tint: #FCE6E7; --font-body: 'IBM Plex Sans Arabic', 'Droid Arabic Kufi', system-ui, sans-serif; --font-display: 'Baloo Bhaijaan 2', 'IBM Plex Sans Arabic', sans-serif; }

/* ===== base (replaces the old page frame) ===== */
html:has(body.v2) { background: var(--paper, #F5F8FB); }
body.v2 { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 400 15px/1.7 var(--font-body); -webkit-font-smoothing: antialiased; }
.v2 *, .v2 *::before, .v2 *::after { box-sizing: border-box; }
.v2 [hidden] { display: none !important; }
.v2 a { color: var(--brand); text-decoration: none; }
.v2 a:hover, .v2 a:focus { color: var(--brand-deep); }
.v2 :focus-visible { outline: 3px solid var(--cta) !important; outline-offset: 2px; border-radius: 8px; }
.v2 h1, .v2 h2, .v2 h3, .v2 h4, .v2 .h1, .v2 .h2, .v2 .h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; letter-spacing: 0; }
.v2 h1 { font-size: 30px; font-weight: 800; }
.v2 h2 { font-size: 22px; font-weight: 800; }
.v2 h3 { font-size: 18px; font-weight: 700; }
.v2 p { margin: 0 0 .7em; }
.v2 img { max-width: 100%; }
.v2 .ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.v2 .ic-sm { width: 18px; height: 18px; }
.v2 .wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.v2 .v2-main { flex: 1; width: 100%; padding: 0; margin: 0; }
.v2 .v2-main > .zadpanel-container { width: auto; max-width: 1120px; margin: 0 auto; padding: 0 16px 8px; background: transparent; min-height: 0; border: 0; }
.v2 .v2-main > .zadpanel-container > .row { margin: 0; }
.v2 .v2-main > .zadpanel-container > .row > .col-md-12 { padding: 0; float: none; }
.v2 .v2-alert { padding: 8px 16px; text-align: center; font-weight: 600; font-size: 14px; background: var(--brand-tint); color: var(--brand-deep); }
.v2 .v2-alert.alert-danger { background: var(--no-tint); color: var(--no); border-radius: 14px; margin: 14px 0; }
.v2 .admin-tools { margin-top: 12px; }

/* ===== buttons (beat bootstrap's .btn) ===== */
.v2 .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 18px; font: 700 15px/1.2 var(--font-body); text-decoration: none; white-space: nowrap; transition: transform .08s, box-shadow .08s; box-shadow: none; }
.v2 .btn:active { transform: translateY(2px); }
.v2 .btn-cta, .v2 .btn-cta:hover, .v2 .btn-cta:focus { background: var(--cta); color: var(--cta-ink); box-shadow: inset 0 -4px 0 var(--cta-deep); padding-bottom: 15px; }
.v2 .btn-cta:active { box-shadow: inset 0 -2px 0 var(--cta-deep); }
.v2 .btn-brand, .v2 .btn-brand:hover, .v2 .btn-brand:focus, .v2 .btn-primary, .v2 .btn-primary:hover, .v2 .btn-primary:focus { background: var(--brand); color: #fff; box-shadow: inset 0 -4px 0 var(--brand-deep); padding-bottom: 15px; border: 0; }
.v2 .btn-soft, .v2 .btn-soft:hover, .v2 .btn-soft:focus, .v2 .btn-default, .v2 .btn-default:hover, .v2 .btn-default:focus { background: var(--brand-tint); color: var(--brand-deep); border: 0; }
.v2 .btn-line, .v2 .btn-line:hover, .v2 .btn-line:focus { background: transparent; color: var(--hero-ink); box-shadow: inset 0 0 0 2px var(--hero-soft); }
.v2 .btn-block { display: flex; width: 100%; }
.v2 .btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.v2 .btn-sm.btn-cta, .v2 .btn-sm.btn-brand { padding-bottom: 11px; }
.v2 .icon-btn { position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--ink); padding: 0; }
.v2 .icon-btn:hover { background: var(--brand-tint); color: var(--brand-deep); }
.v2 .dot-count { position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--no); color: #fff; font: 700 11px/18px var(--font-body); }

/* ===== header ===== */
.v2 .v2-head { position: sticky; top: 0; z-index: 1030; background: color-mix(in srgb, var(--card) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.v2 .v2-bar .wrap { display: flex; align-items: center; gap: 14px; height: 64px; }
.v2 .logo { display: inline-flex; align-items: center; gap: 9px; color: var(--logo-ink); font: 800 25px/1 var(--font-display); white-space: nowrap; }
.v2 .logo:hover { color: var(--logo-ink); }
.v2 .logo svg { width: 34px; height: 34px; flex: none; }
.v2 .v2-nav { display: none; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; } /* many menu items: scroll instead of breaking the bar */
.v2 .v2-nav::-webkit-scrollbar { display: none; }
.v2 .v2-nav a { padding: 8px 9px; border-radius: 10px; font: 600 14.5px var(--font-body); color: var(--ink); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.v2 .v2-nav a:hover { background: var(--brand-tint); color: var(--brand-deep); }
.v2 .v2-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-tint); }
.v2 .v2-nav a.nav-quiz { color: var(--cta-ink); background: color-mix(in srgb, var(--cta) 28%, transparent); }
.v2 .v2-bar .end { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.v2 .v2-search { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; height: 44px; color: var(--muted); margin: 0; }
.v2 .v2-search:focus-within { border-color: var(--brand); }
.v2 .v2-search input { border: 0; background: transparent; font: 15px var(--font-body); color: var(--ink); width: 100%; min-width: 0; outline: none; height: 100%; padding: 0; box-shadow: none; -webkit-appearance: none; }
.v2 .head-search { display: none; width: 180px; height: 42px; }
@media (min-width: 1440px) { .v2 .head-search { width: 230px; } .v2 .v2-nav a { padding: 8px 11px; font-size: 15px; } }
.v2 .head-login { display: none; }
.v2 .v2-user { position: relative; }
.v2 .v2-user summary { list-style: none; cursor: pointer; }
.v2 .v2-user summary::-webkit-details-marker { display: none; }
.v2 .v2-user .uname { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.v2 .menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 190px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 10px 30px rgba(20, 36, 58, .12); display: grid; z-index: 5; }
.v2 .menu a { padding: 9px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 14px; }
.v2 .menu a:hover { background: var(--brand-tint); color: var(--brand-deep); }
.v2 .v2-drawer { border-top: 1px solid var(--line); background: var(--card); padding: 12px 0 16px; max-height: calc(100vh - 64px); overflow-y: auto; }
.v2 .v2-drawer .wrap { display: grid; gap: 4px; }
.v2 .v2-drawer .v2-search { margin-bottom: 8px; }
.v2 .v2-drawer a { padding: 11px 12px; border-radius: 12px; color: var(--ink); font-weight: 600; font-size: 16px; }
.v2 .v2-drawer a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-deep); }
.v2 .v2-drawer .drawer-auth { display: flex; gap: 8px; margin-top: 8px; }
.v2 .v2-drawer .drawer-auth a { flex: 1; padding: 10px 12px; font-size: 15px; }
.v2 .v2-sticky { background: var(--brand-deep); }
.v2 .v2-sticky .wrap { display: flex; gap: 14px; overflow-x: auto; padding-top: 6px; padding-bottom: 6px; scrollbar-width: none; }
.v2 .v2-sticky a { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.v2 .v2-sticky img { height: 18px; }
.v2 .v2-menus { border-top: 1px solid var(--line); }
.v2 .v2-menus .wrap { display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; }
.v2 .v2-menu { position: static; flex: none; }
.v2 .v2-menu > summary, .v2 a.v2-menu { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; list-style: none; }
.v2 .v2-menu > summary::-webkit-details-marker { display: none; }
.v2 .v2-menu img { height: 22px; }
.v2 .page-search { margin: 14px 0 0; background: var(--card); }

/* breadcrumb (from get_breadcrumb) */
.v2 #breadcrumb { border: 0; padding: 16px 0 0; margin: 0; font-size: 13px; color: var(--muted); text-align: start; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.v2 #breadcrumb a { color: var(--brand); font-weight: 500; }
.v2 #breadcrumb a:hover { color: var(--brand-deep); }
.v2 #breadcrumb .fa-home { display: none; }
.v2 #breadcrumb .delimiter { color: var(--muted); padding: 0 6px; font-size: 0; }
.v2 #breadcrumb .delimiter::before { content: "‹"; font-size: 14px; }
.v2 #breadcrumb .current { color: var(--muted); }
.v2 .v2-results-title { font-size: 20px; margin: 18px 0 4px; }

/* ===== blocks ===== */
.v2 .block { margin-top: 32px; }
.v2 .block-first { margin-top: 18px; }
.v2 .block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.v2 .block-head h2 { margin: 0; }
.v2 .block-head .count { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.v2 .page-head { padding: 14px 0 4px; display: flex; gap: 14px; align-items: center; }
.v2 .page-head h1, .v2 h1.page-title { margin: 0; padding: 0; font-size: 28px; color: var(--ink); }
.v2 h1.page-title::after, .v2 h2.page-title::after { display: none; }
.v2 h2.page-title, .v2 h2.sub-title, .v2 h3.sub-title { color: var(--ink); font-family: var(--font-display); padding: 0; margin: 18px 0 12px; font-size: 22px; }
.v2 .page-head p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.v2 .two > div + div { margin-top: 32px; }
.v2 .empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.v2 .empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.v2 .about { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px; }
.v2 .about h2 { font-size: 19px; margin: 0 0 8px; }

/* ===== hero (home) ===== */
.v2 .hero { position: relative; overflow: hidden; margin-top: 14px; border-radius: 28px; background-color: var(--hero); color: var(--hero-ink); padding: 26px 20px 22px; padding-inline-start: 46px; background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--hero-soft) 31px 32px); display: grid; gap: 22px; }
.v2 .hero::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 28px; width: 2px; background: var(--margin-line); }
.v2 .hero h1 { color: var(--hero-ink); font-size: 31px; max-width: 15ch; margin: 0; }
.v2 .hero .lead { margin: 10px 0 0; font-size: 16px; opacity: .92; max-width: 40ch; }
.v2 .hero .search { margin-top: 18px; display: flex; align-items: center; gap: 10px; background: #fff; color: #5A6A7E; border-radius: 16px; padding: 0 14px; height: 54px; box-shadow: 0 6px 0 rgba(0,0,0,.08); }
.v2 .hero .search input { flex: 1; border: 0; outline: none; font: 15.5px var(--font-body); color: #14243A; background: transparent; min-width: 0; -webkit-appearance: none; }
.v2 .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.v2 .hero-card { display: none; background: var(--card); color: var(--ink); border-radius: 22px; padding: 22px; position: relative; box-shadow: 0 8px 0 rgba(0,0,0,.10); align-self: center; }
.v2 .hero-card::before { content: ""; position: absolute; top: -10px; left: 50%; width: 96px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: color-mix(in srgb, var(--cta) 75%, transparent); border-radius: 3px; }
.v2 .hero-card h3 { font-size: 22px; margin: 0 0 4px; }
.v2 .hero-card p { color: var(--muted); font-size: 14.5px; }
.v2 .steps-mini { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 10px; }
.v2 .steps-mini li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.v2 .steps-mini span { width: 28px; height: 28px; border-radius: 9px; background: var(--brand-tint); color: var(--brand-deep); display: grid; place-items: center; font-weight: 700; flex: none; }

/* grade shelf: exercise books, spine on the binding side */
.v2 .shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.v2 .book { position: relative; text-align: start; background: var(--t); color: var(--ink); border-radius: 6px 16px 16px 6px; padding: 12px 12px 10px; padding-inline-start: 20px; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: inset 0 -4px 0 var(--d); transition: transform .08s; }
.v2 .book::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 9px; border-radius: 0 6px 6px 0; background: var(--c); }
.v2 .book::after { content: ""; position: absolute; inset-inline-start: 9px; top: 0; bottom: 4px; width: 2px; background: rgba(255,255,255,.65); }
.v2 .book:hover { color: var(--ink); transform: translateY(-2px); }
.v2 .book:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--d); }
.v2 .book .num { font: 800 38px/1 var(--font-display); color: var(--d); }
.v2 .book .gname { display: block; font-weight: 700; font-size: 13.5px; line-height: 1.35; margin-top: 6px; }
.v2 .book .gmeta { display: block; font-size: 12px; color: color-mix(in srgb, var(--ink) 62%, transparent); }

/* tools */
.v2 .tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.v2 .tool { display: flex; flex-direction: column; gap: 8px; text-align: start; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px; color: var(--ink); }
.v2 .tool:hover { color: var(--ink); border-color: var(--c); }
.v2 .tool .tic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--t); color: var(--d); }
.v2 .tool b { font-size: 15px; }
.v2 .tool span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.v2 .tool.feature { background: var(--brand-tint); border-color: transparent; }

/* file list */
.v2 .files { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; }
.v2 .files li + li { border-top: 1px solid var(--line); }
.v2 .file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 18px; gap: 12px; align-items: center; text-align: start; padding: 12px 14px; color: var(--ink); }
.v2 .file-row:hover, .v2 .file-row:focus { background: color-mix(in srgb, var(--brand-tint) 50%, transparent); color: var(--ink); }
.v2 .files li.featured .file-row { background: color-mix(in srgb, var(--cta) 10%, transparent); }
.v2 .ftype { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--t); color: var(--d); }
/* file picture (2026-11-25): the 320x200 thumbnail, top of the first page; the type icon shows under it when there is none */
.v2 .fthumb { position: relative; width: 80px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--t); color: var(--d); box-shadow: inset 0 0 0 1px var(--line); }
.v2 .fthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; background: #fff; border-radius: inherit; box-shadow: 0 0 0 1px var(--line); }
.v2 .ftitle { font-weight: 600; font-size: 14.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v2 .fmeta { display: flex; gap: 8px; align-items: center; margin-top: 3px; font-size: 12px; color: var(--muted); }
.v2 .fgo { color: var(--muted); width: 18px; height: 18px; }
.v2 .tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; background: var(--t, var(--brand-tint)); color: var(--d, var(--brand-deep)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.v2 .tag.plain { background: color-mix(in srgb, var(--muted) 12%, transparent); color: var(--muted); }
.v2 .files .ad-row { padding: 10px; background: var(--paper); }

/* subjects, terms */
.v2 .subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.v2 .subject { display: flex; align-items: center; gap: 12px; text-align: start; background: var(--card); border-radius: 18px; padding: 12px; box-shadow: inset 0 0 0 1.5px var(--line), inset 0 -4px 0 var(--c); color: var(--ink); }
.v2 .subject:hover { color: var(--ink); background: color-mix(in srgb, var(--t) 40%, var(--card)); }
.v2 .subject b { font-size: 15px; line-height: 1.35; }
.v2 .glyph { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--t); color: var(--d); font: 800 22px/1 var(--font-display); }
.v2 .glyph.lg { width: 58px; height: 58px; border-radius: 18px; font-size: 28px; }
.v2 .terms { display: grid; gap: 10px; margin-top: 18px; }
.v2 .term { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line), inset 0 -4px 0 var(--c); }
.v2 .term > .ic:first-child { width: 42px; height: 42px; padding: 9px; border-radius: 12px; background: var(--t); color: var(--d); }
.v2 .term b { flex: 1; font: 700 18px/1.3 var(--font-display); }
.v2 .term:hover { color: var(--ink); background: color-mix(in srgb, var(--t) 40%, var(--card)); }

/* chips (filters) */
.v2 .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.v2 .chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.v2 .chip { flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 600 14px var(--font-body); }
.v2 .chip:hover { color: var(--ink); border-color: var(--brand); }
.v2 .chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* lessons view (sections with "subdivisions") */
.v2 .unit { margin-top: 18px; background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 6px 0; }
.v2 .unit h3 { font-size: 17px; padding: 10px 16px 8px; margin: 0; color: var(--brand-deep); }
.v2 .lessons { list-style: none; margin: 0; padding: 0; }
.v2 .lesson { padding: 12px 16px; }
.v2 .lesson + .lesson, .v2 .unit h3 + .lessons .lesson:first-child { border-top: 1px solid var(--line); }
.v2 .lname { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.v2 .lname .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.v2 .lfiles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; padding-inline-start: 18px; }
.v2 .pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; padding: 6px 10px; background: var(--t); color: var(--d); font: 600 13px var(--font-body); }
.v2 .pill:hover { color: var(--d); filter: brightness(.97); }
.v2 .pill img { height: 22px; border-radius: 6px; }

/* promo, aside */
.v2 .promo { display: flex; align-items: center; gap: 14px; border-radius: 22px; padding: 16px; background: var(--brand-tint); color: var(--brand-deep); }
.v2 .promo .txt { flex: 1; }
.v2 .promo b { display: block; font: 800 18px/1.3 var(--font-display); color: var(--ink); }
.v2 .promo span { font-size: 13.5px; }
.v2 .promo.stack { flex-direction: column; align-items: stretch; }
.v2 .aside-stack { display: grid; gap: 14px; align-content: start; }
.v2 .with-aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.v2 .with-aside > * { min-width: 0; }

/* ===== footer ===== */
.v2 .v2-foot { position: static; max-height: none; margin-top: 48px; background: var(--card); border-top: 1px solid var(--line); padding: 28px 0 24px; overflow: visible; }
.v2 .v2-foot .wrap { display: grid; gap: 18px; }
.v2 .v2-foot p { color: var(--muted); font-size: 14px; max-width: 46ch; margin: 8px 0 0; }
.v2 .foot-side { display: grid; gap: 14px; }
.v2 .foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.v2 .foot-links a { color: var(--ink); font-weight: 500; }
.v2 .stores { display: flex; gap: 8px; }
.v2 .store { border: 1.5px solid var(--line); border-radius: 12px; padding: 7px 12px; font-size: 13px; font-weight: 600; background: var(--paper); color: var(--ink); direction: ltr; }
.v2 .social-links { display: flex; gap: 14px; font-size: 20px; }
.v2 .social-links a { color: var(--muted); }
.v2 .copy { color: var(--muted); font-size: 12.5px; }

/* ===== old pages inside the new frame (file page, tests, worksheets, forms...) ===== */
.v2 .zadpanel-ads, .v2 [class*="zadpanel-ads"] { margin: 14px auto; }
.v2 .page-content { font-size: 16px; line-height: 1.9; color: var(--ink); }
.v2 .form-control { border: 1.5px solid var(--line); border-radius: 12px; height: auto; min-height: 44px; padding: 8px 12px; font-family: var(--font-body); font-size: 15px; color: var(--ink); box-shadow: none; background: var(--card); }
.v2 .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.v2 .panel { border: 1.5px solid var(--line); border-radius: 18px; box-shadow: none; overflow: hidden; }
.v2 .panel-default > .panel-heading { background: var(--paper); color: var(--ink); border-color: var(--line); font-weight: 700; }
.v2 .table-bordered, .v2 .table-bordered > tbody > tr > td, .v2 .table-bordered > tbody > tr > th { border-color: var(--line); }
.v2 .last-files { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; margin: 18px 0; max-width: none !important; }
.v2 .last-files h3 { font-size: 18px; margin: 0 0 8px; color: var(--ink); background: none; border: 0; padding: 0; }
.v2 .last-files-row { padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14.5px; }
.v2 .last-files-row:last-child { border-bottom: 0; }
.v2 .last-files-row a { color: var(--ink); }
.v2 .last-files-row a:hover { color: var(--brand); }
.v2 .download-section #zadpanel-link .download-file, .v2 a.download-file { display: inline-flex; align-items: center; gap: 8px; background: var(--cta); color: var(--cta-ink); box-shadow: inset 0 -4px 0 var(--cta-deep); border-radius: 16px; padding: 14px 26px 17px; font: 700 17px/1.2 var(--font-body); border: 0; }
.v2 .items-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 14px; }
.v2 .btn-items-filter { background: var(--card) !important; color: var(--ink) !important; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; }

/* tests and worksheets lists */
.v2 .book-other .num .ic { width: 38px; height: 38px; }
.v2 a.lname { color: var(--ink); }
.v2 a.lname:hover { color: var(--brand); }
.v2 .lesson.on-hold .lname > span:not(.dot):not(.tag) { text-decoration: line-through; color: var(--muted); }
.v2 .lesson.muted { color: var(--muted); margin: 0; }

/* "اختبرني" setup */
.v2 .setup-wrap { max-width: 900px; margin: 0 auto; }
.v2 .steps { display: grid; gap: 14px; margin-top: 14px; }
.v2 .step { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 16px; min-width: 0; }
.v2 .step h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 12px; }
.v2 .step h3 .link { margin-inline-start: auto; }
.v2 .step .sub-h { margin-top: 18px; font-size: 15px; color: var(--muted); }
.v2 .stepn { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font: 700 14px var(--font-body); flex: none; }
.v2 .step-note { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.v2 .link { border: 0; background: none; color: var(--brand); font: 600 14px var(--font-body); padding: 4px 0; cursor: pointer; }
.v2 .cascade { display: grid; gap: 8px; }
.v2 .v2-select { width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); font: 600 15px var(--font-body); padding: 0 14px; }
.v2 .v2-select:focus { border-color: var(--brand); outline: none; }
.v2 .checks { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.v2 .check { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--paper); font-weight: 500; margin: 0; cursor: pointer; }
.v2 .check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 0; flex: none; }
.v2 .chip-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.v2 .chip-check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.v2 .chip-check:has(input:checked) { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-deep); }
.v2 .switch { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; font-weight: 600; cursor: pointer; }
.v2 .switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 30%, transparent); position: relative; flex: none; margin: 0; transition: background .15s; cursor: pointer; }
.v2 .switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.v2 .switch input:checked { background: var(--brand); }
.v2 .switch input:checked::after { inset-inline-start: 21px; }
.v2 .switch small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.v2 .tabs { display: flex; gap: 4px; background: color-mix(in srgb, var(--muted) 10%, transparent); padding: 4px; border-radius: 14px; }
.v2 .tabs label { flex: 1; margin: 0; cursor: pointer; }
.v2 .tabs input { position: absolute; opacity: 0; pointer-events: none; }
.v2 .tabs span { display: block; text-align: center; padding: 9px 6px; border-radius: 11px; font: 600 14px var(--font-body); color: var(--muted); white-space: nowrap; }
.v2 .tabs input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.v2 .tabs input:focus-visible + span { outline: 3px solid var(--cta); }
.v2 .sticky-cta { position: sticky; bottom: 0; padding: 14px 0 16px; background: linear-gradient(to top, var(--paper) 70%, transparent); z-index: 5; }
.v2 .sticky-cta .btn:disabled { opacity: .6; }
.v2 .v2-error { background: var(--no-tint); color: var(--no); border-radius: 14px; padding: 12px 14px; font-weight: 600; }

/* taking a test (styles/tpl/home/tpl_test.php, restyled only) */
body.v2:has(#zad_quiz_form) .v2-foot { display: none; }
body.v2:has(#zad_quiz_navbar) .v2-main { padding-bottom: 96px; }
.v2 #zad_quiz_form { max-width: 760px; margin: 0 auto; }
.v2 .zad-quiz-test-content { background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0 !important; color: var(--ink); }
.v2 .zad-quiz-test-content-wrap { background: var(--card) !important; border: 1.5px solid var(--line) !important; border-radius: 22px; padding: 18px 18px 20px !important; margin: 14px 0 !important; color: var(--ink); text-align: start; }
.v2 .zad-quiz-test-question-number { display: inline-flex !important; align-items: center; gap: 5px; margin: 0 0 10px !important; padding: 2px 12px !important; width: auto !important; border: 0 !important; border-radius: 999px; background: var(--brand-tint) !important; color: var(--brand-deep) !important; font: 700 13px/1.8 var(--font-body); }
.v2 .zad-quiz-test-question-number::before { content: "سؤال "; }
.v2 .zad-quiz-test-question-number::after { content: none !important; }
.v2 .zad-quiz-test-content-question { display: block !important; font: 700 20px/1.6 var(--font-body); color: var(--ink); padding: 0 !important; margin: 0 0 16px; }
.v2 .zad-quiz-test-content-question img { border-radius: 12px; }
.v2 .zad-quiz-test-content-answers { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 !important; border: 0 !important; padding: 0 !important; }
.v2 .zad-quiz-test-content-answer { position: relative; display: flex !important; align-items: center; gap: 12px; width: auto !important; float: none !important; margin: 0 !important; padding: 0 14px !important; min-height: 58px; background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 18px; transition: transform .08s; }
.v2 .zad-quiz-test-content-answer:active { transform: translateY(2px); border-bottom-width: 3px; }
.v2 .zad-quiz-test-content-answer:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.v2 .zad-quiz-test-content-answer input[type="radio"], .v2 .zad-quiz-test-content-answer input[type="checkbox"] { width: 22px; height: 22px; margin: 0 !important; accent-color: var(--brand); flex: none; }
.v2 .zad-quiz-test-answer-text { flex: 1; display: block !important; margin: 0 !important; padding: 14px 0; color: var(--ink) !important; font: 600 16.5px/1.5 var(--font-body); cursor: pointer; }
.v2 .zad-quiz-test-answer-text::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.v2 #zad_quiz_navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: flex !important; align-items: center; justify-content: space-between !important; gap: 12px; margin: 0 !important; padding: 12px max(16px, calc((100vw - 760px) / 2)) calc(12px + env(safe-area-inset-bottom)) !important; background: color-mix(in srgb, var(--card) 96%, transparent) !important; border-top: 1px solid var(--line) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.v2 #zad_quiz_pagination { float: none !important; order: 2; background: var(--paper) !important; color: var(--muted) !important; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px !important; font: 700 15px/1 var(--font-body) !important; direction: rtl; }
.v2 #zad_quiz_next, .v2 #zad_quiz_submit { order: 1; flex: 1; max-width: 340px; min-height: 50px; background: var(--cta) !important; color: var(--cta-ink) !important; border: 0 !important; border-radius: 16px; box-shadow: inset 0 -4px 0 var(--cta-deep); font: 700 16px var(--font-body); padding: 10px 18px 13px !important; }
.v2 .zad-quiz-test-time-sticky { font: 700 15px var(--font-body); color: var(--brand-deep); }

/* test result (same template) */
.v2 .zad-quiz-test-content-result-new .result { background: var(--card); border: 1.5px solid var(--line); border-radius: 24px; padding: 22px 16px; margin-top: 14px; }
.v2 .zad-quiz-test-content-result-new .res { font: 600 14px/1.4 var(--font-body); color: var(--muted); }
.v2 .result-stats span { color: var(--muted); font-size: 14px; }
.v2 .result-stats b { color: var(--ink); font: 800 22px var(--font-display); direction: ltr; display: inline-block; }
.v2 .show-answers { background: var(--brand-tint) !important; color: var(--brand-deep) !important; }
.v2 .zad-quiz-test-content-wrap.answer-correct { border-inline-start: 6px solid var(--ok) !important; }
.v2 .zad-quiz-test-content-wrap.answer-incorrect { border-inline-start: 6px solid var(--no) !important; }
.v2 .zad-quiz-test-answer-option { display: flex !important; align-items: center; gap: 10px; width: auto !important; float: none !important; margin: 0 !important; padding: 12px 14px !important; background: var(--card) !important; color: var(--ink) !important; border: 2px solid var(--line) !important; border-radius: 16px !important; font: 600 16px/1.5 var(--font-body); }
.v2 .zad-quiz-test-answer-option.correct { background: var(--ok-tint) !important; border-color: var(--ok) !important; }
.v2 .zad-quiz-test-answer-option.false { background: var(--no-tint) !important; border-color: var(--no) !important; }
.v2 .zad-quiz-test-answer-option .fa-check { color: var(--ok); margin-inline-start: auto; }
.v2 .zad-quiz-test-answer-option.false::after { content: "إجابتك"; margin-inline-start: auto; font-size: 12px; font-weight: 700; color: var(--no); }

/* file page top (styles/tpl/v2/tpl_header.php) */
.v2 .file-head { padding-top: 16px; }
.v2 .file-head h1 { font-size: 24px; line-height: 1.4; margin: 10px 0 0; }
.v2 .file-head .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.v2 .file-head .tag { font-size: 12.5px; padding: 3px 10px; }
.v2 .file-head a.tag.plain:hover { color: var(--brand-deep); background: var(--brand-tint); }
.v2 .facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.v2 .facts span { display: inline-flex; align-items: center; gap: 6px; }
.v2 .file-actions { display: flex; gap: 8px; margin: 16px 0 6px; }
.v2 .file-actions .btn-cta { flex: 1; }
.v2.v2-file h1.page-title { display: none; }
.v2.v2-file #breadcrumb .current, .v2.v2-file #breadcrumb .delimiter:has(+ .current) { display: none; }
.v2.v2-file #iframe, .v2.v2-file #file-iframe iframe { border: 1.5px solid var(--line) !important; border-radius: 16px; background: #fff; }
.v2 .fullscreen_iframe { border: 0 !important; background: var(--brand-tint); color: var(--brand-deep); border-radius: 12px !important; padding: 8px 14px !important; font-weight: 600; font-size: 14px !important; margin-bottom: 10px; }
.v2 #share-buttons h2.sub-title { font-size: 19px; }

/* trial copies: Google does not fill ads there, so show where they go */
.v2.v2-trial ins.adsbygoogle { position: relative; display: block !important; min-height: 90px; border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 12px; background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--muted) 6%, transparent) 10px 20px); }
.v2.v2-trial ins.adsbygoogle::before { content: "مساحة إعلان (Google)"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

/* ===== wider screens ===== */
@media (min-width: 760px) {
	.v2 .wrap, .v2 .v2-main > .zadpanel-container { padding-left: 28px; padding-right: 28px; }
	.v2 .head-search, .v2 .head-login { display: flex; }
	.v2 .page-search { display: none; }
	.v2 .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); padding: 46px 40px 40px; padding-inline-start: 72px; margin-top: 22px; border-radius: 32px; align-items: center; gap: 40px; }
	.v2 .hero::before { inset-inline-start: 44px; }
	.v2 .hero h1 { font-size: 50px; }
	.v2 .hero .lead { font-size: 18px; }
	.v2 .hero-card { display: block; }
	.v2 .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
	.v2 .book { min-height: 128px; padding: 14px; padding-inline-start: 24px; }
	.v2 .book .num { font-size: 46px; }
	.v2 .book .gname { font-size: 15px; }
	.v2 .tools { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
	.v2 .tool { padding: 18px; }
	.v2 .two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
	.v2 .two > div { min-width: 0; }
	.v2 .two > div + div { margin-top: 0; }
	.v2 .two > div:only-child { grid-column: 1 / -1; }
	.v2 .block { margin-top: 40px; }
	.v2 .block-first { margin-top: 22px; }
	.v2 h2 { font-size: 26px; }
	.v2 .page-head { padding-top: 18px; }
	.v2 .page-head h1, .v2 h1.page-title { font-size: 38px; }
	.v2 .subjects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
	.v2 .subject { padding: 16px; }
	.v2 .terms { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
	.v2 .v2-foot .wrap { grid-template-columns: 1.4fr 1fr; align-items: start; }
	.v2 .file-head h1 { font-size: 32px; }
	.v2 .steps { grid-template-columns: 1fr 1fr; align-items: start; }
	.v2 .steps > .step:first-child, .v2 .steps > #v2-lessons-step { grid-column: 1 / -1; }
	.v2 .steps > .v2-error, .v2 .steps > .sticky-cta { grid-column: 1 / -1; }
	.v2 .sticky-cta { max-width: 420px; width: 100%; margin-inline: auto; background: none; }
	.v2 .file-actions { max-width: 520px; }
	.v2 .fthumb { width: 104px; }
	.v2 .file-row { gap: 14px; }
}
@media (min-width: 992px) {
	.v2 .v2-nav { display: flex; }
	.v2 .menu-btn, .v2 .v2-drawer { display: none !important; }
	.v2 .with-aside { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
	.v2 .with-aside > aside { position: sticky; top: 88px; }
	.v2 .shelf { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.v2 .subjects { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
	.v2 .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.v2 .hero h1 { font-size: 28px; }
	.v2 .logo span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.v2 *, .v2 *::before, .v2 *::after { transition: none !important; animation: none !important; }
}
.v2 #download, .v2 #iframe, .v2 #file-iframe, .v2 #grades { scroll-margin-top: 84px; }
