/* ============================================================
   DiplomaOne — Professional design system
   Clean corporate edtech: white surfaces, slate ink, indigo accent
   ============================================================ */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --border: #e5e8ee;
  --border-strong: #cbd5e1;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --brand-softer: #f5f7ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --sky: #0369a1;
  --sky-soft: #f0f9ff;
  --rose: #be123c;
  --rose-soft: #fff1f2;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px -14px rgba(15, 23, 42, 0.18);
  --font: "Inter", "Noto Sans Gujarati", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* never let styling override the hidden attribute */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 0; }

.section-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
main { display: block; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.ic-sm { width: 14px; height: 14px; }

/* ------------------------------------------------------------ typography */
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -0.025em; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.2vw, 3.05rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { color: var(--body); }
.accent { color: var(--brand); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 14px;
}
.eyebrow .ic { width: 15px; height: 15px; }

.section-heading { margin-bottom: 32px; }
.section-heading.centered { text-align: center; }
.split-heading { display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px; align-items: end; }
.heading-copy { font-size: 0.98rem; color: var(--muted); max-width: 44ch; }
.heading-copy a { color: var(--brand); font-weight: 600; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-shell {
  max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 66px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.14rem; letter-spacing: -0.02em; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, #6d63f1 100%);
  color: #fff; font-size: 0.95rem; font-weight: 800; letter-spacing: 0;
  box-shadow: 0 4px 10px -3px rgba(79, 70, 229, 0.5);
}
.brand-name span { color: var(--brand); }

.desktop-nav { display: flex; gap: 2px; }
.desktop-nav a {
  padding: 8px 13px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
  color: var(--muted); transition: color 0.15s ease, background 0.15s ease;
  border-bottom: 2px solid transparent;
}
.desktop-nav a:hover { color: var(--ink); background: var(--brand-softer); }
.desktop-nav a.active { color: var(--brand); background: var(--brand-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.language-switch {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--body);
  padding: 7px 13px; border-radius: 8px; font-weight: 600; font-size: 0.84rem;
  transition: all 0.15s ease;
}
.language-switch:hover { border-color: var(--brand); color: var(--brand); }
.language-switch .ic { width: 15px; height: 15px; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 8px;
  font-weight: 700; font-size: 0.86rem; box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.5);
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-cta:hover { background: var(--brand-dark); transform: translateY(-1px); }

.menu-button {
  display: none; flex-direction: column; gap: 5px; background: none; border: none;
  cursor: pointer; padding: 8px;
}
.menu-button span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; display: block; }
.mobile-nav { display: flex; flex-direction: column; padding: 8px 24px 14px; gap: 2px; border-top: 1px solid var(--border); }
.mobile-nav a { padding: 11px 12px; border-radius: 8px; font-weight: 600; font-size: 0.94rem; color: var(--muted); }
.mobile-nav a.active { color: var(--brand); background: var(--brand-soft); }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  background:
    radial-gradient(60% 90% at 85% 10%, rgba(79, 70, 229, 0.07) 0%, transparent 60%),
    radial-gradient(50% 80% at 10% 90%, rgba(3, 105, 161, 0.05) 0%, transparent 55%);
  border-bottom: 1px solid var(--border);
}
.hero-shell {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
  padding-top: 76px; padding-bottom: 76px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #dfe3ff;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 { margin-bottom: 18px; }
.hero-lede { font-size: 1.08rem; color: var(--muted); max-width: 50ch; margin-bottom: 30px; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 38px; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; cursor: pointer; padding: 13px 22px; border-radius: 10px;
  font-weight: 700; font-size: 0.94rem; font-family: inherit;
  transition: all 0.16s ease;
}
.button-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.55); }
.button-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { background: var(--navy-2); transform: translateY(-1px); }
.button-outline { background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); }
.button-outline:hover { border-color: var(--ink); }
.text-link { font-weight: 700; color: var(--brand); font-size: 0.94rem; }
.text-link:hover { color: var(--brand-dark); }

.hero-stats {
  display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; max-width: 560px;
}
.hero-stats > div {
  flex: 1; padding: 16px 10px; text-align: center;
  border-right: 1px solid var(--border);
}
.hero-stats > div:last-child { border-right: none; }
.hero-stats b { display: block; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.hero-stats span { font-size: 0.72rem; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }

/* hero preview panel */
.hero-visual { position: relative; }
.panel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 9px;
  background: var(--navy); color: #cbd5e1; padding: 12px 18px;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em;
}
.panel-head .ic { width: 15px; height: 15px; color: var(--brand); }
.panel-row {
  display: flex; align-items: center; gap: 13px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); transition: background 0.15s ease;
}
.panel-row:hover { background: var(--brand-softer); }
.panel-row:last-child { border-bottom: none; }
.panel-row .ic { color: var(--brand); }
.panel-row b { display: block; font-size: 0.92rem; font-weight: 700; }
.panel-row span { display: block; font-size: 0.78rem; color: var(--muted); }
.panel-row .pr-arrow { margin-left: auto; color: var(--faint); }
.panel-more { text-align: center; font-family: var(--mono); font-size: 0.8rem; color: var(--faint); padding: 10px; }
.panel-float {
  position: absolute; bottom: -22px; left: -26px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 13px 17px;
  display: flex; align-items: center; gap: 11px;
}
.panel-float .ic { color: var(--green); width: 22px; height: 22px; }
.panel-float b { display: block; font-size: 0.95rem; font-weight: 800; }
.panel-float span { font-size: 0.74rem; color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------------ notice bar */
.notice-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--brand-soft); border: 1px solid #dfe3ff;
  border-radius: var(--radius); padding: 13px 18px; margin: 34px 0;
}
.notice-bar .ic { color: var(--brand); }
.notice-bar p { font-size: 0.9rem; color: var(--body); }
.notice-bar strong { color: var(--brand-dark); }

/* ------------------------------------------------------------- base card */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

/* ------------------------------------------------------------ branch grid */
#branches { padding: 56px 0 20px; }
.branch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 44px; }
.branch-card { padding: 24px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.branch-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), #8b7cf8); opacity: 0;
  transition: opacity 0.18s ease;
}
a.branch-card:hover::after { opacity: 1; }
.branch-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.icon-tile {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
}
.icon-tile .ic { width: 22px; height: 22px; }
.tint-indigo { background: var(--brand-soft); color: var(--brand); }
.tint-emerald { background: var(--green-soft); color: var(--green); }
.tint-amber { background: var(--amber-soft); color: var(--amber); }
.tint-sky { background: var(--sky-soft); color: var(--sky); }
.tint-rose { background: var(--rose-soft); color: var(--rose); }
.tint-slate { background: #f1f5f9; color: #475569; }

.pill {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 11px;
}
.pill-outline { border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); }
.pill-soft { background: var(--brand-soft); color: var(--brand-dark); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }

.branch-card h3 { font-size: 1.14rem; margin-bottom: 2px; }
.card-sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 12px; }
.branch-desc { font-size: 0.88rem; color: var(--body); margin-bottom: 18px; flex-grow: 1; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 15px; border-top: 1px solid var(--border);
}
.mini-meta { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.go { display: inline-flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 700; color: var(--brand); }
.go .ic { width: 14px; height: 14px; transition: transform 0.15s ease; }
a.card:hover .go .ic { transform: translateX(3px); }

.branch-soon { border-style: dashed; background: repeating-linear-gradient(-45deg, #fff, #fff 11px, #fafbfc 11px, #fafbfc 22px); }
.branch-soon:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }

/* --------------------------------------------------------- common subjects */
#common-subjects { padding-bottom: 44px; }
.common-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 48px; }
.common-card {
  padding: 18px 16px; display: flex; flex-direction: column; gap: 3px; position: relative;
}
.common-card .icon-tile { width: 38px; height: 38px; border-radius: 10px; margin-bottom: 10px; }
.common-card .icon-tile .ic { width: 18px; height: 18px; }
.common-card b { font-size: 0.9rem; line-height: 1.35; font-weight: 700; padding-right: 18px; }
.common-card .card-sub { margin-bottom: 0; font-size: 0.78rem; }
.common-card .go { position: absolute; top: 16px; right: 14px; color: var(--faint); }
.common-card:hover .go { color: var(--brand); }

/* ------------------------------------------------------------------ steps */
.how-section { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 70px 0; margin: 30px 0; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px; position: relative; }
.step-num {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500; color: var(--brand);
  background: var(--brand-soft); border-radius: 7px; padding: 3px 9px; display: inline-block; margin-bottom: 14px;
}
.step .icon-tile { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 14px; }
.step h3 { margin-bottom: 7px; font-size: 0.99rem; }
.step p { font-size: 0.85rem; color: var(--muted); }

/* --------------------------------------------------------------- why free */
.why-section { padding: 70px 0 30px; }
.why-card {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 44px; align-items: center;
  background: var(--navy); border-radius: 18px; padding: 48px; color: #fff;
  position: relative; overflow: hidden;
}
.why-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(55% 80% at 88% 20%, rgba(99, 91, 255, 0.35) 0%, transparent 60%);
}
.why-copy { position: relative; }
.why-copy h2 { color: #fff; margin-bottom: 16px; }
.why-copy p { color: #94a3b8; margin-bottom: 12px; font-size: 0.96rem; }
.why-copy .text-link { color: #a5b4fc; }
.why-side { position: relative; display: flex; flex-direction: column; gap: 12px; }
.why-item {
  display: flex; align-items: center; gap: 13px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px; padding: 14px 17px;
}
.why-item .ic { color: #34d399; width: 20px; height: 20px; }
.why-item b { display: block; font-size: 0.92rem; color: #fff; }
.why-item span { font-size: 0.78rem; color: #94a3b8; }

/* --------------------------------------------------------- coming soon */
#coming-soon { padding: 40px 0 84px; }
.request-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.request-form label { display: flex; flex-direction: column; gap: 7px; font-weight: 600; font-size: 0.86rem; color: var(--ink); min-width: 300px; flex: 1; }
.request-form select, .request-form input, .request-form textarea {
  font-family: inherit; font-size: 0.93rem; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.request-form select:focus, .request-form input:focus, .request-form textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}
.request-form.stacked { flex-direction: column; align-items: stretch; }
.request-form.stacked label { min-width: 0; }
.form-note { font-size: 0.78rem; color: var(--faint); }

/* ------------------------------------------------------------ breadcrumbs */
.breadcrumb { margin: 24px 0 4px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; font-size: 0.83rem; }
.breadcrumb li { color: var(--faint); display: flex; align-items: center; gap: 4px; }
.breadcrumb li + li::before { content: "/"; color: var(--border-strong); margin: 0 5px; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb [aria-current] { color: var(--body); font-weight: 600; }

/* --------------------------------------------------------------- page hero */
.page-hero { padding: 22px 0 32px; }
.page-hero.compact { padding-bottom: 26px; }
.page-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.page-hero .gu { color: var(--muted); font-size: 1rem; margin-top: 4px; }
.page-hero-lede { max-width: 64ch; margin-top: 14px; font-size: 0.98rem; color: var(--muted); }
.meta-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.76rem; font-weight: 600; color: var(--body);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}
.chip .ic { width: 13px; height: 13px; color: var(--brand); }

.subject-hero-box {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 28px;
}
.subject-hero-box .icon-tile { width: 56px; height: 56px; border-radius: 14px; }
.subject-hero-box .icon-tile .ic { width: 26px; height: 26px; }

/* ----------------------------------------------------------- semester grid */
.semester-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 26px 0 44px; }
.semester-card { display: flex; align-items: center; gap: 16px; padding: 19px 20px; }
.sem-num {
  font-family: var(--mono); font-size: 1.18rem; font-weight: 500; color: var(--brand);
  background: var(--brand-soft); border-radius: 11px; min-width: 54px; height: 54px;
  display: grid; place-items: center; flex-shrink: 0;
}
.sem-info { flex-grow: 1; min-width: 0; }
.sem-info h3 { font-size: 1.03rem; }
.sem-info p { font-size: 0.82rem; color: var(--muted); }
.sem-extra { color: var(--brand); font-weight: 600; }
.semester-card .go { color: var(--faint); }
a.semester-card:hover .go { color: var(--brand); }

.info-note {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--sky-soft); border: 1px solid #d4ecfb; border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 46px;
}
.info-note .ic { color: var(--sky); margin-top: 2px; }
.info-note h2 { font-size: 1.05rem; margin-bottom: 6px; }
.info-note p { font-size: 0.9rem; }
.info-note a { color: var(--sky); font-weight: 700; }

/* ------------------------------------------------------------ subject grid */
.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 26px 0 44px; }
.subject-card { padding: 20px; display: flex; flex-direction: column; }
.subject-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 13px; }
.subject-head .icon-tile { width: 40px; height: 40px; border-radius: 10px; }
.subject-head .icon-tile .ic { width: 19px; height: 19px; }
.pdf-count { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 4px 9px; border-radius: 7px; white-space: nowrap; }
.subject-card h3 { font-size: 1.01rem; margin-bottom: 2px; }
.subject-card .gu { font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 15px; }
.chip-row .chip { padding: 3px 9px; font-size: 0.71rem; }
.card-foot-slim { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }

.ref-card { background: var(--brand-softer); border-color: #dfe3ff; }
a.ref-card:hover { border-color: var(--brand); }
.badge-row { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ref-note { font-size: 0.78rem; color: var(--muted); margin-top: auto; padding-top: 10px; }

/* ----------------------------------------------------------- subject page */
.subject-layout { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; padding-bottom: 40px; }
.material-section { margin-bottom: 30px; }
.material-head {
  display: flex; align-items: center; gap: 11px; margin-bottom: 13px;
}
.material-head .icon-tile { width: 34px; height: 34px; border-radius: 9px; }
.material-head .icon-tile .ic { width: 16px; height: 16px; }
.material-head h2 { font-size: 1.08rem; font-weight: 800; }
.count-badge {
  font-family: var(--mono); font-size: 0.72rem; color: var(--body);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}
.file-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.file-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 18px;
  border-bottom: 1px solid var(--border); transition: background 0.14s ease;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--brand-softer); }
.file-row > .ic { color: var(--brand); width: 20px; height: 20px; }
.file-name { min-width: 0; flex-grow: 1; }
.file-name b { display: block; font-size: 0.92rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name span { display: block; font-size: 0.73rem; color: var(--faint); font-family: var(--mono); letter-spacing: 0.03em; }
.btn-open {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-weight: 700; font-size: 0.82rem; color: var(--brand);
  border: 1px solid var(--brand); background: var(--surface); border-radius: 8px; padding: 8px 14px;
  transition: all 0.15s ease;
}
.btn-open:hover { background: var(--brand); color: #fff; }
.btn-open .ic { width: 13px; height: 13px; }
.viewer-hint { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--faint); margin-top: 4px; }

.subject-side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 14px; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.side-card h3 { font-size: 0.92rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side-card h3 .ic { width: 15px; height: 15px; color: var(--brand); }
.side-list { list-style: none; }
.side-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.86rem; }
.side-list li:last-child { border-bottom: none; }
.side-list b { font-weight: 600; }
.side-list span { color: var(--muted); font-size: 0.8rem; text-align: right; }
.price-card { background: var(--navy); border-color: var(--navy); }
.price-card .side-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em;
  background: rgba(52, 211, 153, 0.15); color: #34d399; border-radius: 999px; padding: 5px 12px; margin-bottom: 12px;
}
.price-card .side-badge .ic { width: 13px; height: 13px; }
.price-card p { color: #94a3b8; font-size: 0.84rem; }

/* related */
.related-section { padding-bottom: 66px; }
.related-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.related-card {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; font-size: 0.86rem; color: var(--body);
  transition: all 0.15s ease; box-shadow: var(--shadow-sm);
}
.related-card:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-softer); }
.related-card .ic { width: 14px; height: 14px; color: var(--faint); }
.related-card:hover .ic { color: var(--brand); }
.ref-tag { font-size: 0.68rem; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 2px 8px; font-weight: 700; }

/* ------------------------------------------------------------------- ads */
.ad-slot { margin: 34px auto; text-align: center; max-width: 1180px; padding: 0 24px; }
.ad-slot.section-wrap { margin-top: 8px; }
.ad-label {
  display: block; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 7px;
}
.ad-placeholder {
  border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface);
  min-height: 108px; display: grid; place-items: center; padding: 16px;
}
.ad-placeholder-tall { min-height: 300px; }
.ad-placeholder span { font-size: 0.8rem; color: var(--faint); }
.ad-slot.in-feed { margin: 0; padding: 12px 4px; }
.ad-slot.in-feed .ad-placeholder { min-height: 120px; }
.ad-slot.in-article { margin: 26px 0; text-align: center; }
.ad-slot.in-article .ad-placeholder { min-height: 150px; }
.viewer-native-ad { margin: 8px auto 14px; }
.viewer-native-ad .ad-native-card { min-height: 74px; text-align: left; }
.ad-native-card > div { display:flex; width:100%; justify-content:space-between; align-items:center; gap:16px; }
.ad-native-card strong { font-size:.86rem; color:var(--body); }
.ad-native-card span { display:block; font-size:.7rem; color:var(--faint); }
.viewer-after-ad { margin-top: 18px; }
.viewer-fullscreen { margin-left:auto; white-space:nowrap; }
.viewer-page.pdf-reading { padding-top: 0; }
.viewer-page.pdf-reading .site-header,
.viewer-page.pdf-reading .viewer-back,
.viewer-page.pdf-reading .viewer-toolbar,
.viewer-page.pdf-reading .viewer-after-ad,
.viewer-page.pdf-reading .site-footer { display:none; }
.viewer-page.pdf-reading .section-wrap { max-width:none; width:100%; padding:0; margin:0; }
.viewer-page.pdf-reading .pdf-frame { height:100vh; min-height:100vh; border-radius:0; border:0; box-shadow:none; background:#111; }
.pure-pdf-frame { width:100%; height:100%; min-height:100vh; border:0; display:block; background:#111; }
@media (max-width: 640px) {
  .viewer-native-ad { margin: 4px 0 10px; padding: 0 10px; }
  .ad-native-card > div { align-items:flex-start; }
}


/* ---------------------------------------------------------------- viewer */
.viewer-page { padding: 24px 0 56px; }
.viewer-back {
  display: inline-flex; gap: 7px; align-items: center; font-weight: 600; font-size: 0.86rem;
  color: var(--muted); margin-bottom: 16px;
}
.viewer-back:hover { color: var(--brand); }
.viewer-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.viewer-title h1 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); }
.viewer-meta { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin-top: 5px; }
.viewer-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pdf-frame { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.pdf-frame iframe { width: 100%; height: 78vh; border: none; display: block; }
.pdf-canvas-holder { max-height: 78vh; overflow: auto; padding: 12px; background: #eef0f4; }
.pdf-page-canvas { width: 100%; display: block; margin: 0 auto 12px; border-radius: 4px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12); }
.viewer-status { padding: 70px 24px; text-align: center; }
.viewer-status .big-icon { font-size: 2.4rem; margin-bottom: 16px; }
.viewer-status h2 { margin-bottom: 10px; font-size: 1.3rem; }
.viewer-status p { max-width: 54ch; margin: 0 auto; font-size: 0.94rem; }

/* ------------------------------------------------------------ legal pages */
.prose-page { padding: 24px 0 76px; }
.prose-page h2 { font-size: 1.15rem; margin: 30px 0 10px; }
.prose-page p, .prose-page li { color: var(--body); font-size: 0.95rem; }
.prose-page ul { padding-left: 22px; margin: 10px 0; }
.prose-page li { margin-bottom: 7px; }
.prose-page .lead { font-size: 1.02rem; color: var(--ink); font-weight: 600; margin-bottom: 8px; }
.prose-page a { color: var(--brand); font-weight: 600; }
.contact-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; margin-top: 12px; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--navy); color: #cbd5e1; margin-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding: 54px 24px 42px; }
.footer-brand .brand { color: #fff; margin-bottom: 14px; display: inline-flex; }
.footer-brand p { color: #94a3b8; font-size: 0.88rem; max-width: 36ch; }
.footer-grid h4 {
  font-size: 0.74rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: #818cf8; margin-bottom: 14px; font-weight: 700;
}
.footer-grid a, .footer-grid .soon-link { display: block; color: #94a3b8; font-size: 0.88rem; padding: 5px 0; font-weight: 500; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 20px 24px;
  font-size: 0.82rem; color: #64748b;
}
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: #fff; }

/* --------------------------------------------------------- consent + toast */
.consent-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 90;
  max-width: 740px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.consent-banner p { font-size: 0.85rem; max-width: 50ch; }
.consent-banner a { color: var(--brand); font-weight: 600; }
.consent-actions { display: flex; gap: 9px; }
.consent-actions button {
  border: none; border-radius: 9px; padding: 10px 19px; font-weight: 700;
  font-size: 0.84rem; cursor: pointer; font-family: inherit;
}
.consent-accept { background: var(--brand); color: #fff; }
.consent-accept:hover { background: var(--brand-dark); }
.consent-decline { background: var(--bg); color: var(--body); border: 1px solid var(--border-strong) !important; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); z-index: 95;
  background: var(--navy); color: #fff; border-radius: 11px; padding: 13px 21px;
  font-size: 0.88rem; font-weight: 600; opacity: 0; pointer-events: none;
  transition: all 0.28s ease; max-width: min(90vw, 480px); text-align: center;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .hero-shell { grid-template-columns: 1fr; padding-top: 54px; padding-bottom: 60px; }
  .hero-visual { max-width: 520px; }
  .panel-float { left: auto; right: -10px; bottom: -20px; }
  .branch-grid, .semester-grid, .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .common-grid { grid-template-columns: repeat(3, 1fr); }
  .split-heading { grid-template-columns: 1fr; align-items: start; }
  .why-card { grid-template-columns: 1fr; padding: 36px; }
  .subject-layout { grid-template-columns: 1fr; }
  .subject-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .desktop-nav { display: none; }
  .nav-cta { display: none; }
  .menu-button { display: flex; }
  .branch-grid, .semester-grid, .subject-grid, .steps-grid { grid-template-columns: 1fr; }
  .common-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { flex-wrap: wrap; }
  .hero-stats > div { flex: 1 1 45%; border-bottom: 1px solid var(--border); }
  .file-row { flex-wrap: wrap; }
  .btn-open { width: 100%; justify-content: center; }
  .consent-banner { left: 10px; right: 10px; bottom: 10px; }
  .panel-float { display: none; }
  .subject-hero-box { flex-direction: column; }
}
@media (max-width: 380px) {
  .common-grid { grid-template-columns: 1fr; }
  .section-wrap { padding: 0 16px; }
}

/* ================================================================ UPDATES =
   Language tabs + welcome screen + inline ads (v2)
   ========================================================================== */

/* ------------------------------------------------------- language tabs */
.lang-tabs {
  display: inline-flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 22px;
}
.lang-tab {
  border: 1px solid transparent; background: transparent; padding: 9px 24px;
  border-radius: 9px; font-weight: 700; font-size: 0.9rem; color: var(--muted);
  cursor: pointer; transition: all 0.15s ease; font-family: inherit;
}
.lang-tab:hover { color: var(--ink); }
.lang-tab.active {
  background: var(--surface); color: var(--brand); border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.material-view { display: none; }
.material-view.active { display: block; animation: viewFade 0.25s ease; }
@keyframes viewFade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.file-row.empty-row { background: var(--bg); }
.file-row.empty-row .file-name b { color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------ welcome screen */
.welcome-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
  padding: 24px; transition: opacity 0.4s ease;
}
.welcome-screen.fade-out { opacity: 0; pointer-events: none; }
.welcome-inner { text-align: center; color: #fff; max-width: 540px; animation: welcomeRise 0.55s ease; }
.welcome-screen .brand-logo {
  width: 78px; height: 78px; font-size: 2.15rem; border-radius: 22px; margin-bottom: 22px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 24px 55px -14px rgba(99, 102, 241, 0.65);
}
.welcome-title { font-size: clamp(2rem, 6vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; color: #fff; }
.welcome-title span { color: #a5b4fc; }
.welcome-tag { color: #c7d2fe; font-size: 1.06rem; margin-bottom: 8px; }
.welcome-sub {
  color: #818cf8; font-family: var(--mono); font-size: 0.76rem;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 36px;
}
.welcome-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.welcome-actions .button { padding: 14px 26px; font-size: 0.98rem; }
.welcome-start { background: #fff; color: var(--ink); box-shadow: 0 14px 34px -12px rgba(255, 255, 255, 0.45); }
.welcome-start:hover { background: #eef2ff; }
.button-ghost { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.28); color: #fff; }
.button-ghost:hover { background: rgba(255, 255, 255, 0.15); }
.welcome-note { color: #64748b; font-size: 0.8rem; }
@keyframes welcomeRise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
body.welcome-open { overflow: hidden; }

/* ------------------------------------------------------- inline ad slot */
.ad-slot.ad-inline { max-width: none; padding: 0; margin: 26px 0; }

/* ================================================================ UPDATES =
   Bookshelf library + centered hero + footer language switch (v3)
   ========================================================================== */

/* centered hero (homepage) */
.hero-center { display: block; text-align: center; padding-top: 54px; padding-bottom: 44px; }
.hero-center .hero-lede { margin-left: auto; margin-right: auto; }
.hero-center .hero-actions { justify-content: center; }
.hero-center .hero-stats { margin: 0 auto; }
.section-heading.centered .heading-copy { margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------ bookshelf */
.shelf-section { padding: 26px 0 40px; }
.bookshelf { overflow: hidden; }
.shelf-row {
  display: flex; align-items: flex-end; gap: 18px;
  overflow-x: auto; padding: 26px 6px 0;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.shelf-board {
  height: 16px; border-radius: 8px; margin-top: 2px;
  background: linear-gradient(180deg, #334155, #1e293b);
  box-shadow: 0 18px 28px -16px rgba(15, 23, 42, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.shelf-hint { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 18px; }

/* the books */
.book {
  position: relative; flex: 0 0 192px; height: 300px;
  border-radius: 5px 12px 12px 5px; scroll-snap-align: start;
  /* right edge = visible page stack */
  background: repeating-linear-gradient(to bottom, #ffffff 0, #ffffff 3px, #d8dde5 3px, #d8dde5 5px);
  padding-right: 7px;
  box-shadow: 0 18px 28px -18px rgba(15, 23, 42, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.book:hover {
  transform: translateY(-12px) rotate(-1.4deg);
  box-shadow: 0 30px 40px -20px rgba(15, 23, 42, 0.6);
}
.book-cover {
  position: absolute; top: 0; bottom: 0; left: 0; right: 7px;
  border-radius: 5px 9px 9px 5px;
  padding: 20px 14px 16px; display: flex; flex-direction: column;
  color: #fff; overflow: hidden;
}
.book-cover::before {   /* spine shading */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 16px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0.05));
  border-radius: 5px 0 0 5px;
}
.book-cover::after {    /* gloss highlight */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.16) 0%, transparent 32%);
}
.book-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.16); margin-bottom: 14px; position: relative;
}
.book-icon .ic { width: 18px; height: 18px; color: #fff; }
.book-title { font-size: 1.05rem; font-weight: 800; line-height: 1.28; letter-spacing: -0.01em; position: relative; }
.book-gu { font-size: 0.78rem; opacity: 0.85; margin-top: 3px; position: relative; }
.book-meta {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.09em;
  text-transform: uppercase; opacity: 0.82; margin-top: 12px; position: relative;
}
.book-open { margin-top: auto; font-weight: 800; font-size: 0.86rem; position: relative; }
.book:hover .book-open { text-decoration: underline; }

/* branch cover colours */
.book-chemical .book-cover    { background: linear-gradient(160deg, #059669, #065f46); }
.book-mechanical .book-cover  { background: linear-gradient(160deg, #ea580c, #9a3412); }
.book-civil .book-cover       { background: linear-gradient(160deg, #64748b, #334155); }
.book-electrical .book-cover  { background: linear-gradient(160deg, #eab308, #a16207); }
.book-computer .book-cover    { background: linear-gradient(160deg, #4f46e5, #3730a3); }
.book-it .book-cover          { background: linear-gradient(160deg, #0ea5e9, #075985); }

/* coming-soon books */
.book-soon { opacity: 0.55; filter: saturate(0.35); }
.book-soon .book-cover { border: 2px dashed rgba(255, 255, 255, 0.45); }
.book-soon:hover { transform: none; box-shadow: 0 18px 28px -18px rgba(15, 23, 42, 0.55); }
.coming-tag {
  margin-top: auto; position: relative; align-self: flex-start;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 5px 11px;
}

/* ads that live on the shelf (fill the remaining space) */
.ad-slot.book-ad {
  flex: 1 1 240px; min-width: 230px; margin: 0; max-width: none; padding: 0;
  display: flex; flex-direction: column;
}
.ad-slot.book-ad .ad-placeholder { flex: 1; min-height: 280px; border-radius: 10px; }

/* --------------------------------------------------- footer language */
.footer-lang { display: inline-flex; align-items: center; gap: 7px; }
.footer-lang .sep { color: #475569; }
.footer-lang button {
  background: none; border: none; cursor: pointer; padding: 2px 2px;
  color: #94a3b8; font-weight: 700; font-size: 0.82rem; font-family: inherit;
}
.footer-lang button:hover { color: #fff; }
.footer-lang button.active { color: #a5b4fc; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 680px) {
  .book { flex-basis: 168px; height: 268px; }
  .book-title { font-size: 0.94rem; }
  .book-cover { padding: 16px 12px 14px; }
  .shelf-row { gap: 14px; }
}

/* ================================================================ UPDATES =
   v4 — vertical bookcase wall + merged one-screen material rows
   ========================================================================== */

/* ---- bookcase: shelves stacked vertically, books fill every place ---- */
.shelf-section { padding: 26px 0 46px; }
.bookcase { position: relative; padding: 0 14px; }
.bookcase::before, .bookcase::after {
  content: ""; position: absolute; top: 0; bottom: 8px; width: 13px; border-radius: 7px;
  background: linear-gradient(180deg, #3b4b63, #1e293b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 22px -12px rgba(15, 23, 42, 0.55);
}
.bookcase::before { left: 0; }
.bookcase::after { right: 0; }
.shelf-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center;
  gap: 16px; padding: 26px 8px 0; overflow: visible;
}
.shelf-board { margin-top: 2px; }

/* ---- book sizes ---- */
.book { flex: 0 0 208px; height: 312px; }
.book-common { flex: 0 0 158px; height: 248px; }
.book-common .book-cover { padding: 14px 12px 12px; }
.book-common .book-title { font-size: 0.9rem; margin-top: 10px; }
.book-common .book-gu { font-size: 0.7rem; }
.book-common .book-icon { width: 30px; height: 30px; margin-bottom: 0; }
.book-common .book-icon .ic { width: 15px; height: 15px; }
.book-soon { flex: 0 0 178px; height: 274px; }
.book-chip {
  position: relative; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 4px 8px;
  align-self: flex-start; margin-bottom: 12px; text-transform: uppercase;
}
.book-common .book-open { font-size: 0.78rem; }

/* ---- common subject cover colours ---- */
.book-common-1 .book-cover { background: linear-gradient(160deg, #4f46e5, #3730a3); }
.book-common-2 .book-cover { background: linear-gradient(160deg, #0891b2, #155e75); }
.book-common-3 .book-cover { background: linear-gradient(160deg, #059669, #065f46); }
.book-common-4 .book-cover { background: linear-gradient(160deg, #d97706, #92400e); }
.book-common-5 .book-cover { background: linear-gradient(160deg, #e11d48, #9f1239); }

/* ---- brand bookend ---- */
.book-brand { flex: 0 0 178px; height: 274px; }
.book-brand .book-cover {
  background: linear-gradient(160deg, #0f172a, #1e1b4b);
  align-items: flex-start; justify-content: center;
}
.book-icon-d {
  font-size: 2.3rem; font-weight: 800; color: #a5b4fc; line-height: 1;
  margin-bottom: 14px; position: relative;
}
.book-brand .book-title { font-size: 1.2rem; color: #fff; }
.book-brand .tt-one { color: #a5b4fc; }
.book-brand .book-gu { margin-top: 4px; }

/* ---- shelf ad fills the remaining space of its row ---- */
.ad-slot.book-ad .ad-placeholder { min-height: 300px; }

/* ---- merged material rows: side-by-side language buttons ---- */
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-lang {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.02em;
  border-radius: 8px; padding: 8px 14px; border: 1.5px solid;
  transition: all 0.15s ease; font-family: var(--mono);
}
.btn-en { border-color: var(--brand); color: var(--brand); background: var(--surface); }
.btn-en:hover { background: var(--brand); color: #fff; }
.btn-gu { border-color: var(--green); color: var(--green); background: var(--surface); }
.btn-gu:hover { background: var(--green); color: #fff; }

/* ---- responsive ---- */
@media (max-width: 680px) {
  .book { flex-basis: 176px; height: 274px; }
  .book-common { flex-basis: 142px; height: 226px; }
  .book-soon, .book-brand { flex-basis: 156px; height: 246px; }
  .shelf-row { gap: 12px; padding: 20px 4px 0; }
  .bookcase { padding: 0 8px; }
  .bookcase::before, .bookcase::after { width: 9px; }
  .ad-slot.book-ad { flex-basis: 100%; }
  .ad-slot.book-ad .ad-placeholder { min-height: 130px; }
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; }
  .btn-lang { flex: 1; justify-content: center; }
}

/* ================================================================ UPDATES =
   v5 — whole site as bookcases: slim heads, chapter books, palettes
   ========================================================================== */

/* slim page heads (main content only) */
.slim-page { padding-bottom: 56px; }
.slim-head { padding: 18px 0 10px; }
.slim-head h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.slim-head .gu { color: var(--muted); margin-top: 2px; font-size: 0.98rem; }
.slim-head .meta-chips { margin-top: 14px; }

/* section shelves on subject pages */
.section-shelf { margin-bottom: 2px; }
.shelf-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.02rem; font-weight: 800; margin: 24px 0 0; letter-spacing: -0.01em;
}
.shelf-row.ad-only { padding-top: 20px; }

/* semester books (branch page) */
.book-sem { flex: 0 0 196px; height: 300px; }
.book-num {
  font-family: var(--mono); font-size: 2.1rem; font-weight: 500;
  opacity: 0.92; position: relative; margin-bottom: 12px; line-height: 1;
}

/* subject books (semester + common pages) */
.book-subj { flex: 0 0 176px; height: 272px; }
.book-subj .book-cover { padding: 16px 13px 13px; }
.book-subj .book-title { font-size: 0.95rem; margin-top: 8px; }
.book-subj .book-chip { margin-bottom: 0; }

/* chapter books (subject pages) */
.book-chap { flex: 0 0 156px; height: 232px; }
.book-chap .book-cover { padding: 13px 11px 11px; }
.book-chap .book-chip { margin-bottom: 0; }
.book-chap .book-title {
  font-size: 0.84rem; margin-top: 9px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.book-btns { margin-top: auto; display: flex; gap: 7px; position: relative; }
.bb {
  flex: 1; text-align: center; font-family: var(--mono); font-weight: 600; font-size: 0.74rem;
  border-radius: 7px; padding: 7px 4px; background: rgba(255, 255, 255, 0.16);
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); transition: all 0.15s ease;
}
.bb:hover { background: #fff; color: var(--ink); }

/* rotating cover palettes */
.pal-1 .book-cover { background: linear-gradient(160deg, #4f46e5, #3730a3); }
.pal-2 .book-cover { background: linear-gradient(160deg, #0891b2, #155e75); }
.pal-3 .book-cover { background: linear-gradient(160deg, #059669, #065f46); }
.pal-4 .book-cover { background: linear-gradient(160deg, #d97706, #92400e); }
.pal-5 .book-cover { background: linear-gradient(160deg, #e11d48, #9f1239); }

/* linked/common-ref books on semester shelves */
.book-ref .book-cover { border: 2px dashed rgba(255, 255, 255, 0.45); }

/* single Common Subjects book on homepage */
.book-commonbook { flex: 0 0 208px; height: 312px; }
.book-commonbook .book-cover { background: linear-gradient(160deg, #4f46e5, #312e81); }
.book-commonbook .book-icon { margin-bottom: 10px; }

/* responsive */
@media (max-width: 680px) {
  .book-sem { flex-basis: 170px; height: 268px; }
  .book-subj { flex-basis: 156px; height: 246px; }
  .book-chap { flex-basis: 142px; height: 216px; }
  .book-commonbook { flex-basis: 176px; height: 278px; }
  .book-chap .book-title { -webkit-line-clamp: 4; font-size: 0.8rem; }
}

/* ================================================================ v6 ======
   welcome polish (single CTA + mini book spines)
   ========================================================================== */
.welcome-books {
  display: flex; align-items: flex-end; gap: 5px;
  margin: 0 auto 24px; width: max-content;
  padding: 0 3px 7px; border-bottom: 3px solid rgba(255, 255, 255, 0.28);
  border-radius: 0 0 2px 2px;
}
.wb { display: block; width: 17px; border-radius: 3px 3px 0 0; box-shadow: inset -3px 0 0 rgba(0, 0, 0, 0.14); }
.wb-1 { height: 32px; background: linear-gradient(160deg, #4f46e5, #3730a3); }
.wb-2 { height: 44px; background: linear-gradient(160deg, #059669, #065f46); }
.wb-3 { height: 28px; background: linear-gradient(160deg, #d97706, #92400e); transform: rotate(-5deg); }
.wb-4 { height: 41px; background: linear-gradient(160deg, #e11d48, #9f1239); }
.wb-5 { height: 25px; background: linear-gradient(160deg, #0891b2, #155e75); transform: rotate(4deg); }
.welcome-tag { margin-bottom: 6px; }
.welcome-actions { margin-bottom: 20px; }
.welcome-actions .welcome-start { flex-direction: row-reverse; padding: 15px 30px; font-size: 1.02rem; }

/* view-only PDF frame protection */
.pdf-frame { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pdf-frame canvas { pointer-events: none; }

/* ================================================================
   DiplomaOne redesign — colourful, responsive book layout
   Mobile-first: two books per row for Android users.
   ================================================================ */
:root {
  --brand: #635bff;
  --brand-dark: #4f46e5;
  --brand-soft: #eeecff;
  --brand-softer: #f8f7ff;
}

/* Make every book shelf a responsive grid instead of a single-file row. */
.shelf-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
  justify-content: initial;
  gap: 18px;
  padding: 24px 10px 0;
}
.shelf-row .book,
.shelf-row .book-common,
.shelf-row .book-soon,
.shelf-row .book-brand {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: none;
  height: 300px;
}
.shelf-row .book-common { height: 260px; }
.shelf-row .book-soon,
.shelf-row .book-brand { height: 270px; }
.shelf-row .book-cover { min-height: 100%; }

/* More attractive, clearly different colour families. */
.book-chemical .book-cover { background: linear-gradient(145deg, #00b894 0%, #00695c 100%); }
.book-mechanical .book-cover { background: linear-gradient(145deg, #ff8a00 0%, #d4380d 100%); }
.book-commonbook .book-cover { background: linear-gradient(145deg, #7c3aed 0%, #4338ca 100%); }
.book-civil .book-cover { background: linear-gradient(145deg, #64748b 0%, #334155 100%); }
.book-electrical .book-cover { background: linear-gradient(145deg, #facc15 0%, #ca8a04 100%); }
.book-computer .book-cover { background: linear-gradient(145deg, #38bdf8 0%, #2563eb 100%); }
.book-it .book-cover { background: linear-gradient(145deg, #f472b6 0%, #be185d 100%); }
.book-brand .book-cover { background: linear-gradient(145deg, #111827 0%, #312e81 55%, #635bff 100%); }
.pal-1 .book-cover { background: linear-gradient(145deg, #6366f1, #312e81); }
.pal-2 .book-cover { background: linear-gradient(145deg, #06b6d4, #155e75); }
.pal-3 .book-cover { background: linear-gradient(145deg, #10b981, #065f46); }
.pal-4 .book-cover { background: linear-gradient(145deg, #f59e0b, #b45309); }
.pal-5 .book-cover { background: linear-gradient(145deg, #f43f5e, #9f1239); }

.book-cover { box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.book:hover { transform: translateY(-5px); }

/* Ads: reserve useful space near content, never force an ad to the bottom. */
.shelf-row .book-ad {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  margin: 0;
  min-height: 116px;
}
.shelf-row .book-ad .ad-placeholder { min-height: 116px; }
.ad-label { margin-bottom: 8px; }

/* PDF viewer: one top ad only; reading area gets maximum space. */
.viewer-page .viewer-native-ad { margin: 10px auto 18px; }
.viewer-page .viewer-after-ad { display: none !important; }
.viewer-page .pdf-frame { min-height: 72vh; }

@media (min-width: 1100px) {
  .shelf-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .shelf-row .book-ad { grid-column: 1 / -1; }
}
@media (min-width: 681px) and (max-width: 1099px) {
  .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .shelf-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 4px 0;
  }
  .shelf-row .book,
  .shelf-row .book-common,
  .shelf-row .book-soon,
  .shelf-row .book-brand {
    height: 255px;
  }
  .shelf-row .book-cover { padding: 14px 11px 12px; }
  .shelf-row .book-title { font-size: .86rem; line-height: 1.25; }
  .shelf-row .book-gu { font-size: .68rem; }
  .shelf-row .book-open { font-size: .76rem; }
  .shelf-row .book-ad { grid-column: 1 / -1; min-height: 105px; }
  .shelf-row .book-ad .ad-placeholder { min-height: 105px; }
  .bookcase { padding: 0 8px; }
}
@media (max-width: 360px) {
  .shelf-row { gap: 8px; }
  .shelf-row .book,
  .shelf-row .book-common,
  .shelf-row .book-soon,
  .shelf-row .book-brand { height: 235px; }
  .shelf-row .book-title { font-size: .78rem; }
}

/* DiplomaOne redesign: compact subject headers and revenue-ready top ad space */
.slim-page > .breadcrumb,
.slim-head .eyebrow,
.slim-head > .gu,
.slim-head .meta-chips { display: none !important; }
.slim-head { padding: 22px 0 8px; }
.slim-head h1 { margin: 0; }
.top-content-ad { margin: 8px auto 22px; max-width: 1180px; padding: 0 24px; }
.top-content-ad .ad-placeholder { min-height: 110px; }

/* Keep the PDF page focused: one ad above the reader, no bottom ad blocks. */
.viewer-page .viewer-native-ad { display: block !important; margin: 8px auto 16px; }
.viewer-page .pdf-frame { min-height: 76vh; }
.viewer-page .viewer-after-ad,
.viewer-page .pdf-frame + .ad-slot { display: none !important; }

@media (max-width: 680px) {
  .top-content-ad { padding: 0 10px; margin: 6px auto 16px; }
  .top-content-ad .ad-placeholder { min-height: 90px; }
  .slim-head { padding-top: 16px; }
}

/* AdSense placements */
.d1-ad-container{width:100%;max-width:100%;margin:14px auto 22px;min-height:90px;text-align:center;overflow:hidden}.d1-ad-top{margin-top:0}.d1-ad-label{display:block;font:10px/1.4 Arial,sans-serif;letter-spacing:.08em;text-transform:uppercase;opacity:.55;margin-bottom:5px}.d1-ad-container ins{max-width:100%;margin:auto}


/* ================================================================
   v6 — subject material hub: Notes / Paper Solutions / Other
   Each subject first opens a compact book-style material menu.
   ================================================================ */
.subject-material-hub { padding: 10px 0 52px; }
.subject-material-hub .hub-intro { color: var(--muted); font-size: .92rem; margin-top: 6px; }
.category-row { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 920px; margin: 8px auto 0; }
.category-row .book-category { display: block; width: 100%; min-width: 0; height: 300px; }
.category-row .book-cover { justify-content: flex-start; }
.book-category-notes .book-cover { background: linear-gradient(145deg, #6366f1, #312e81); }
.book-category-paper .book-cover { background: linear-gradient(145deg, #06b6d4, #155e75); }
.book-category-other .book-cover { background: linear-gradient(145deg, #f59e0b, #b45309); }
.book-category .book-meta { margin-top: 12px; }
.book-category .book-open { margin-top: auto; }
.material-subpage { padding-bottom: 56px; }
.material-subpage .bookcase { margin-top: 4px; }
.material-subpage .section-shelf { margin-bottom: 12px; }
.material-subpage .shelf-label { margin-top: 10px; }
.material-subpage .material-back { display:inline-flex; margin: 8px 0 2px; color:var(--muted); font-weight:700; font-size:.86rem; }
.material-subpage .material-back:hover { color:var(--brand); }
.material-empty { margin: 22px auto 36px; max-width: 620px; padding: 30px 22px; text-align:center; background:var(--surface); border:1px dashed var(--border-strong); border-radius:var(--radius); color:var(--muted); }

/* Fixed viewer shell: only the PDF iframe scrolls; the page itself stays fixed so the top ad remains visible. */
.viewer-page { height: 100dvh; min-height: 100vh; overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.viewer-page .site-header { flex: 0 0 auto; }
.viewer-page > main.section-wrap { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 1180px; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; padding: 8px 24px 10px; }
.viewer-page .viewer-back { flex: 0 0 auto; margin: 0 0 6px; }
.viewer-page .viewer-toolbar { flex: 0 0 auto; margin: 0 0 6px; }
.viewer-page .viewer-native-ad { flex: 0 0 auto; width: 100%; box-sizing: border-box; margin: 0 0 7px; padding: 0; max-width: none; }
.viewer-page .viewer-native-ad .d1-ad-container { margin: 0 auto; min-height: 70px; }
.viewer-page .pdf-frame { flex: 1 1 auto; min-height: 0; height: auto; }
.viewer-page .pdf-frame iframe { width: 100%; height: 100%; min-height: 0; display: block; }
.viewer-page .site-footer { display: none; }
@media (max-width: 900px) {
  .category-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .category-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 4px 0; }
  .category-row .book-category { height: 246px; }
  .category-row .book-cover { padding: 16px 12px 14px; }
  .category-row .book-title { font-size: .92rem; }
  .viewer-page > main.section-wrap { padding: 5px 8px 7px; }
  .viewer-page .viewer-back { margin-bottom: 4px; }
  .viewer-page .viewer-toolbar { margin-bottom: 4px; }
  .viewer-page .viewer-title h1 { font-size: 1rem; }
  .viewer-page .viewer-meta { display:none; }
  .viewer-page .viewer-fullscreen { font-size:.74rem; padding:7px 9px; }
  .viewer-page .viewer-native-ad { margin-bottom: 4px; }
}

/* Final responsive book grid: Android 2, tablet 3, desktop 4. */
.shelf-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .shelf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Viewer final: fixed app shell; only the embedded PDF area can scroll. */
.viewer-page { height:100dvh; min-height:100vh; overflow:hidden; padding:0; }
.viewer-page > main.section-wrap { height:auto; flex:1 1 auto; min-height:0; overflow:hidden; }
.viewer-page .pdf-frame { min-height:0; flex:1 1 auto; overflow:hidden; }
.viewer-page .pdf-frame iframe { height:100%; min-height:0; overflow:auto; }


/* PDF reader refinement: compact fixed shell with maximum reading area. */
.viewer-page .site-header { min-height: 0; }
.viewer-page .nav-shell { min-height: 64px; }
.viewer-page > main.section-wrap { padding: 4px 12px 6px; }
.viewer-page .viewer-back { font-size: .82rem; line-height: 1.2; margin: 0 0 3px; }
.viewer-page .viewer-toolbar { margin: 0 0 3px; min-height: 34px; }
.viewer-page .viewer-title h1 { margin: 0; font-size: clamp(.9rem, 2.2vw, 1.12rem); line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.viewer-page .viewer-meta { display:none; }
.viewer-page .viewer-fullscreen { display:none !important; }
.viewer-page .viewer-native-ad { margin: 0 0 4px; min-height: 54px; }
.viewer-page .viewer-native-ad .d1-ad-container { margin: 0 auto; min-height: 50px; height: 50px; overflow:hidden; }
.viewer-page .viewer-native-ad .d1-ad-label { font-size: 8px; line-height: 10px; margin-bottom: 1px; }
.viewer-page .viewer-native-ad ins.adsbygoogle { height: 38px !important; max-height:38px; overflow:hidden; }
.viewer-page .pdf-frame { flex: 1 1 auto; min-height: 0; height: auto; border-radius: 10px; }
.viewer-page .pdf-frame iframe { width:100%; height:100%; min-height:0; display:block; border:0; }
.viewer-page .site-footer { display:none; }
@media (max-width:680px) {
  .viewer-page .nav-shell { min-height: 60px; }
  .viewer-page > main.section-wrap { padding: 3px 7px 5px; }
  .viewer-page .viewer-back { font-size:.8rem; }
  .viewer-page .viewer-toolbar { min-height: 32px; }
  .viewer-page .viewer-title h1 { font-size:.93rem; line-height:1.16; }
  .viewer-page .viewer-native-ad { min-height:52px; margin-bottom:3px; }
  .viewer-page .viewer-native-ad .d1-ad-container { min-height:48px; height:48px; }
  .viewer-page .viewer-native-ad ins.adsbygoogle { height:36px !important; max-height:36px; }
  .viewer-page .pdf-frame { border-radius:8px; }
}


/* Compact reader banner: a real small banner footprint, without clipping responsive ads. */
.viewer-page .viewer-native-ad { min-height: 62px; height: 62px; }
.viewer-page .viewer-native-ad .d1-ad-container { width:100%; height:62px; min-height:62px; margin:0 auto; overflow:visible; }
.viewer-page .viewer-native-ad .d1-ad-container .d1-ad-label { font-size:7px; line-height:9px; margin:0 0 1px; }
.viewer-page .viewer-native-ad ins.adsbygoogle {
  display:block !important;
  width:300px !important;
  height:50px !important;
  max-width:100%;
  margin:0 auto !important;
}
@media (min-width:500px) {
  .viewer-page .viewer-native-ad { min-height:62px; height:62px; }
  .viewer-page .viewer-native-ad .d1-ad-container { height:62px; min-height:62px; }
  .viewer-page .viewer-native-ad ins.adsbygoogle { width:468px !important; height:50px !important; }
}
@media (min-width:800px) {
  .viewer-page .viewer-native-ad { min-height:92px; height:92px; }
  .viewer-page .viewer-native-ad .d1-ad-container { height:92px; min-height:92px; }
  .viewer-page .viewer-native-ad ins.adsbygoogle { width:728px !important; height:80px !important; }
}
