:root {

  --bg: #f6f8f7;

  --surface: rgba(255, 255, 255, 0.88);

  --surface-solid: #ffffff;

  --text: #17352d;

  --muted: #6f7e79;

  --green: #0b7a55;

  --green-2: #12966b;

  --green-soft: #e8f5ef;

  --orange: #f39a3d;

  --orange-soft: #fff3e5;

  --line: #e2e9e6;

  --shadow: 0 16px 45px rgba(22, 71, 56, 0.09);

  --shadow-hover: 0 20px 50px rgba(22, 71, 56, 0.14);

  --radius-lg: 28px;

  --radius-md: 20px;

  --radius-sm: 14px;

}


[data-theme="dark"] {

  --bg: #101714;

  --surface: rgba(25, 37, 32, 0.88);

  --surface-solid: #18231f;

  --text: #edf6f2;

  --muted: #a5b4ae;

  --green: #3bd39b;

  --green-2: #62e5b4;

  --green-soft: #17372b;

  --orange: #ffb260;

  --orange-soft: #3a2a19;

  --line: #2c3c36;

  --shadow: 0 16px 45px rgba(0, 0, 0, 0.22);

  --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.32);

}


* { box-sizing: border-box; }


html { scroll-behavior: smooth; }


body {

  margin: 0;

  min-height: 100vh;

  font-family: "Sarabun", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color: var(--text);

  background:

    radial-gradient(circle at 7% 5%, rgba(11, 122, 85, 0.10), transparent 28%),

    radial-gradient(circle at 94% 12%, rgba(243, 154, 61, 0.10), transparent 22%),

    var(--bg);

  transition: background .25s ease, color .25s ease;

}


button, input { font: inherit; }


a { color: inherit; }


.page-shell {

  width: min(1380px, calc(100% - 36px));

  margin: 0 auto;

}


.topbar {

  min-height: 88px;

  display: flex;

  align-items: center;

  justify-content: space-between;

}


.brand {

  display: inline-flex;

  gap: 12px;

  align-items: center;

  text-decoration: none;

}


.brand-mark {

  width: 58px;

  height: 58px;

  display: grid;

  place-items: center;

  background: transparent;

  box-shadow: none;

  overflow: hidden;

}


.brand-mark img {

  width: 54px;

  height: 54px;

  object-fit: contain;

  display: block;

}


.brand-title {

  font-weight: 700;

  font-size: 16px;

  line-height: 1.25;

}


.brand-subtitle {

  margin-top: 3px;

  font-size: 12px;

  color: var(--muted);

}


.icon-button {

  width: 44px;

  height: 44px;

  border: 1px solid var(--line);

  border-radius: 14px;

  background: var(--surface);

  color: var(--text);

  cursor: pointer;

  box-shadow: 0 8px 22px rgba(40, 70, 60, .05);

}


.hero {

  position: relative;

  overflow: hidden;

  min-height: 360px;

  display: grid;

  grid-template-columns: 1.65fr .75fr;

  gap: 34px;

  align-items: center;

  padding: 54px;

  border: 1px solid rgba(255,255,255,.8);

  border-radius: 34px;

  background:

    linear-gradient(130deg, rgba(255,255,255,.96), rgba(244,252,248,.92) 50%, rgba(255,247,237,.88)),

    var(--surface);

  box-shadow: var(--shadow);

}


[data-theme="dark"] .hero {

  border-color: var(--line);

  background:

    linear-gradient(130deg, rgba(24,35,31,.98), rgba(20,43,34,.92) 55%, rgba(48,35,21,.88));

}


.hero::after {

  content: "";

  position: absolute;

  right: -90px;

  top: -110px;

  width: 360px;

  height: 360px;

  border-radius: 50%;

  background: linear-gradient(145deg, rgba(11,122,85,.11), rgba(243,154,61,.11));

  filter: blur(1px);

}


.eyebrow, .section-kicker {

  color: var(--green);

  font-weight: 700;

  letter-spacing: 1.4px;

  font-size: 12px;

}


.hero h1 {

  margin: 12px 0 15px;

  max-width: 780px;

  font-size: clamp(36px, 4.7vw, 66px);

  line-height: 1.08;

  letter-spacing: -1.8px;

}


.hero h1 span {

  font-size: 45px;

  color: var(--green);

}


.hero p {

  margin: 0;

  max-width: 720px;

  font-size: 17px;

  line-height: 1.7;

  color: var(--muted);

}


.search-wrap {

  margin-top: 28px;

  width: min(720px, 100%);

  min-height: 58px;

  display: flex;

  align-items: center;

  gap: 12px;

  padding: 0 15px;

  border: 1px solid var(--line);

  border-radius: 18px;

  background: var(--surface-solid);

  box-shadow: 0 10px 25px rgba(30, 60, 50, .06);

}


.search-icon {

  color: var(--green);

  font-size: 24px;

  transform: rotate(-20deg);

}


.search-wrap input {

  min-width: 0;

  flex: 1;

  border: 0;

  outline: none;

  padding: 17px 0;

  background: transparent;

  color: var(--text);

  font-size: 15px;

}


.search-wrap input::placeholder { color: #98a49f; }


kbd {

  padding: 5px 8px;

  border: 1px solid var(--line);

  border-bottom-width: 2px;

  border-radius: 8px;

  color: var(--muted);

  background: var(--bg);

  font-size: 11px;

}


.hero-panel {

  position: relative;

  z-index: 1;

  justify-self: end;

  width: min(310px, 100%);

  display: flex;

  gap: 13px;

  align-items: flex-start;

  padding: 20px;

  border: 1px solid var(--line);

  border-radius: 20px;

  background: rgba(255,255,255,.72);

  backdrop-filter: blur(14px);

}


[data-theme="dark"] .hero-panel {

  background: rgba(24,35,31,.76);

}


.hero-panel strong,

.hero-panel span {

  display: block;

}


.hero-panel span {

  margin-top: 5px;

  color: var(--muted);

  font-size: 13px;

  line-height: 1.5;

}


.status-dot {

  flex: 0 0 auto;

  width: 10px;

  height: 10px;

  margin-top: 5px;

  border-radius: 50%;

  background: #2ebd7d;

  box-shadow: 0 0 0 5px rgba(46,189,125,.13);

}


.quick-section,

.content-section {

  padding: 48px 4px 0;

}


.section-heading {

  margin-bottom: 18px;

}


.section-heading-row {

  display: flex;

  align-items: end;

  justify-content: space-between;

  gap: 20px;

}


.section-heading h2 {

  margin: 4px 0 0;

  font-size: 28px;

  letter-spacing: -.5px;

}


.result-count {

  color: var(--muted);

  font-size: 13px;

}


.quick-grid {

  display: grid;

  grid-template-columns: repeat(4, 1fr);

  gap: 16px;

}


.quick-card {

  min-height: 132px;

  display: flex;

  flex-direction: column;

  justify-content: space-between;

  gap: 16px;

  padding: 22px;

  border: 1px solid var(--line);

  border-radius: var(--radius-md);

  text-decoration: none;

  background: var(--surface);

  box-shadow: 0 8px 28px rgba(30, 70, 55, .05);

  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;

}


.quick-card:hover {

  transform: translateY(-3px);

  border-color: rgba(11,122,85,.28);

  box-shadow: var(--shadow-hover);

}


.quick-top {

  display: flex;

  align-items: center;

  justify-content: space-between;

}


.quick-icon, .portal-icon {

  display: grid;

  place-items: center;

  border-radius: 14px;

  background: var(--green-soft);

  color: var(--green);

  font-weight: 700;

}


.quick-icon {

  width: 43px;

  height: 43px;

}


.arrow {

  color: var(--muted);

  font-size: 18px;

}


.quick-card strong {

  font-size: 16px;

}


.quick-card small {

  display: block;

  margin-top: 4px;

  color: var(--muted);

}


.filter-bar {

  display: flex;

  gap: 8px;

  overflow-x: auto;

  padding: 2px 0 16px;

  scrollbar-width: none;

}


.filter-bar::-webkit-scrollbar { display: none; }


.filter-btn {

  white-space: nowrap;

  padding: 9px 15px;

  border: 1px solid var(--line);

  border-radius: 999px;

  background: var(--surface);

  color: var(--muted);

  cursor: pointer;

  transition: all .16s ease;

}


.filter-btn:hover,

.filter-btn.active {

  border-color: var(--green);

  background: var(--green-soft);

  color: var(--green);

}


.portal-grid {

  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 16px;

}


.portal-card {

  position: relative;

  min-height: 210px;

  padding: 24px;

  border: 1px solid var(--line);

  border-radius: var(--radius-md);

  background: var(--surface);

  box-shadow: 0 9px 30px rgba(30, 70, 55, .045);

  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;

}


.portal-card:hover {

  transform: translateY(-4px);

  border-color: rgba(11,122,85,.30);

  box-shadow: var(--shadow-hover);

}


.portal-card-head {

  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  gap: 16px;

}


.portal-icon {

  width: 48px;

  height: 48px;

  font-size: 13px;

}


.badge {

  padding: 5px 9px;

  border-radius: 999px;

  background: var(--orange-soft);

  color: var(--orange);

  font-size: 11px;

  font-weight: 700;

}


.portal-card h3 {

  margin: 18px 0 7px;

  font-size: 19px;

}


.portal-card p {

  min-height: 48px;

  margin: 0;

  color: var(--muted);

  font-size: 14px;

  line-height: 1.65;

}


.card-footer {

  margin-top: 18px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

}


.category-label {

  color: var(--muted);

  font-size: 12px;

}


.open-link {

  display: inline-flex;

  align-items: center;

  gap: 7px;

  padding: 9px 12px;

  border-radius: 11px;

  background: var(--green);

  color: #fff;

  text-decoration: none;

  font-size: 13px;

  font-weight: 600;

}


.open-link:hover { filter: brightness(1.04); }


.empty-state {

  padding: 48px 24px;

  text-align: center;

  color: var(--muted);

}


.empty-icon {

  width: 58px;

  height: 58px;

  display: grid;

  place-items: center;

  margin: 0 auto 12px;

  border-radius: 17px;

  background: var(--green-soft);

  color: var(--green);

  font-size: 28px;

}


.empty-state h3 {

  margin: 0 0 6px;

  color: var(--text);

}


.empty-state p { margin: 0; }


footer {

  min-height: 120px;

  margin-top: 56px;

  padding: 28px 4px 46px;

  display: flex;

  justify-content: space-between;

  gap: 20px;

  align-items: flex-start;

  border-top: 1px solid var(--line);

  color: var(--muted);

  font-size: 12px;

}


footer strong, footer span {

  display: block;

}


footer strong {

  margin-bottom: 4px;

  color: var(--text);

  font-size: 13px;

}


@media (max-width: 1050px) {

  .hero { grid-template-columns: 1fr; }

  .hero-panel { justify-self: start; }

  .quick-grid { grid-template-columns: repeat(2, 1fr); }

  .portal-grid { grid-template-columns: repeat(2, 1fr); }

}


@media (max-width: 680px) {

  .page-shell { width: min(100% - 24px, 1380px); }


  .topbar { min-height: 76px; }


  .brand-subtitle { display: none; }


  .hero {

    min-height: auto;

    padding: 30px 22px;

    border-radius: 25px;

  }


  .hero h1 {

    font-size: clamp(34px, 12vw, 46px);

    letter-spacing: -1px;

  }


  .hero p { font-size: 15px; }


  .search-wrap { margin-top: 22px; }

  kbd { display: none; }


  .quick-section,

  .content-section { padding-top: 38px; }


  .quick-grid,

  .portal-grid { grid-template-columns: 1fr; }


  .section-heading-row { align-items: flex-start; }


  .portal-card { min-height: 195px; }


  footer {

    flex-direction: column;

    min-height: 100px;

  }

}


.quick-icon,

.portal-icon {

  background: #ffffff00;

  border: 1px solid var(--line);

  padding: 6px;

}


.quick-icon img,

.portal-icon img {

  width: 100%;

  height: 100%;

  object-fit: contain;

}


/* ===================================

   TEAM ORBIT - HALLOWEEN PREMIUM

   สำหรับสมาชิกทีม 12 คน

=================================== */


.team-orbit {

  position: absolute;

  right: 10px;

  top: 25px;


  width: 460px;

  height: 320px;


  pointer-events: none;

  z-index: 2;

}


/* วงเส้นทาง */


.orbit-line {

  position: absolute;


  width: 390px;

  height: 230px;


  left: 35px;

  top: 40px;


  border: 1.5px dashed rgba(125, 77, 255, 0.24);

  border-radius: 50%;


  box-shadow:

    0 0 22px rgba(125, 77, 255, 0.08),

    inset 0 0 18px rgba(255, 145, 50, 0.05);


  animation: orbitGlow 4s ease-in-out infinite;

}


/* รูปสมาชิก */


.member {

  position: absolute;


  width: 50px;

  height: 50px;


  border-radius: 50%;


  padding: 3px;


  background: rgba(255, 255, 255, 0.96);


  overflow: hidden;


  box-shadow:

    0 0 0 2px rgba(255,255,255,.9),

    0 0 14px rgba(125, 77, 255, .28),

    0 9px 24px rgba(22, 71, 56, .16);


  /*

    วิ่งตามวงรี

  */

  offset-path: ellipse(195px 115px at 230px 155px);


  /*

    3 animation พร้อมกัน

    1\. วิ่งรอบวง

    2\. ลอยเหมือนผี

    3\. แสงเรือง

  */

  animation:

    halloweenOrbit 22s linear infinite,

    ghostFloat 3.2s ease-in-out infinite,

    spookyGlow 2.8s ease-in-out infinite;


  pointer-events: auto;


  cursor: pointer;


  transition:

    width .2s ease,

    height .2s ease,

    filter .2s ease;

}


/* รูปด้านใน */


.member img {

  width: 100%;

  height: 100%;


  object-fit: cover;


  border-radius: 50%;


  display: block;

}


/* ===================================

   กระจายสมาชิก 12 คนรอบวง

=================================== */


.member-1 {

  animation-delay: 0s, 0s, 0s;

}


.member-2 {

  animation-delay: -1.833s, -.3s, -.4s;

}


.member-3 {

  animation-delay: -3.666s, -.6s, -.8s;

}


.member-4 {

  animation-delay: -5.499s, -.9s, -1.2s;

}


.member-5 {

  animation-delay: -7.332s, -1.2s, -1.6s;

}


.member-6 {

  animation-delay: -9.165s, -1.5s, -2s;

}


.member-7 {

  animation-delay: -10.998s, -1.8s, -.3s;

}


.member-8 {

  animation-delay: -12.831s, -2.1s, -.7s;

}


.member-9 {

  animation-delay: -14.664s, -2.4s, -1.1s;

}


.member-10 {

  animation-delay: -16.497s, -2.7s, -1.5s;

}


.member-11 {

  animation-delay: -18.330s, -3s, -1.9s;

}


.member-12 {

  animation-delay: -20.163s, -3.3s, -.5s;

}


/* ===================================

   Animation วิ่งรอบวง

=================================== */


@keyframes halloweenOrbit {


  from {

    offset-distance: 0%;

  }


  to {

    offset-distance: 100%;

  }


}


/* ===================================

   Animation ลอยเหมือนผี

=================================== */


@keyframes ghostFloat {


  0%,

  100% {

    transform:

      translateY(0px)

      rotate(-2deg);

  }


  50% {

    transform:

      translateY(-9px)

      rotate(3deg);

  }


}


/* ===================================

   Animation Glow

=================================== */


@keyframes spookyGlow {


  0%,

  100% {

    filter:

      drop-shadow(

        0 0 3px

        rgba(125, 77, 255, .18)

      );

  }


  50% {

    filter:

      drop-shadow(

        0 0 10px

        rgba(255, 145, 0, 0.65)

      );

  }


}


/* เส้นวงเรืองเบาๆ */


@keyframes orbitGlow {


  0%,

  100% {

    opacity: .55;

  }


  50% {

    opacity: 1;

  }


}


/* ===================================

   Hover

=================================== */


.member:hover {

  width: 62px;

  height: 62px;


  filter:

    brightness(1.08)

    saturate(1.12)

    drop-shadow(

      0 0 16px

      rgba(255, 145, 50, .75)

    );


  box-shadow:

    0 0 0 3px rgba(255,255,255,.95),

    0 0 20px rgba(255, 145, 50, .45),

    0 12px 30px rgba(22, 71, 56, .20);


  z-index: 30;

}


/* ===================================

   Tablet

=================================== */


@media (max-width: 1050px) {


  .team-orbit {


    right: -25px;

    top: 10px;


    transform: scale(.78);


    transform-origin: top right;


    opacity: .78;


  }


}


/* ===================================

   Mobile

=================================== */


@media (max-width: 680px) {


  .team-orbit {

    display: none;

  }


}


/* ===================================

   Accessibility

   คนที่ปิด animation ในระบบ

=================================== */


@media (prefers-reduced-motion: reduce) {


  .member,

  .orbit-line {


    animation: none;


  }


}


/* =========================================================

   BRANCH SWITCHER

========================================================= */


.header-right {

  display: flex;

  align-items: center;

  gap: 14px;

}


.branch-switcher {

  display: flex;

  align-items: center;

  gap: 10px;

}


.branch-label {

  color: var(--muted);

  font-size: 11px;

  font-weight: 600;

}


.branch-buttons {

  display: flex;

  align-items: center;

  gap: 4px;

  padding: 4px;


  border: 1px solid var(--line);

  border-radius: 15px;


  background: rgba(255,255,255,.75);


  backdrop-filter: blur(14px);


  box-shadow:

    0 8px 22px

    rgba(30,70,55,.05);

}


[data-theme="dark"] .branch-buttons {

  background: rgba(24,35,31,.78);

}


.branch-btn {

  min-height: 38px;


  display: inline-flex;

  align-items: center;

  justify-content: center;


  gap: 7px;


  padding: 0 13px;


  border-radius: 11px;


  color: var(--muted);


  text-decoration: none;


  font-size: 13px;

  font-weight: 600;


  white-space: nowrap;


  transition:

background .2s ease,

    color .2s ease,

    transform .2s ease,

    box-shadow .2s ease;

}


.branch-dot {

  width: 7px;

  height: 7px;


  flex: 0 0 auto;


  border-radius: 50%;


  background: #c2ccc8;


  transition:

background .2s ease,

    box-shadow .2s ease;

}


.branch-btn:hover {

  color: var(--green);


  background: var(--green-soft);


  transform: translateY(-1px);

}


.branch-btn:hover .branch-dot {

  background: var(--green);

}


.branch-btn.active {

  color: #ffffff;


  background:

    linear-gradient(

      135deg,

      var(--green),

      var(--green-2)

    );


  box-shadow:

    0 7px 18px

    rgba(11,122,85,.20);

}


.branch-btn.active .branch-dot {

  background: #ffffff;


  box-shadow:

    0 0 0 4px

    rgba(255,255,255,.15);

}


/* =========================

   TABLET

========================= */


@media (max-width: 900px) {


  .branch-label {

    display: none;

  }


  .branch-btn {

    padding: 0 10px;

  }


}


/* =========================

   MOBILE

========================= */


@media (max-width: 680px) {


  .header-right {

    gap: 8px;

  }


  .branch-buttons {

    gap: 2px;

    padding: 3px;

  }


  .branch-btn {

    min-width: 38px;

    width: 38px;

    padding: 0;

  }


  .branch-name {

    display: none;

  }


  .branch-dot {

    display: none;

  }


  .branch-btn::after {

    font-size: 11px;

    font-weight: 700;

  }


  .branch-btn[data-branch="phaholyothin"]::after {

    content: "PH";

  }


  .branch-btn[data-branch="saimai"]::after {

    content: "SM";

  }


  .branch-btn[data-branch="lamlukka"]::after {

    content: "LL";

  }


}




/* =========================================================
   FIX: BRANCH ACTIVE STATE
   วางท้ายสุดเพื่อให้สาขาปัจจุบันแสดงสีเขียวชัดเจน
========================================================= */

.branch-btn.active,
.branch-btn[aria-current="page"] {
  color: #ffffff !important;
  background: linear-gradient(135deg, #0b7a55 0%, #12966b 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 7px 20px rgba(11, 122, 85, 0.28) !important;
}

.branch-btn.active .branch-name,
.branch-btn[aria-current="page"] .branch-name {
  color: #ffffff !important;
}

.branch-btn.active .branch-dot,
.branch-btn[aria-current="page"] .branch-dot {
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18) !important;
}

.branch-btn.active:hover,
.branch-btn[aria-current="page"]:hover {
  color: #ffffff !important;
  background: linear-gradient(135deg, #086c4b 0%, #0f8b63 100%) !important;
}
