/* ============================================================
   බෞද්ධ ධර්ම පුස්තකාලය හා මෘදුකාංග — Modern Stable UI
   Clean · Traditional Serif Font · High Contrast · Responsive
   ============================================================ */

/* ---------- Dark (Default) ---------- */
:root,
:root.dark,
html.dark,
[data-theme="dark"] {
  --bg-main: #09090b;
  --bg-surface: #121215;
  --bg-hover: #18181c;
  --bg-elevated: #16161a;
  --bg-input: #121215;
  --bg-table-header: #141418;
  --bg-folder: #121215;
  --bg-folder-hover: #18181c;
  --border-color: #23232a;
  --border-light: #2e2e38;
  --text-main: #f0f0f2;          /* පැහැදිලි සුදු පැහැය */
  --text-bright: #ffffff;
  --text-muted: #c4c4cc;         /* කියවීමට පහසු contrast එකක් */
  --text-dim: #82828e;
  --accent-gold: #fbbf24;        /* පැහැදිලි රන්වන් පැහැය */
  --accent-soft: rgba(251, 191, 36, 0.12);
  --accent-ring: rgba(251, 191, 36, 0.35);
  --accent-green: #10b981;
  --pdf-red: #ef4444;
  --btn-solid-bg: #fafafa;
  --btn-solid-text: #09090b;
  --glass-bg: rgba(9, 9, 11, 0.85);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
  --grid-line: rgba(255, 255, 255, 0.03);
  --r-xl: 18px;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 6px;
}

/* ---------- Light ---------- */
:root.light,
html.light,
[data-theme="light"] {
  --bg-main: #fdfdfc;
  --bg-surface: #ffffff;
  --bg-hover: #f5f5f3;
  --bg-elevated: #fafaf8;
  --bg-input: #ffffff;
  --bg-table-header: #f5f5f3;
  --bg-folder: #ffffff;
  --bg-folder-hover: #f5f5f3;
  --border-color: #e5e5e0;
  --border-light: #d1d1cb;
  --text-main: #18181b;          /* පැහැදිලි තද පැහැය */
  --text-bright: #09090b;
  --text-muted: #3f3f46;
  --text-dim: #71717a;
  --accent-gold: #b45309;        /* තද රන්වන්/දුඹුරු පැහැය */
  --accent-soft: rgba(180, 83, 9, 0.1);
  --accent-ring: rgba(180, 83, 9, 0.25);
  --accent-green: #059669;
  --pdf-red: #dc2626;
  --btn-solid-bg: #0f172a;
  --btn-solid-text: #ffffff;
  --glass-bg: rgba(253, 253, 252, 0.88);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.08);
  --grid-line: rgba(0, 0, 0, 0.03);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Noto Serif Sinhala', 'Abhaya Libre', Georgia, 'Times New Roman', serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.95;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

::selection {
  background: var(--accent-gold);
  color: #000;
}

/* පිටුවේ ප්‍රධාන තිරස් සීමාව මදක් වැඩි කිරීම (1140px සිට 1220px දක්වා) */
.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* ==========================================
   Header
   ========================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-bright);
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-gold);
  border: 1px solid var(--accent-ring);
}

.brand-name {
  font-family: 'Noto Serif Sinhala', Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
}

/* Search Bar */
.search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  padding: 0 40px 0 42px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.search-clear.hidden { display: none; }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
  z-index: 100;
}
.search-results.hidden { display: none; }

.search-section-title {
  font-family: 'Noto Serif Sinhala', Georgia, serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.15s;
}
.search-result-item:hover {
  background: var(--bg-hover);
}
.search-result-title {
  font-size: 0.92rem;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Theme Toggle */
.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  color: var(--text-bright);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E") center/contain no-repeat;
}
html.light .theme-toggle-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ==========================================
   Hero Banner — Compact Height (තනි බැනරය)
   ========================================== */
/* බැනරයට පමණක් වම්පස රන්වන් මායිම පවත්වා ගැනීම */
.hero-banner {
  /* බැනරය තිරයේ වම් සිට දකුණ දක්වා සම්පූර්ණ පළලට (full-bleed) */
  width: 100vw;
  margin: 0 0 22px calc(50% - 50vw);
  padding: 32px 20px;
  display: flex;
  align-items: center;
  border: none;
  border-left: none !important;
  border-bottom: 1px solid var(--accent-ring);
  border-radius: 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--bg-surface);
  /* පින්තූරය පසුබිමට + තේමාවට ගැළපෙන overlay එකක් (අකුරු පැහැදිලි වීමට) */
  background-image:
    linear-gradient(var(--hero-overlay), var(--hero-overlay)),
    url("Gemini_Generated_Image_10kmon10kmon10km.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-banner-content {
  max-width: 1180px;             /* අන්තර්ගතය මැදට, පසුබිම සම්පූර්ණ තිරයට */
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  /* අකුරු පිටුපස අර්ධ-පාරදර්ශක පුවරුවක් — පින්තූරය පෙනෙමින් අකුරු පැහැදිලි වීමට */
  padding: 10px 24px;
  background: var(--hero-panel);
  border: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--hero-chip-bg);
  border: 1px solid var(--accent-ring);
  color: var(--hero-text);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.hero-banner-title {
  font-family: 'Noto Serif Sinhala', Georgia, serif;
  /* අකුරු ප්‍රමාණය මදක් අඩු කර ඇත */
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  color: var(--hero-title);
  line-height: 1.5;
  margin-bottom: 14px;
  text-shadow: var(--hero-shadow);
  text-align: center;
  width: 100%;
}

.hero-banner-desc {
  font-family: 'Noto Serif Sinhala', Georgia, serif;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--hero-text);
  line-height: 1.9;
  text-align: justify;
  text-justify: inter-word;
  text-shadow: var(--hero-shadow);
  margin-bottom: 0;
}

/* ==========================================
   Hero Actions — බැනරයට යටින්
   ========================================== */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0;
  margin-bottom: 44px;
  padding-left: 0;
}

.hero-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hero-btn-primary {
  background: var(--btn-solid-bg) !important;
  color: var(--btn-solid-text) !important;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.hero-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.hero-btn-ghost {
  background: var(--bg-surface) !important;
  color: var(--text-bright) !important;
  border: 1px solid var(--border-color) !important;
}
.hero-btn-ghost:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-light) !important;
  transform: translateY(-2px);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .hero-banner {
    padding: 18px 16px;
    margin: 14px 0 12px 0;
  }
  .hero-banner-desc {
    text-align: left;
    font-size: 0.95rem;
  }
  .hero-actions {
    margin-bottom: 28px;
  }
}

/* ==========================================
   Section Headers
   ========================================== */
.section-block {
  margin-bottom: 48px;
}

/* 3. Section Titles (බෞද්ධ අධ්‍යාපනික Apps / ධර්ම ග්‍රන්ථ එකතුව) මදක් ඇතුළට ගැනීම */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Noto Serif Sinhala', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 20px;
  padding-left: 6px;  /* වම් දාරයෙන් මදක් ඇතුළට පෙළගැස්වීම */
  scroll-margin-top: 85px;
}

.section-title svg {
  color: var(--accent-gold);
}

/* ==========================================
   Apps Grid & Cards (Clean & Stable Fixes)
   ========================================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

.playstore-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.playstore-card:hover {
  border-color: var(--border-light);
}
.playstore-card.expanded {
  border-color: var(--accent-ring);
  box-shadow: var(--shadow-lg);
}

.playstore-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.playstore-app-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.playstore-header-info {
  flex: 1;
  min-width: 0;
}

.playstore-app-title {
  font-family: 'Noto Serif Sinhala', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 3px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  text-overflow: unset;
}

.playstore-developer {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.playstore-developer span {
  color: var(--accent-green);
  font-weight: 700;
}

/* Expand Arrow */
.card-expand-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.card-expand-arrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-2px) rotate(45deg);
}
.playstore-card.expanded .card-expand-arrow {
  transform: rotate(180deg);
}

/* Expanded Details */
.playstore-details {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  animation: fadeIn 0.2s ease-out;
}
.playstore-card.expanded .playstore-details {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.playstore-meta-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  margin-bottom: 14px;
}
.playstore-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.playstore-meta-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-bright);
}
.playstore-meta-val .star {
  color: #fbbf24;
}
.playstore-meta-lbl {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.playstore-meta-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
}

/* Card Action Buttons */
.playstore-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: stretch;
}

.btn-playstore-install,
.btn-playstore-web,
.btn-playstore-share {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-playstore-install {
  flex: 1.5;
  background: #0f172a;
  color: #ffffff !important;
}
[data-theme="dark"] .btn-playstore-install {
  background: #fafafa;
  color: #09090b !important;
}
.btn-playstore-install:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.btn-playstore-install svg {
  flex-shrink: 0;
}

.btn-playstore-web {
  flex: 1;
  background: var(--bg-surface);
  color: var(--text-bright);
  border-color: var(--border-color);
}
.btn-playstore-web:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-playstore-share {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: var(--bg-surface);
  color: var(--text-bright);
  border-color: var(--border-color);
}
.btn-playstore-share:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.playstore-about {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 14px;
}

/* Screenshots Carousel */
.playstore-screenshots-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.playstore-screenshot-img {
  height: 180px;
  width: auto;
  flex-shrink: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border-color);
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.2s;
}
.playstore-screenshot-img:hover {
  transform: scale(1.02);
}

/* Install Guide */
.install-guide-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  color: var(--text-bright);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.install-guide-text {
  flex: 1;
  text-align: left;
}
.install-guide-arrow {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.install-guide-arrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s;
}
.install-guide:has(.install-guide-content.open) .install-guide-arrow::before {
  transform: rotate(-135deg);
}

.install-guide-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.install-guide-content.open {
  max-height: 700px;
  padding: 12px;
  margin-top: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
}

.install-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: var(--bg-hover);
  padding: 4px;
  border-radius: var(--r-sm);
}
.install-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
}
.install-tab.active {
  background: var(--bg-surface);
  color: var(--text-bright);
}
.install-panel { display: none; }
.install-panel.active { display: block; }

.install-steps {
  list-style: none;
  counter-reset: s;
  padding: 0;
}
.install-steps li {
  counter-increment: s;
  position: relative;
  padding: 6px 0 6px 30px;
  font-size: 0.85rem;
  color: var(--text-main);
}
.install-steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-gold);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ==========================================
   PDF Table (Clean & Aligned)
   ========================================== */
.pdf-table {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 1fr 140px 100px 90px;
  padding: 14px 20px;
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.folder-group {
  border-bottom: 1px solid var(--border-color);
}
.folder-group:last-child {
  border-bottom: none;
}

.folder-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-folder);
  color: var(--text-bright);
  font-family: 'Noto Serif Sinhala', Georgia, serif;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.folder-header:hover {
  background: var(--bg-folder-hover);
}

.folder-arrow {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.folder-arrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
.folder-group.open .folder-arrow::before {
  transform: rotate(45deg);
}

.folder-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: var(--accent-gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.folder-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 999px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 140px 100px 90px;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  background: var(--bg-elevated);
  transition: background 0.15s;
}
.table-row:last-child {
  border-bottom: none;
}
.table-row:hover {
  background: var(--bg-hover);
}

.file-col-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-right: 12px;
}

.pdf-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--pdf-red);
  flex-shrink: 0;
}

.file-text {
  color: var(--text-bright);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-col-cat, .file-col-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.file-col-size {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-green);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================
   Footer
   ========================================== */
.site-footer {
  text-align: center;
  padding: 40px 0 50px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 5px;
}

/* ==========================================
   Lightbox
   ========================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: var(--r-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.lightbox-caption {
  color: #fff;
  margin-top: 14px;
  font-weight: 600;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* ==========================================
   Mobile Responsive Rules
   ========================================== */
@media (max-width: 768px) {
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 0;
    gap: 12px;
  }
  .brand {
    order: 1;
    flex: 1;
  }
  .theme-toggle {
    order: 2;
  }
  .search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .hero-banner {
    padding: 24px 20px;
    margin: 16px 0 28px 0;
  }

  .hero-banner-desc {
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.8;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .playstore-actions {
    flex-direction: column;
  }
  .btn-playstore-install,
  .btn-playstore-web,
  .btn-playstore-share {
    width: 100%;
    flex: none;
  }

  .table-header, .table-row {
    grid-template-columns: 1fr 80px;
  }
  .table-header span:nth-child(2),
  .table-header span:nth-child(3),
  .file-col-cat,
  .file-col-count {
    display: none;
  }
}
/* ============================================================
   ⚡ CLS (Layout Shift) Fixes
   ============================================================ */
#appsContainer {
  min-height: 280px; /* Apps load වීමට පෙර හිස් අවකාශය වෙන් කර තැබීම */
  contain-intrinsic-size: 280px;
}

#pdfFileList {
  min-height: 200px; /* PDF list එක සඳහා අවකාශය */
  contain-intrinsic-size: 200px;
}

/* Icon එක load වන තෙක් layout එක වෙනස් වීම වැළැක්වීම */
.playstore-app-icon {
  width: 62px;
  height: 62px;
  aspect-ratio: 1 / 1;
}

.playstore-screenshot-img {
  width: 220px;
  height: 175px;
  aspect-ratio: 220 / 175;
}

/* ============================================================
   ✨ Layout Polish — විධිමත් පෙනුම
   ============================================================ */
.section-title {
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border-color);
}

.playstore-card {
  box-shadow: var(--shadow-sm);
}
.playstore-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.pdf-table {
  box-shadow: var(--shadow-sm);
}
.table-header span:last-child {
  text-align: right;
}
.folder-header {
  border-left: 3px solid transparent;
}
.folder-group.open > .folder-header {
  border-left-color: var(--accent-gold);
  background: var(--bg-folder-hover);
}

/* Hero banner colours — theme aware (overlay + text always high contrast) */
:root,
:root.dark,
html.dark,
[data-theme="dark"] {
  --hero-overlay: rgba(48, 0, 14, 0.68);
  --hero-panel: transparent;
  --hero-panel-border: transparent;
  --hero-text: #ffffff;
  --hero-title: #fcd34d;
  --hero-chip-bg: rgba(0, 0, 0, 0.55);
  --hero-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.75);
  --header-tint: rgba(128, 0, 32, 0.22);
  --header-border: rgba(190, 60, 90, 0.35);
}
:root.light,
html.light,
[data-theme="light"] {
  --hero-overlay: rgba(48, 0, 14, 0.68);
  --hero-panel: transparent;
  --hero-panel-border: transparent;
  --hero-text: #ffffff;
  --hero-title: #fcd34d;
  --hero-chip-bg: rgba(0, 0, 0, 0.5);
  --hero-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.7);
  --header-tint: rgba(250, 226, 231, 0.97);   /* ගොඩක් ලා මෙරූන් (pale maroon) */
  --header-border: rgba(128, 0, 32, 0.22);
}

/* Header / search bar area — light tint */
.site-header {
  background-image: linear-gradient(var(--header-tint), var(--header-tint));
  border-bottom: 1px solid var(--header-border);
}

@media (max-width: 768px) {
  .hero-banner {
    min-height: 0;
    padding: 16px 12px;
    margin: 0 0 14px calc(50% - 50vw);
  }
  .hero-banner-content {
    padding: 16px 14px;
  }
  .hero-banner-title {
    text-align: center;
    font-size: 1.3rem;
  }
  .hero-banner-desc {
    font-size: 0.93rem;
    line-height: 1.85;
  }
  .hero-actions {
    margin-bottom: 32px;
  }
  .hero-btn {
    flex: 1;
  }
}

/* ============================================================
   📄 පොදු පිටු (About / Contact / Privacy / Copyright), Nav, Footer, Cookie
   ============================================================ */

/* Header nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--bg-hover); color: var(--accent-gold); }
.site-nav a[aria-current="page"] { color: var(--accent-gold); }

/* Footer links */
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 14px;
}
.footer-links a,
.footer-link-btn {
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
}
.footer-links a:hover,
.footer-link-btn:hover { color: var(--accent-gold); text-decoration: underline; }

/* Page title band */
.page-hero {
  margin: 28px 0 24px;
  padding: 26px 30px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent-gold);
  border-radius: var(--r-lg);
}
.page-hero h1 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1.5;
}
.page-hero p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Article content */
.page-content {
  max-width: 860px;
  margin: 0 auto 56px;
  padding: 8px 4px;
}
.page-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 30px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.page-content p,
.page-content li {
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.95;
}
.page-content p { margin-bottom: 12px; }
.page-content ul,
.page-content ol { margin: 6px 0 14px 22px; }
.page-content li { margin-bottom: 4px; }
.page-content a { color: var(--accent-gold); font-weight: 600; }
.page-content .note {
  margin: 16px 0;
  padding: 14px 18px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  border-radius: var(--r-md);
  color: var(--text-bright);
}
.page-meta {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

/* Simple data table inside pages */
.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  overflow: hidden;
}
.info-table th,
.info-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  vertical-align: top;
}
.info-table th {
  background: var(--bg-table-header);
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.info-table tr:last-child td { border-bottom: none; }

/* Contact form */
.contact-form {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  padding: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
}
.form-row { display: grid; gap: 6px; }
.form-row label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-bright);
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}
.form-row textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-hint { font-size: 0.82rem; color: var(--text-dim); }
.form-submit {
  justify-self: start;
  min-height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: var(--r-md);
  background: var(--btn-solid-bg);
  color: var(--btn-solid-text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.form-submit:hover { opacity: 0.92; }
.form-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 1.4em;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 900;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--accent-ring);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.cookie-text {
  flex: 1;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-main);
}
.cookie-text a { color: var(--accent-gold); font-weight: 700; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-btn {
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}
.cookie-btn-primary { background: var(--btn-solid-bg); color: var(--btn-solid-text); border-color: transparent; }
.cookie-btn-ghost { background: var(--bg-surface); color: var(--text-bright); }
.cookie-btn:hover { opacity: 0.92; }

@media (max-width: 768px) {
  .site-nav { order: 3; width: 100%; justify-content: center; }
  .page-hero { padding: 20px 18px; margin: 18px 0 18px; }
  .info-table th:nth-child(3), .info-table td:nth-child(3) { display: none; }
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 12px; }
  .cookie-actions { justify-content: flex-end; }
}

/* ============================================================
   🌐 භාෂා මාරුව (සිංහල / English)
   ============================================================ */
html[lang="en"] [data-lang="si"],
html[lang="si"] [data-lang="en"] {
  display: none !important;
}

/* English: පැහැදිලි sans-serif අකුරු */
html[lang="en"] body,
html[lang="en"] body * {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Serif Sinhala', sans-serif;
}
html[lang="en"] body { line-height: 1.7; letter-spacing: 0; }
html[lang="en"] .page-content p,
html[lang="en"] .page-content li { line-height: 1.8; }
html[lang="en"] .hero-banner-desc { line-height: 1.8; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 42px;
  padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  flex-shrink: 0;
}
.lang-switch button {
  min-width: 44px;
  height: 34px;
  padding: 0 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-switch button:hover { color: var(--text-bright); }
.lang-switch button.active {
  background: var(--accent-gold);
  color: #1c1100;
}
html.light .lang-switch button.active { color: #ffffff; }

@media (max-width: 768px) {
  .lang-switch { order: 2; }
  /* සෙවුම් තීරුව මුළු පළලෙන් වෙනම පේළියක් ලෙස (බොත්තම් වැඩි වීමෙන් පටු නොවීමට) */
  .search-wrapper { flex: 1 1 100%; }
  /* mobile header හි පැති පරතරය (පෙර rule එකෙන් මැකී තිබුණි) */
  .header-inner { padding: 12px 20px; }
}

/* ============================================================
   🦶 Footer — නවීන සැලසුම: තද මෙරූන් + රන්වන් (Dark / Light දෙකටම එකම පෙනුම)
   ============================================================ */
.site-footer {
  --f-bg-1: #050505;
  --f-bg-2: #101010;
  --f-text: #ffffff;
  --f-muted: #ffffff;
  --f-gold: #fbbf24;
  --f-gold-2: #f59e0b;
  --f-line: rgba(255, 255, 255, 0.14);

  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100vw;
  margin: 48px 0 0 calc(50% - 50vw);
  padding: 0;
  text-align: left;
  font-size: 1rem;
  color: var(--f-text);
  border: none;
  background-color: var(--f-bg-1);
  background-image: linear-gradient(165deg, var(--f-bg-2) 0%, var(--f-bg-1) 78%);
}
/* රන්වන් මායිම් රේඛාව */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 2;
  background: linear-gradient(90deg, transparent 0%, var(--f-gold) 22%, var(--f-gold-2) 50%, var(--f-gold) 78%, transparent 100%);
}
/* ධර්ම චක්‍ර watermark */
.site-footer::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 440px;
  height: 440px;
  z-index: 0;
  opacity: 0.11;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='0.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='11.2' stroke-width='0.25'/%3E%3Cpath d='M12 3v6M12 15v6M3 12h6M15 12h6M5.6 5.6l4.2 4.2M14.2 14.2l4.2 4.2M18.4 5.6l-4.2 4.2M9.8 14.2l-4.2 4.2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.site-footer [hidden] { display: none !important; }

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 58px 20px 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr 1fr 1.3fr;
  gap: 46px;
}

/* --- Brand --- */
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  color: #ffffff;
  text-decoration: none;
}
.footer-brand .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--f-gold);
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
}
.footer-brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}
.footer-about p {
  max-width: 420px;
  color: var(--f-muted);
  font-size: 0.93rem;
  line-height: 1.85;
}
.footer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.footer-chip {
  padding: 3px 13px;
  border-radius: 999px;
  color: var(--f-gold);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.32);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.7;
}

/* --- Link columns --- */
.footer-col h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.footer-col h3::after {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--f-gold);
}
.footer-col ul {
  display: grid;
  gap: 2px;
  list-style: none;
}
.footer-col li a,
.footer-col .footer-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--f-text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.7;          /* <a> සහ <button> පේළි එක සමාන උසින් */
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.18s;
}
.footer-col li a::before,
.footer-col .footer-link-btn::before {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--f-gold);
  border-right: 2px solid var(--f-gold);
  opacity: 0.75;
  transform: rotate(45deg);
  transition: transform 0.18s;
}
.footer-col li a:hover,
.footer-col .footer-link-btn:hover { color: var(--f-gold); }
.footer-col li a:hover::before,
.footer-col .footer-link-btn:hover::before { transform: translateX(4px) rotate(45deg); }

/* --- Contact column --- */
.footer-contact-text {
  margin-bottom: 16px;
  color: var(--f-muted);
  font-size: 0.92rem;
  line-height: 1.8;
}
.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 12px;
  color: #2a0610;
  background: linear-gradient(135deg, #fde68a 0%, var(--f-gold) 45%, var(--f-gold-2) 100%);
  box-shadow: 0 8px 22px rgba(245, 158, 11, 0.28);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
}
.footer-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.4);
}
.footer-mail {
  display: block;
  margin-top: 14px;
  color: var(--f-text);
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-all;
}
.footer-mail:hover { color: var(--f-gold); }

/* --- ආශීර්වාද පටිය --- */
.footer-blessing {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 46px;
  color: var(--f-gold);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
}
.footer-blessing::before,
.footer-blessing::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.55));
}
.footer-blessing::after { transform: scaleX(-1); }
.footer-blessing span::before,
.footer-blessing span::after {
  content: "✦";
  margin: 0 12px;
  font-size: 0.8em;
  opacity: 0.85;
}

/* --- පහළ තීරුව --- */
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 22px 0 28px;
}
.footer-copy {
  margin: 0;
  color: var(--f-muted);
  font-size: 0.86rem;
  line-height: 1.7;
}
.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer .lang-switch {
  order: 0;                  /* header සඳහා වූ mobile order:2 rule එක footer හි නොබලපාන්න */
  height: 40px;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}
.site-footer .lang-switch button {
  min-width: 70px;
  height: 32px;
  color: var(--f-muted);
}
.site-footer .lang-switch button:hover { color: #ffffff; }
.site-footer .lang-switch button.active,
html.light .site-footer .lang-switch button.active {
  color: #2a0610;
  background: var(--f-gold);
}
.footer-top {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--f-gold);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.45);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.footer-top:hover {
  color: #2a0610;
  background: var(--f-gold);
  transform: translateY(-2px);
}

/* --- Responsive --- */
@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px 28px; }
  .footer-about,
  .footer-contact { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .footer-inner { padding-top: 44px; }
  .footer-blessing { margin-top: 36px; font-size: 0.95rem; gap: 12px; }
  .footer-blessing span::before,
  .footer-blessing span::after { margin: 0 6px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-bottom-right { width: 100%; justify-content: space-between; }
}

/* ============================================================
   📄 Document පිටු — නවීන ලැප්ටොප් layout
   (About / Privacy / Copyright / Contact) — බැනරයක් නැත
   ============================================================ */
.page-main { padding-top: 34px; padding-bottom: 8px; }

/* --- ශීර්ෂය: breadcrumb + මාතෘකාව + හැඳින්වීම --- */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-dim);
  font-size: 0.84rem;
}
.crumbs a { color: var(--text-muted); font-weight: 600; text-decoration: none; }
.crumbs a:hover { color: var(--accent-gold); }
.crumbs .sep { opacity: 0.5; }
.crumbs [aria-current="page"] { color: var(--accent-gold); font-weight: 700; }

.page-head {
  position: relative;
  max-width: 860px;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 110px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-gold), transparent);
}
.page-head h1 {
  color: var(--text-bright);
  font-size: clamp(1.9rem, 3.2vw, 2.65rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.page-lede {
  max-width: 62ch;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

/* --- layout: sticky පැති තීරුව + ලිපිය --- */
.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  margin-bottom: 28px;
}
.doc-aside {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 26px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 2px 6px 8px 2px;
  scrollbar-width: thin;
}
.doc-toc-box[hidden] { display: none; }
.doc-box-title {
  margin: 0 0 10px;
  padding: 0 12px;
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1.6;
}

.doc-pages { display: grid; gap: 3px; list-style: none; }
.doc-pages a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-main);
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.doc-pages a:hover { background: var(--bg-hover); }
.doc-pages svg { flex-shrink: 0; opacity: 0.8; }
.doc-pages a[aria-current="page"] {
  color: var(--accent-gold);
  background: var(--accent-soft);
  border-color: var(--accent-ring);
}
.doc-pages a[aria-current="page"] svg { opacity: 1; }

.doc-toc {
  display: grid;
  gap: 1px;
  margin-left: 12px;
  list-style: none;
  border-left: 2px solid var(--border-color);
}
.doc-toc a {
  display: block;
  margin-left: -2px;
  padding: 6px 12px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.doc-toc a:hover { color: var(--text-bright); }
.doc-toc a.active {
  color: var(--accent-gold);
  border-left-color: var(--accent-gold);
  font-weight: 700;
}

/* --- ලිපිය --- */
.doc-article {
  max-width: 800px;
  margin: 0;
  padding: 0;
}
.doc-article > div > :first-child { margin-top: 0; }
.doc-article .page-meta {
  display: inline-block;
  margin: 0 0 6px;
  padding: 5px 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.7;
}
.doc-article h2 {
  position: relative;
  margin: 46px 0 14px;
  padding: 0 0 0 18px;
  border-bottom: none;
  color: var(--text-bright);
  font-size: 1.3rem;
  line-height: 1.6;
  scroll-margin-top: 96px;
}
.doc-article h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38em;
  width: 5px;
  height: 1.05em;
  border-radius: 3px;
  background: var(--accent-gold);
}
.doc-article p,
.doc-article li { font-size: 1rem; line-height: 1.95; }
.doc-article p { margin-bottom: 14px; }
.doc-article strong { color: var(--text-bright); }
.doc-article a { text-underline-offset: 3px; }

.doc-article ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 18px;
  padding: 0;
  list-style: none;
}
.doc-article ul li { position: relative; margin: 0; padding-left: 28px; }
.doc-article ul li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.82em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.doc-article ol {
  display: grid;
  gap: 12px;
  margin: 10px 0 18px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.doc-article ol li { position: relative; margin: 0; padding-left: 44px; counter-increment: step; }
.doc-article ol li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.35em;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--accent-gold);
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

/* අරමුණු කාඩ්පත් (About) */
.doc-article ul.card-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 22px;
  counter-reset: aim;
}
.doc-article ul.card-list li {
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.94rem;
  line-height: 1.85;
  counter-increment: aim;
  transition: transform 0.18s, border-color 0.18s;
}
.doc-article ul.card-list li:hover { transform: translateY(-2px); border-color: var(--accent-ring); }
.doc-article ul.card-list li::before {
  content: counter(aim);
  position: static;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border-radius: 10px;
  color: var(--accent-gold);
  background: var(--accent-soft);
  box-shadow: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
}

/* වගුව */
.doc-article .info-table {
  margin: 14px 0 18px;
  box-shadow: var(--shadow-sm);
  border-radius: var(--r-lg);
}
.doc-article .info-table td:first-child { color: var(--text-bright); font-weight: 700; }
.doc-article .info-table tbody tr { transition: background 0.15s; }
.doc-article .info-table tbody tr:hover { background: var(--bg-hover); }

/* සටහන (callout) */
.doc-article .note {
  position: relative;
  margin: 22px 0;
  padding: 16px 18px 16px 58px;
  border: 1px solid var(--accent-ring);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--text-bright);
  line-height: 1.85;
}
.doc-article .note::before {
  content: "i";
  position: absolute;
  left: 18px;
  top: 17px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--bg-main);
  background: var(--accent-gold);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

/* --- කියවීමේ ප්‍රගති රේඛාව --- */
.read-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 70;
  height: 3px;
  pointer-events: none;
}
.read-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #fde68a);
  box-shadow: 0 0 8px var(--accent-ring);
}

/* --- සම්බන්ධ වන්න පිටුව --- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  align-items: start;
}
.contact-main > h2:first-child { margin-top: 0; }
.contact-intro { max-width: 60ch; color: var(--text-muted); }
.doc-article .contact-form {
  gap: 18px;
  margin-top: 18px;
  padding: 26px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.form-actions .form-status { margin: 0; }
.doc-article .form-row label { line-height: 1.6; }

.contact-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}
.contact-side [hidden] { display: none !important; }
.info-card {
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.info-card h3 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 10px;
  color: var(--text-bright);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
}
.info-card .ic {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--accent-gold);
  background: var(--accent-soft);
}
.info-card p { margin: 0; font-size: 0.93rem; line-height: 1.85; }
.doc-article .info-card ul { gap: 6px; margin: 0; }
.doc-article .info-card li { font-size: 0.92rem; line-height: 1.8; }
.info-card .mail-link { display: block; margin-top: 6px; font-weight: 700; word-break: break-all; }

/* --- Responsive --- */
@media (max-width: 1100px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .contact-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-layout { gap: 40px; }
}
@media (max-width: 960px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .doc-aside { position: static; max-height: none; overflow: visible; padding: 0; }
  .doc-toc-box { display: none; }
  .doc-box-title { display: none; }
  .doc-pages {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .doc-pages a { white-space: nowrap; border-color: var(--border-color); }
  .doc-article ul.card-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .page-main { padding-top: 22px; }
  .page-head { margin-bottom: 28px; padding-bottom: 22px; }
  .page-lede { font-size: 1rem; }
  .doc-article h2 { margin-top: 36px; font-size: 1.18rem; }
  .form-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .contact-side { grid-template-columns: minmax(0, 1fr); }
  .doc-article .contact-form { padding: 20px 16px; }
  .doc-article .info-table th:nth-child(3),
  .doc-article .info-table td:nth-child(3) { display: none; }
}

/* මුද්‍රණය */
@media print {
  .site-header, .site-footer, .doc-aside, .read-progress, .cookie-banner { display: none !important; }
  .doc-layout { display: block; }
  .doc-article { max-width: none; }
}
.doc-aside, .doc-aside nav, .doc-article, .contact-main { min-width: 0; }
.doc-pages { max-width: 100%; }
/* ============================================================
   🔝 Header — නවීන තද මෙරූන් සැලසුම (සෙවුම් තීරුව සහිත කොටස)
   Dark / Light තේමා දෙකටම එකම තද පැහැය — footer එකට ගැළපේ
   ============================================================ */
.site-header {
  --h-bg-1: #1f040b;
  --h-bg-2: #4a0b1e;
  --h-text: #fbeff1;
  --h-muted: #d9bcc4;
  --h-gold: #fbbf24;
  --h-glass: rgba(255, 255, 255, 0.07);
  --h-glass-2: rgba(255, 255, 255, 0.12);
  --h-line: rgba(255, 255, 255, 0.16);

  background-color: var(--h-bg-1);
  background-image:
    radial-gradient(520px 120px at 12% -20%, rgba(251, 191, 36, 0.22), transparent 70%),
    radial-gradient(460px 140px at 92% 120%, rgba(200, 45, 85, 0.35), transparent 70%),
    linear-gradient(100deg, var(--h-bg-1) 0%, var(--h-bg-2) 55%, #3a0816 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  box-shadow: 0 10px 30px -12px rgba(42, 6, 16, 0.65);
}
/* පහළ රන්වන් දීප්ති රේඛාව */
.site-header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--h-gold) 25%, #f59e0b 50%, var(--h-gold) 75%, transparent 100%);
  opacity: 0.85;
}
.header-inner { height: 72px; }

/* --- Brand --- */
.site-header .brand,
html.light .site-header .brand { color: #ffffff; }
.site-header .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--h-gold);
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.4s ease;
}
.site-header .brand:hover .brand-mark { transform: rotate(45deg); }
.site-header .brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 30%, #fde68a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- සෙවුම් තීරුව (pill + glass) --- */
.site-header .search-wrapper { max-width: 520px; }
.site-header .search-box input {
  height: 46px;
  padding: 0 44px 0 48px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--h-line);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.site-header .search-box input::placeholder { color: var(--h-muted); opacity: 0.9; }
.site-header .search-box input:hover { background: rgba(0, 0, 0, 0.36); border-color: rgba(255, 255, 255, 0.26); }
.site-header .search-box input:focus {
  background: rgba(0, 0, 0, 0.42);
  border-color: var(--h-gold);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.18), inset 0 2px 6px rgba(0, 0, 0, 0.3);
}
.site-header .search-icon { left: 18px; color: var(--h-gold); }
.site-header .search-clear {
  right: 12px;
  width: 26px;
  height: 26px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.15s, color 0.15s;
}
.site-header .search-clear:hover { background: var(--h-gold); color: #2a0610; }

/* ප්‍රතිඵල පෙට්ටිය — පිටුවේ තේමාවට අනුව, රන්වන් ඉහළ රේඛාවක් සමඟ */
.site-header .search-results {
  top: calc(100% + 12px);
  border-radius: 16px;
  border-top: 3px solid var(--accent-gold);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  animation: fadeIn 0.18s ease-out;
}
.site-header .search-result-item:hover { background: var(--accent-soft); }

/* --- Nav (අනෙක් පිටු) --- */
.site-header .site-nav a { color: var(--h-text); border-radius: 999px; padding: 7px 14px; }
.site-header .site-nav a:hover { color: var(--h-gold); background: var(--h-glass); }
.site-header .site-nav a[aria-current="page"] {
  color: #2a0610;
  background: var(--h-gold);
}

/* --- භාෂා මාරුව + තේමා බොත්තම --- */
.site-header .lang-switch {
  height: 44px;
  border-radius: 999px;
  background: var(--h-glass);
  border-color: var(--h-line);
}
.site-header .lang-switch button { border-radius: 999px; color: var(--h-muted); }
.site-header .lang-switch button:hover { color: #ffffff; }
.site-header .lang-switch button.active,
html.light .site-header .lang-switch button.active {
  color: #2a0610;
  background: linear-gradient(135deg, #fde68a, var(--h-gold));
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.site-header .theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--h-gold);
  background: var(--h-glass);
  border-color: var(--h-line);
  transition: background 0.2s, border-color 0.2s, transform 0.3s;
}
.site-header .theme-toggle:hover {
  background: var(--h-glass-2);
  border-color: rgba(251, 191, 36, 0.55);
  transform: rotate(20deg);
}

/* --- Focus (keyboard) --- */
.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 2px solid var(--h-gold);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .header-inner { height: auto; padding: 12px 16px 14px; }
  .site-header .brand-name { font-size: 1.1rem; }
  .site-header .search-box input { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* ==========================================
   ✅ Light Theme විශේෂ නිවැරදි කිරීම්
   ========================================== */

/* Header පසුබිම් */
html.light .site-header {
  background-color: #ffffff;
  border-bottom-color: #e5dfd0;
}

/* Search input */
html.light .search-box input {
  background-color: #ffffff;
  border-color: #ddd7c8;
  color: #2c2416;
}

html.light .search-box input::placeholder {
  color: #999080;
}

/* Search icon */
html.light .search-icon {
  color: #999080;
}

/* App title */
html.light .app-title {
  color: #1a1410;
}

/* App tags */
html.light .tag-gold {
  background: #f5e6c8;
  color: #8a6d00;
}

html.light .tag-blue {
  background: #d6e8f5;
  color: #1e5a8a;
}

/* APK button */
html.light .btn-apk {
  background-color: #d4edda;
  color: #145a1f;
  border-color: #a8d5b5;
}

html.light .btn-apk:hover {
  background-color: #b8e0c0;
  color: #0d2818;
}

/* Web button */
html.light .btn-web {
  background-color: #f0ede6;
  color: #2c2416;
  border-color: #ddd7c8;
}

html.light .btn-web:hover {
  background-color: #e5dfd0;
  color: #1a1410;
}

/* Table header */
html.light .table-header {
  background-color: #ebe7dd;
}

/* Table row hover */
html.light .table-row:hover {
  background-color: #f0ede6;
}

/* File text */
html.light .file-text {
  color: #2c2416;
}

/* Folder header */
html.light .folder-header {
  background-color: #f5edd8;
  color: #8a6d00;
}

html.light .folder-header:hover {
  background-color: #f0e5c8;
}

/* Install guide toggle */
html.light .install-guide-toggle {
  background: linear-gradient(135deg, #f5edd8 0%, #ebe0c4 100%);
  color: #8a6d00;
}

html.light .install-guide-toggle:hover {
  background: linear-gradient(135deg, #ebe0c4 0%, #e0d3b0 100%);
}

/* Install guide content */
html.light .install-guide-content {
  background: #faf8f3;
}

/* Install steps */
html.light .install-steps li {
  background: #f0ede6;
  color: #2c2416;
}

html.light .install-steps li strong {
  color: #8a6d00;
}

html.light .install-steps li::before {
  background: #b8860b;
  color: #ffffff;
}

/* Install tabs */
html.light .install-tab {
  background: #f0ede6;
  border-color: #ddd7c8;
  color: #6b6255;
}

html.light .install-tab:hover {
  background: #ebe7dd;
  color: #2c2416;
}

html.light .install-tab.active {
  background: #b8860b;
  color: #ffffff;
  border-color: #b8860b;
}

/* Install tip */
html.light .install-tip {
  background: rgba(40, 116, 166, 0.12);
  color: #1e5a8a;
}

/* Screenshot hover */
html.light .screenshot-img:hover {
  border-color: #b8860b;
}

/* Lightbox caption */
html.light .lightbox-caption {
  color: #f4c060;
}

/* Theme Toggle Button */
html.light .theme-toggle {
  background-color: #f0ede6;
  border-color: #ddd7c8;
  color: #2c2416;
}

html.light .theme-toggle:hover {
  background-color: #b8860b;
  border-color: #b8860b;
  color: #ffffff;
}

/* Search clear button */
html.light .search-clear {
  background: #f0ede6;
  color: #6b6255;
}

html.light .search-clear:hover {
  background: #b8860b;
  color: #ffffff;
}

/* Search results dropdown */
html.light .search-results {
  background: #ffffff;
  border-color: #ddd7c8;
}

html.light .search-result-item:hover {
  background: #f0ede6;
}

html.light .search-result-title {
  color: #1a1410;
}

html.light .search-result-tag {
  background: #f0ede6;
  color: #6b6255;
}

html.light .search-section-title {
  color: #b8860b;
}

/* Search scrollbar */
html.light .search-results::-webkit-scrollbar-track {
  background: #f0ede6;
}

/* Smooth transitions */
html, body,
.site-header,
.app-box,
.pdf-table,
.table-row,
.folder-group,
.folder-header,
.search-box input,
.search-results,
.theme-toggle {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Buddhist Apps Hero Banner */
.dhamma-banner {
  position: relative;
  width: 100%;
  padding: 48px 24px 24px;
  background-color: #3a0816;
  background-image:
    linear-gradient(90deg, rgba(28, 5, 12, 0.7) 0%, rgba(48, 8, 20, 0.76) 34%, rgba(42, 8, 19, 0.76) 66%, rgba(13, 12, 24, 0.58) 100%),
    url("hero_bannar.jpg");
  background-size: cover;
  background-position: center 54%;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
  border-bottom: 2px solid rgba(212, 163, 89, 0.25);
  box-sizing: border-box;
}

.banner-overlay {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(218, 165, 32, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.banner-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: #e5b358;
  opacity: 0.18;
  pointer-events: none;
}

.banner-art-frame {
  stroke-width: 1;
  opacity: 0.5;
}

.banner-art-stupa {
  stroke-width: 1.35;
}

.banner-art-lotus {
  stroke-width: 2;
  opacity: 0.7;
}

.banner-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.banner-icon-wrapper {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  color: #e5b358;
  filter: drop-shadow(0 0 12px rgba(229, 179, 88, 0.35));
}

.banner-title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.banner-subtitle {
  max-width: 650px;
  margin: 0 auto 20px;
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1.7;
}

.banner-blessing {
  margin-top: 20px;
  color: #ffffff;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

@media (max-width: 600px) {
  .dhamma-banner {
    padding: 36px 16px 20px;
  }

  .banner-title {
    font-size: 1.75rem;
  }

  .banner-subtitle {
    font-size: 0.95rem;
  }

  .banner-art {
    opacity: 0.12;
  }

  .banner-art-stupa {
    opacity: 0.65;
  }

  .site-header .brand-mark,
  .site-header .theme-toggle { transition: none; }
}