:root {
  /* Bodindecha (Sing Singhaseni) 2 — Royal/Sky Blue & Rose Pink Theme */
  --bd-navy: #0b2559;
  --bd-blue: #1652b8;
  --bd-blue-mid: #1e88e5;
  --bd-sky: #38bdf8;
  --bd-blue-soft: #e8f2ff;
  --bd-blue-tint: #f4f8ff;

  --bd-pink: #db2777;
  --bd-pink-mid: #ec4899;
  --bd-pink-soft: #fdf2f8;
  --bd-pink-border: #fbcfe8;
  --bd-pink-dark: #9d174d;

  --bd-gold: #db2777;
  --bd-gold-soft: #fdf2f8;

  --surface: #ffffff;
  --bg-page: #f2f6fc;
  --text-main: #162033;
  --text-muted: #5a6782;
  --border: #d7e3f4;
  --border-dashed: #94b4e4;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 3px 12px rgba(11, 37, 89, 0.06);
  --shadow-md: 0 12px 30px -6px rgba(11, 37, 89, 0.12);
  --max-width: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans Thai", "Leelawadee UI", "Sarabun", "Tahoma", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.12), transparent 36%),
    radial-gradient(circle at 92% 6%, rgba(236, 72, 153, 0.10), transparent 34%),
    var(--bg-page);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Top Utility Bar */
.topbar {
  background: var(--bd-navy);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12.5px;
  padding: 7px 0;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--bd-blue-mid) 0%, var(--bd-sky) 50%, var(--bd-pink-mid) 100%) 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.topbar-badge {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.2), rgba(236, 72, 153, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.topbar-link {
  color: #dbeafe;
  transition: color 0.2s;
}

.topbar-link:hover {
  color: #fbcfe8;
  text-decoration: underline;
}

/* Header Brand */
.site-header {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  border-bottom: 1px solid var(--border);
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo-wrap {
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe 0%, #ffffff 50%, #fce7f3 100%);
  border: 2px solid #bfdbfe;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(22, 82, 184, 0.14);
}

.site-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-placeholder {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border: 2px dashed var(--border-dashed);
  border-radius: 50%;
  background: var(--bd-blue-tint);
  color: var(--bd-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-text .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--bd-pink-dark);
  background: linear-gradient(90deg, var(--bd-blue-soft) 0%, var(--bd-pink-soft) 100%);
  border: 1px solid var(--bd-pink-border);
  padding: 2px 11px;
  border-radius: 999px;
  margin-bottom: 5px;
}

.brand-text h1 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 24px);
  color: var(--bd-navy);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.header-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--bd-blue) 0%, var(--bd-blue-mid) 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(22, 82, 184, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--bd-navy) 0%, var(--bd-blue) 100%);
  box-shadow: 0 6px 16px rgba(11, 37, 89, 0.28);
}

.btn-outline {
  background: #ffffff;
  color: var(--bd-blue);
  border-color: #b6cef2;
}

.btn-outline:hover {
  background: var(--bd-blue-soft);
  border-color: var(--bd-blue);
}

.btn-rose,
.btn-gold {
  background: var(--bd-pink-soft);
  color: var(--bd-pink-dark);
  border-color: var(--bd-pink-border);
}

.btn-rose:hover,
.btn-gold:hover {
  background: #fce7f3;
  border-color: var(--bd-pink-mid);
  box-shadow: 0 4px 12px rgba(219, 39, 119, 0.14);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

/* Navigation Bar */
.main-nav {
  background: linear-gradient(90deg, var(--bd-navy) 0%, var(--bd-blue) 60%, var(--bd-blue-mid) 100%);
  border-bottom: 3px solid var(--bd-pink-mid);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 6px 18px rgba(11, 37, 89, 0.18);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin: 8px 0;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 14.5px;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.nav-link.active {
  box-shadow: inset 0 -2px 0 #fbcfe8;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--bd-pink-mid);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  z-index: 120;
}

.nav-item:hover > .dropdown-menu,
.nav-item.dropdown-open > .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 9px 16px;
  color: var(--text-main);
  font-size: 13.5px;
}

.dropdown-menu a:hover {
  background: linear-gradient(90deg, var(--bd-blue-soft) 0%, var(--bd-pink-soft) 100%);
  color: var(--bd-blue);
}

/* Hero Banner Placeholder */
.hero-section {
  padding: 22px 0 10px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 56%, #fdf2f8 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 26px;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bd-pink-dark);
  background: var(--bd-pink-soft);
  border: 1px solid var(--bd-pink-border);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero-copy {
  min-width: 0;
}

.hero-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(21px, 2.6vw, 29px);
  color: var(--bd-navy);
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.hero-copy p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

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

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(22, 82, 184, 0.12);
}

.hero-metric {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}

.hero-metric .metric-num {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--bd-blue);
  line-height: 1.2;
}

.hero-metric:nth-child(even) .metric-num {
  color: var(--bd-pink);
}

.hero-metric .metric-label {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

.placeholder-box {
  border: 2px dashed var(--border-dashed);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(
    -45deg,
    #f7faff,
    #f7faff 10px,
    #eef5ff 10px,
    #eef5ff 20px
  );
  color: var(--bd-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
  gap: 6px;
}

.placeholder-box svg {
  opacity: 0.78;
}

.placeholder-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--bd-navy);
}

.placeholder-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.hero-banner-slot {
  min-height: 225px;
  border-color: #9bc0f0;
  background: linear-gradient(135deg, rgba(232, 242, 255, 0.75) 0%, rgba(253, 242, 248, 0.75) 100%);
}

/* Main 2-Column Portal Layout */
.portal-layout {
  padding: 18px 0 28px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sidebar-stack,
.main-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #f3f7ff 0%, #fdf6fa 100%);
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--bd-navy);
  display: flex;
  align-items: center;
  gap: 9px;
}

.card-title-bar {
  width: 5px;
  height: 20px;
  background: linear-gradient(180deg, var(--bd-blue-mid) 0%, var(--bd-pink-mid) 100%);
  border-radius: 999px;
  display: inline-block;
}

.card-body {
  padding: 20px;
}

/* Thai Calendar Widget */
.calendar-widget {
  overflow: hidden;
}

.calendar-header {
  background: linear-gradient(135deg, var(--bd-navy) 0%, var(--bd-blue) 62%, var(--bd-pink) 100%);
  color: #ffffff;
  padding: 16px 14px;
  text-align: center;
  position: relative;
}

.calendar-month-year {
  font-size: 17px;
  font-weight: 700;
}

.calendar-today {
  font-size: 12px;
  opacity: 0.92;
  margin-top: 4px;
}

.cal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

.cal-prev { left: 12px; }
.cal-next { right: 12px; }

.calendar-grid {
  padding: 12px;
}

.weekdays,
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekdays {
  margin-bottom: 6px;
}

.weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bd-blue-tint);
  padding: 5px 2px;
  border-radius: 6px;
}

.weekday:first-child {
  color: var(--bd-pink);
  background: var(--bd-pink-soft);
}

.day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  background: #ffffff;
  transition: all 0.15s ease;
}

.day:hover {
  background: var(--bd-blue-soft);
  border-color: var(--border-dashed);
}

.day.other-month {
  color: #b4c0d4;
}

.day.today {
  background: linear-gradient(135deg, var(--bd-blue) 0%, var(--bd-blue-mid) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(22, 82, 184, 0.25);
}

.day.selected {
  border-color: var(--bd-pink);
  background: var(--bd-pink-soft);
  color: var(--bd-pink-dark);
  font-weight: 700;
}

.calendar-event-note {
  margin: 0 12px 12px;
  padding: 10px 12px;
  background: linear-gradient(90deg, var(--bd-pink-soft) 0%, var(--bd-blue-tint) 100%);
  border-left: 3px solid var(--bd-pink-mid);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Sidebar Executive Cards */
.exec-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exec-mini-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.exec-mini-card:hover {
  border-color: #9bc0f0;
}

.avatar-placeholder {
  width: 58px;
  height: 72px;
  flex-shrink: 0;
  border: 1.5px dashed var(--border-dashed);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--bd-blue-tint) 0%, var(--bd-pink-soft) 100%);
  color: var(--bd-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  text-align: center;
}

.exec-info .exec-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--bd-navy);
}

.exec-info .exec-role {
  font-size: 12px;
  color: var(--bd-pink-dark);
  font-weight: 500;
}

/* Direct Line Sidebar Banner */
.directline-banner {
  background: linear-gradient(135deg, var(--bd-navy) 0%, var(--bd-blue) 56%, var(--bd-pink) 100%);
  color: #ffffff;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(22, 82, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.directline-banner h3 {
  margin: 0;
  font-size: 16px;
}

.directline-banner p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

/* Web Links */
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li + li {
  border-top: 1px dashed var(--border);
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 2px;
  font-size: 13.5px;
  color: var(--text-main);
}

.link-list a:hover {
  color: var(--bd-blue);
}

/* President Message */
.president-msg-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}

.portrait-slot {
  min-height: 250px;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.skeleton-line {
  height: 12px;
  background: var(--bd-blue-soft);
  border-radius: 999px;
}

/* News Card Scaffold */
.news-empty-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #ffffff;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.like-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bd-blue-tint);
  border: 1px solid var(--border);
  color: var(--bd-navy);
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
}

/* Downloads Table */
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: linear-gradient(90deg, var(--bd-navy) 0%, var(--bd-blue) 100%);
  color: #ffffff;
  padding: 11px 12px;
  text-align: left;
  font-weight: 600;
}

.data-table tbody tr:hover td {
  background: var(--bd-blue-tint);
}

.data-table th:first-child,
.data-table td:first-child {
  width: 60px;
  text-align: center;
}

.data-table th:last-child,
.data-table td:last-child {
  width: 120px;
  text-align: center;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

/* Gallery & Video Slots */
.gallery-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gallery-slot {
  min-height: 140px;
  width: 100%;
  min-width: 0;
  padding: 10px;
}

.video-slot {
  aspect-ratio: 16 / 9;
  max-height: 360px;
  width: 100%;
  min-width: 0;
}

/* Lower Full-Width Landing Sections */
.landing-section {
  padding: 14px 0 26px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tab-btn:hover {
  border-color: var(--bd-blue);
  color: var(--bd-blue);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--bd-blue) 0%, var(--bd-blue-mid) 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(22, 82, 184, 0.22);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Board Wireframe Pyramid */
.board-pyramid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.board-row {
  display: grid;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.board-row-1 { grid-template-columns: minmax(160px, 200px); }
.board-row-2 { grid-template-columns: repeat(2, minmax(150px, 190px)); }
.board-row-4 { grid-template-columns: repeat(4, minmax(130px, 1fr)); }

.board-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #ffffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.board-card .avatar-placeholder {
  width: 74px;
  height: 92px;
}

.board-card strong {
  font-size: 13px;
  color: var(--bd-navy);
}

.board-card span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Membership & Direct Line Grids */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.split-grid > *,
.form-grid > * {
  min-width: 0;
}

.tier-list {
  display: grid;
  gap: 10px;
}

.tier-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--bd-blue-mid);
  border-radius: 10px;
  padding: 13px 15px;
  background: linear-gradient(135deg, var(--bd-blue-tint) 0%, #ffffff 70%, var(--bd-pink-soft) 100%);
}

.tier-item h4 {
  margin: 0 0 4px;
  color: var(--bd-navy);
  font-size: 14.5px;
}

.tier-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--bd-navy);
}

.form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text-main);
}

.form-control:focus {
  outline: 2px solid rgba(29, 95, 214, 0.25);
  border-color: var(--bd-blue);
}

/* Bylaws list */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.chapter-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #ffffff;
}

.chapter-box strong {
  display: block;
  color: var(--bd-blue);
  font-size: 13.5px;
  margin-bottom: 4px;
}

.chapter-box span {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Google Map Embed */
.map-embed-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bd-blue-tint);
}

.map-embed-frame {
  display: block;
  width: 100%;
  height: 240px;
  border: 0;
}

.map-embed-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.map-embed-footer a {
  color: var(--bd-blue);
  font-weight: 600;
}

.map-embed-footer a:hover {
  text-decoration: underline;
}

/* Badges & Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #e6f6ec;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: var(--bd-blue-soft);
  color: var(--bd-blue);
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

/* Filter Bar & Member Directory */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.filter-bar .form-control {
  flex: 1 1 180px;
}

.member-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 14px;
}

.member-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.member-code {
  font-family: monospace;
  font-size: 12.5px;
  color: var(--bd-blue);
  font-weight: 700;
}

/* KPI Grid & Bar Chart */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--bd-blue-mid);
  border-radius: 10px;
  padding: 13px 15px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.kpi-card:nth-child(even) {
  border-top-color: var(--bd-pink-mid);
  background: linear-gradient(180deg, #ffffff 0%, #fef8fb 100%);
}

.kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--bd-navy);
  margin-top: 2px;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  background: var(--bd-blue-soft);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bd-blue) 0%, var(--bd-sky) 60%, var(--bd-pink-mid) 100%);
  border-radius: 999px;
}

/* News Card Actions */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-actions-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Gallery Card clickable */
.gallery-slot-btn {
  width: 100%;
  min-width: 0;
  min-height: 145px;
  border: 2px dashed var(--border-dashed);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(
    -45deg,
    #f7faff,
    #f7faff 10px,
    #eef4ff 10px,
    #eef4ff 20px
  );
  color: var(--bd-navy);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.gallery-slot-btn:hover {
  transform: translateY(-2px);
  border-color: var(--bd-blue);
}

/* Modal System */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 88, 0.68);
  backdrop-filter: blur(3px);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(10, 37, 88, 0.3);
  overflow: hidden;
  margin: auto;
}

.modal-dialog.modal-lg {
  max-width: 820px;
}

.modal-dialog.modal-xl {
  max-width: 1080px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--bd-navy) 0%, var(--bd-blue) 68%, var(--bd-pink) 100%);
  border-bottom: 2px solid var(--bd-pink-mid);
  color: #ffffff;
}

.modal-header h3 {
  margin: 0;
  font-size: 16.5px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 20px;
}

.admin-split {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  align-items: start;
}

/* Auto PR Poster Generator */
.poster-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.poster-toolbar > *,
.poster-toolbar > div,
.poster-toolbar select {
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.poster-canvas {
  border: 2px solid var(--bd-navy);
  border-radius: var(--radius-md);
  padding: 26px;
  background: #ffffff;
  color: var(--text-main);
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  min-width: 0;
}

.poster-canvas.poster-urgent {
  border-color: var(--bd-pink);
  background: linear-gradient(180deg, var(--bd-pink-soft) 0%, #ffffff 32%);
}

.poster-canvas.poster-urgent .poster-header-bar {
  background: linear-gradient(135deg, var(--bd-pink-dark) 0%, var(--bd-pink) 65%, var(--bd-blue) 100%);
}

.poster-canvas.poster-square {
  max-width: 540px;
  border-width: 4px;
}

.poster-header-bar {
  background: linear-gradient(135deg, var(--bd-navy) 0%, var(--bd-blue) 64%, var(--bd-pink) 100%);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  border-bottom: 3px solid var(--bd-pink-mid);
}

.poster-crest-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  padding: 4px;
  flex-shrink: 0;
  display: block;
}

.receipt-crest-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.poster-crest {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  text-align: center;
  flex-shrink: 0;
}

.poster-title-main {
  font-size: 22px;
  font-weight: 700;
  color: var(--bd-navy);
  margin: 8px 0 10px;
  line-height: 1.35;
}

.poster-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 2px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.poster-qr-box {
  width: 136px;
  max-width: 100%;
  min-height: 78px;
  padding: 8px 10px;
  border: 1.5px dashed var(--border-dashed);
  border-radius: 8px;
  background: var(--bd-blue-tint);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--bd-blue);
  flex-shrink: 0;
}

/* Printable Receipt */
.receipt-card {
  border: 1.5px solid var(--bd-navy);
  border-radius: var(--radius-sm);
  padding: 20px;
  background: #ffffff;
}

/* Gallery Lightbox */
.lightbox-stage {
  min-height: 280px;
  padding: 24px;
}

.lightbox-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* Toast Notification */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  background: var(--bd-navy);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--bd-gold);
  box-shadow: 0 10px 24px rgba(10, 37, 88, 0.25);
  font-size: 13.5px;
}

.btn-danger-outline {
  background: #ffffff;
  color: #b91c1c;
  border-color: #fca5a5;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, var(--bd-navy) 0%, #07193d 100%);
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--bd-blue-mid) 0%, var(--bd-sky) 50%, var(--bd-pink-mid) 100%) 1;
  color: rgba(255, 255, 255, 0.92);
  padding: 32px 0;
  margin-top: 16px;
  text-align: center;
  font-size: 13.5px;
}

.visitor-counter {
  display: inline-flex;
  gap: 4px;
  margin: 10px 0 14px;
}

.counter-digit {
  background: #13387f;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 15px;
}

.footer-muted {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
}

.footer-links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 10px;
  font-size: 12.5px;
  color: #dbeafe;
}

.footer-links a:hover {
  color: #fbcfe8;
  text-decoration: underline;
}

/* Font Size Switcher & Hero Media */
.topbar-sep {
  opacity: 0.45;
}

.font-scale-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 2px 4px;
}

.font-scale-btn {
  background: transparent;
  border: none;
  color: #dbeafe;
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.font-scale-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.font-scale-btn.active {
  background: #ffffff;
  color: var(--bd-navy);
}

.hero-banner-media {
  min-width: 0;
  display: flex;
  align-items: center;
}

.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* Transparency, Past Presidents, Projects & PDPA */
#about,
#projects,
#membership,
#member-directory,
#direct-line,
#contact,
#documents,
#news,
.tab-btn[id] {
  scroll-margin-top: 76px;
}

.section-lead {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 14.5px;
}

.transparency-banner {
  background: linear-gradient(135deg, var(--bd-blue-tint) 0%, var(--bd-pink-soft) 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--bd-blue);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  min-width: 0;
  overflow-wrap: break-word;
}

.transparency-banner strong {
  display: block;
  color: var(--bd-navy);
  margin-bottom: 4px;
}

.transparency-banner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

.inline-action-link {
  color: var(--bd-blue);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
}

.inline-action-link:hover {
  color: var(--bd-pink);
}

.president-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.president-card {
  background: var(--bd-blue-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  min-width: 0;
  overflow-wrap: break-word;
}

.president-card.current {
  background: linear-gradient(135deg, #f4f8ff 0%, #fdf2f8 100%);
  border-color: #b6cef2;
  box-shadow: var(--shadow-sm);
}

.president-term {
  font-size: 12px;
  font-weight: 700;
  color: var(--bd-pink-dark);
  margin-bottom: 4px;
}

.president-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--bd-navy);
}

.president-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow-wrap: break-word;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, border-color 0.18s;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: #9dc0ef;
}

.project-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.project-tag.blue {
  background: var(--bd-blue-soft);
  color: var(--bd-blue);
}

.project-tag.pink {
  background: var(--bd-pink-soft);
  color: var(--bd-pink-dark);
}

.project-card h4 {
  margin: 2px 0 0;
  font-size: 16px;
  color: var(--bd-navy);
  line-height: 1.35;
}

.project-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  flex: 1;
}

.project-link {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bd-blue);
  margin-top: 4px;
}

.project-link:hover {
  color: var(--bd-pink);
  text-decoration: underline;
}

.pdpa-consent-note {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.pdpa-consent-note a {
  color: var(--bd-blue);
  font-weight: 600;
  text-decoration: underline;
}

.pdpa-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Global Accessible Font Scaling */
html[data-font-size="sm"] body {
  font-size: 13.5px;
}

html[data-font-size="sm"] .section-lead,
html[data-font-size="sm"] .tier-item p,
html[data-font-size="sm"] .project-card p,
html[data-font-size="sm"] .president-card p,
html[data-font-size="sm"] .transparency-banner p,
html[data-font-size="sm"] .data-table td,
html[data-font-size="sm"] .data-table th,
html[data-font-size="sm"] .link-list a {
  font-size: 12.5px;
}

html[data-font-size="lg"] body {
  font-size: 17px;
}

html[data-font-size="lg"] .hero-copy p,
html[data-font-size="lg"] .section-lead,
html[data-font-size="lg"] .tier-item p,
html[data-font-size="lg"] .project-card p,
html[data-font-size="lg"] .president-card p,
html[data-font-size="lg"] .transparency-banner p,
html[data-font-size="lg"] .news-item p,
html[data-font-size="lg"] .link-list a,
html[data-font-size="lg"] .data-table td,
html[data-font-size="lg"] .data-table th,
html[data-font-size="lg"] .form-control {
  font-size: 16px;
}

html[data-font-size="lg"] .project-card h4,
html[data-font-size="lg"] .president-card h4,
html[data-font-size="lg"] .tier-item h4 {
  font-size: 17.5px;
}

/* Responsive */
@media (max-width: 1080px) {
  .portal-layout {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 16px;
  }

  .hero-card {
    padding: 22px;
    gap: 20px;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .portal-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card,
  .split-grid,
  .president-msg-grid,
  .admin-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-row-1 {
    grid-template-columns: minmax(0, 220px);
  }

  .board-row-2,
  .board-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-link {
    padding: 9px 10px;
    font-size: 13.5px;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 10px;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-link {
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 12px;
    font-size: 14.5px;
  }

  .dropdown-menu {
    display: block;
    position: static;
    min-width: 0;
    box-shadow: none;
    border-radius: 8px;
    border-top: none;
    margin: 2px 0 6px 12px;
    background: rgba(255, 255, 255, 0.96);
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-grid,
  .president-grid,
  .pdpa-policy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tab-btn {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 0 12px;
  }

  .header-brand {
    padding: 14px 0;
    gap: 14px;
  }

  .brand-left {
    gap: 12px;
  }

  .site-logo-wrap {
    width: 58px;
    height: 58px;
  }

  .hero-card {
    padding: 18px 14px;
    gap: 16px;
  }

  .card-header {
    padding: 12px 14px;
  }

  .card-body {
    padding: 14px;
  }

  .gallery-placeholder-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-slot-btn {
    min-height: 112px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-body {
    padding: 14px;
  }

  .poster-canvas {
    padding: 14px;
  }

  .poster-header-bar {
    padding: 12px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .poster-title-main {
    font-size: 18px;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}

@media (max-width: 360px) {
  .board-row-2,
  .board-row-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .poster-canvas {
    padding: 12px;
    font-size: 14px;
    overflow-wrap: anywhere;
  }
}

/* Scroll Progress, Living Hero Motion, 2.5D Tilt, Scroll Reveal & 3D Flip Member Card */
.scroll-progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 300;
  pointer-events: none;
}

.scroll-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--bd-blue-mid) 0%, var(--bd-sky) 50%, var(--bd-pink-mid) 100%);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.45);
  transition: width 0.08s linear;
}

.topbar-compare-pill {
  color: #ffffff;
  font-weight: 600;
}

.topbar-compare-pill:hover {
  border-color: rgba(251, 207, 232, 0.78);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.34), rgba(236, 72, 153, 0.42));
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -20% -12%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 22% 24%, rgba(56, 189, 248, 0.16), transparent 44%),
    radial-gradient(circle at 82% 72%, rgba(236, 72, 153, 0.14), transparent 44%);
  animation: heroGlowDrift 14s ease-in-out infinite alternate;
}

@keyframes heroGlowDrift {
  0% {
    transform: translate3d(-1.5%, -1.5%, 0) scale(1);
  }
  100% {
    transform: translate3d(1.8%, 1.5%, 0) scale(1.04);
  }
}

.hero-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-copy,
.hero-banner-media {
  position: relative;
  z-index: 2;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bd-pink-mid);
  box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.55);
  animation: livePulse 2.2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(236, 72, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);
  }
}

.hero-metric {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.hero-metric:hover {
  transform: translateY(-2px);
  border-color: #9dc0ef;
  box-shadow: 0 8px 18px rgba(22, 82, 184, 0.12);
}

.hero-metric .metric-num {
  font-variant-numeric: tabular-nums;
}

.tilt-surface {
  position: relative;
  border-radius: var(--radius-md);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.32s ease, border-color 0.22s ease;
}

.tilt-surface.is-tilting {
  transition: transform 0.08s linear, box-shadow 0.2s ease;
}

.tilt-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.36), rgba(56, 189, 248, 0.08) 42%, transparent 72%);
  z-index: 3;
}

.tilt-surface:hover .tilt-sheen {
  opacity: 1;
}

.project-card,
.president-card {
  background-image: radial-gradient(280px circle at var(--mx, -240px) var(--my, -240px), rgba(56, 189, 248, 0.10), rgba(236, 72, 153, 0.05) 45%, transparent 75%);
}

html.motion-enabled .reveal-item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

html.motion-enabled .reveal-item.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.member-id-flip-section {
  margin-bottom: 16px;
}

.member-id-flip-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.member-id-flip-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bd-navy);
}

.member-id-flip-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.member-id-card {
  display: grid;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.member-id-flip-wrap.is-flipped .member-id-card {
  transform: rotateY(180deg);
}

.member-id-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  padding: 16px 18px;
  color: #ffffff;
  box-shadow: 0 14px 28px -8px rgba(11, 37, 89, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.member-id-front {
  background:
    radial-gradient(circle at 88% 14%, rgba(236, 72, 153, 0.36), transparent 42%),
    radial-gradient(circle at 12% 88%, rgba(56, 189, 248, 0.32), transparent 46%),
    linear-gradient(135deg, #0b2559 0%, #1652b8 62%, #1d4ed8 100%);
}

.member-id-back {
  background:
    radial-gradient(circle at 14% 20%, rgba(56, 189, 248, 0.28), transparent 44%),
    linear-gradient(135deg, #132c63 0%, #1e3a8a 60%, #701a75 100%);
  transform: rotateY(180deg);
}

.member-id-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-id-crest {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  padding: 3px;
  object-fit: contain;
  flex-shrink: 0;
}

.member-id-org {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
}

.member-id-org small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: #dbeafe;
}

.member-id-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.member-id-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.member-id-sub {
  font-size: 12px;
  color: #e0f2fe;
  margin-top: 2px;
}

.member-id-chip {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.member-id-back-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.member-id-qr-mock {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--bd-navy);
  font-family: monospace;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 4px;
  line-height: 1.15;
  flex-shrink: 0;
}

.member-id-rights {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: #f1f5f9;
  line-height: 1.45;
}

@media (max-width: 360px) {
  .member-id-face {
    padding: 12px 14px;
  }

  .member-id-back-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-card::before,
  .live-dot {
    animation: none;
  }

  .scroll-progress-bar,
  .tilt-surface,
  .member-id-card,
  html.motion-enabled .reveal-item {
    transition: none !important;
  }

  html.motion-enabled .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Plan B: Real 3D Hero Stage (Three.js) */
.hero-3d-stage {
  position: relative;
  z-index: 2;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-3d-viewport {
  position: relative;
  min-width: 0;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(22, 82, 184, 0.24);
  background:
    radial-gradient(circle at 22% 18%, rgba(56, 189, 248, 0.28), transparent 46%),
    radial-gradient(circle at 82% 82%, rgba(236, 72, 153, 0.24), transparent 48%),
    linear-gradient(145deg, #0b2559 0%, #143f91 54%, #091d47 100%);
  box-shadow: var(--shadow-md);
}

.hero-3d-fallback {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  box-shadow: none;
}

.hero-3d-canvas {
  display: none;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.hero-3d-canvas:active {
  cursor: grabbing;
}

.hero-3d-badge-bar {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: none;
}

.hero-3d-chip {
  background: rgba(11, 37, 89, 0.72);
  backdrop-filter: blur(6px);
  color: #e0f2fe;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
}

.hero-3d-controls {
  display: inline-flex;
  gap: 6px;
  pointer-events: auto;
}

.hero-3d-ctrl-btn {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s;
}

.hero-3d-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.hero-3d-mobile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
  background: rgba(11, 37, 89, 0.88);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(11, 37, 89, 0.35);
}

.hero-3d-stage.is-3d-active .hero-3d-viewport {
  height: 310px;
}

.hero-3d-stage.is-3d-active .hero-3d-fallback,
.hero-3d-stage.is-3d-active .hero-3d-mobile-trigger,
.hero-3d-stage.is-webgl-unavailable .hero-3d-mobile-trigger {
  display: none;
}

.hero-3d-stage.is-3d-active .hero-3d-canvas {
  display: block;
}

.hero-3d-stage.is-3d-active .hero-3d-badge-bar {
  display: flex;
}

.hero-3d-hud {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hero-3d-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-3d-pill {
  border: 1px solid var(--border);
  background: var(--bd-blue-tint);
  color: var(--bd-navy);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.hero-3d-pill:hover {
  border-color: var(--bd-blue);
}

.hero-3d-pill.active {
  background: linear-gradient(135deg, var(--bd-blue) 0%, var(--bd-pink) 100%);
  color: #ffffff;
  border-color: transparent;
}

.hero-3d-caption {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
}

.hero-3d-caption strong {
  display: block;
  color: var(--bd-navy);
}

.hero-3d-caption span {
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .hero-3d-stage:not(.is-3d-active) .hero-3d-viewport {
    height: auto;
  }

  .hero-3d-stage.is-3d-active .hero-3d-viewport {
    height: 245px;
  }
}

/* Print only active printable modal (Poster / Receipt) */
@media print {
  body {
    background: #ffffff;
  }

  body > *:not(.modal-overlay.print-active) {
    display: none !important;
  }

  .modal-overlay.print-active {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .modal-overlay.print-active .modal-dialog {
    box-shadow: none !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  .modal-overlay.print-active .no-print {
    display: none !important;
  }
}
