:root {
  --navy: #0b2f5b;
  --navy-2: #123f76;
  --blue: #1769aa;
  --blue-soft: #eaf3fb;
  --gold: #d6a82f;
  --gold-deep: #b98917;
  --gold-soft: #f8f1dc;
  --ink: #13263a;
  --muted: #607284;
  --line: #dbe3ea;
  --surface: #fff;
  --bg: #f5f7f9;
  --shadow: 0 18px 48px rgba(11, 47, 91, .10);
  --radius: 14px;
}

/* Innovation dashboard v46 */
.innovation-dashboard-panel[hidden],
.innovation-results-heading[hidden],
#mediaGrid[hidden],
#pagination[hidden],
#resultCount[hidden] {
  display: none !important;
}

.library-section.innovation-dashboard-mode {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid #d9c9a8;
  border-top: 6px solid #8f3027;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, .98), rgba(247, 239, 221, .96)),
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(161, 116, 37, .06) 14px 15px);
  box-shadow: 0 20px 52px rgba(49, 37, 21, .1);
}

.library-section.innovation-dashboard-mode::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -55px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(172, 128, 47, .16);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(172, 128, 47, .045),
    0 0 0 60px rgba(172, 128, 47, .035);
  pointer-events: none;
}

.innovation-dashboard-panel {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.innovation-dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
  gap: 28px;
  align-items: stretch;
  overflow: hidden;
  padding: 34px;
  border: 1px solid rgba(218, 181, 89, .62);
  border-radius: 18px 18px 8px 8px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(7, 51, 72, .99), rgba(15, 75, 96, .94)),
    url("hero-media-library.webp") center 47% / cover no-repeat;
  box-shadow: 0 18px 34px rgba(7, 43, 59, .2);
}

.innovation-dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background:
    linear-gradient(135deg, transparent 0 73%, rgba(243, 202, 101, .42) 73% 73.5%, transparent 73.5%),
    radial-gradient(circle at 82% 20%, rgba(239, 198, 91, .35), transparent 28%);
  pointer-events: none;
}

.innovation-dashboard-copy,
.innovation-dashboard-stats {
  position: relative;
  z-index: 1;
}

.innovation-dashboard-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 13px;
  border: 1px solid rgba(239, 205, 115, .62);
  border-radius: 999px;
  color: #f5d77f;
  background: rgba(3, 30, 44, .36);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}

.innovation-dashboard-copy h3 {
  max-width: 720px;
  margin: 15px 0 9px;
  color: #fff;
  font-size: clamp(27px, 3vw, 41px);
  line-height: 1.25;
}

.innovation-dashboard-copy p {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 17px;
  line-height: 1.75;
}

.innovation-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.innovation-dashboard-actions .btn {
  min-height: 48px;
  text-decoration: none;
}

.innovation-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
}

.innovation-dashboard-stats article {
  display: grid;
  min-height: 126px;
  align-content: center;
  padding: 18px 12px;
  border: 1px solid rgba(237, 205, 126, .42);
  border-radius: 14px;
  text-align: center;
  background: rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12);
  backdrop-filter: blur(7px);
}

.innovation-dashboard-stats strong {
  color: #f3d171;
  font-family: Tahoma, sans-serif;
  font-size: 34px;
  line-height: 1;
}

.innovation-dashboard-stats span {
  margin-top: 10px;
  color: rgba(255, 255, 255, .84);
  font-size: 13px;
  line-height: 1.4;
}

.innovation-dashboard-toolbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 24px 4px 16px;
}

.innovation-dashboard-toolbar > div {
  display: grid;
  gap: 3px;
}

.innovation-dashboard-toolbar > div span {
  color: #9a3328;
  font-size: 13px;
  font-weight: 800;
}

.innovation-dashboard-toolbar > div strong {
  color: #17384f;
  font-size: 19px;
}

.innovation-dashboard-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #356451;
  font-size: 13px;
  font-weight: 800;
}

.innovation-dashboard-status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f9b70;
  box-shadow: 0 0 0 5px rgba(47, 155, 112, .13);
}

.innovation-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.innovation-dashboard-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 250px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid #dbcfba;
  border-bottom: 4px solid #95342a;
  border-radius: 14px;
  color: #18394d;
  text-decoration: none;
  background: rgba(255, 254, 250, .96);
  box-shadow: 0 10px 24px rgba(49, 39, 24, .08);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.innovation-dashboard-card:nth-child(2) { border-bottom-color: #1d6075; }
.innovation-dashboard-card:nth-child(3) { border-bottom-color: #b0822e; }
.innovation-dashboard-card:nth-child(4) { border-bottom-color: #2b806b; }
.innovation-dashboard-card:nth-child(5) { border-bottom-color: #78415e; }

.innovation-dashboard-card::before {
  content: "";
  position: absolute;
  top: -28px;
  right: -28px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(166, 122, 45, .13);
  border-radius: 50%;
}

.innovation-dashboard-card:hover,
.innovation-dashboard-card:focus-visible {
  transform: translateY(-5px);
  border-color: #c2a45c;
  box-shadow: 0 18px 30px rgba(56, 42, 21, .15);
}

.innovation-dashboard-card.is-active {
  border-color: #b68b32;
  background: linear-gradient(145deg, #fffdf5, #f8edcf);
  box-shadow: 0 0 0 3px rgba(205, 165, 67, .18), 0 18px 32px rgba(65, 48, 23, .14);
}

.innovation-dashboard-number {
  position: absolute;
  top: 13px;
  right: 14px;
  color: #9b896d;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.innovation-dashboard-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid #d7b557;
  border-radius: 50% 50% 44% 44%;
  color: #fff8e2;
  background: linear-gradient(145deg, #a13a2f, #71251f);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .07);
  font-family: Tahoma, sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.innovation-dashboard-card:nth-child(2) .innovation-dashboard-icon { background: linear-gradient(145deg, #21728b, #123e54); }
.innovation-dashboard-card:nth-child(3) .innovation-dashboard-icon { background: linear-gradient(145deg, #ba8d37, #79561f); }
.innovation-dashboard-card:nth-child(4) .innovation-dashboard-icon { background: linear-gradient(145deg, #2b8e76, #185243); }
.innovation-dashboard-card:nth-child(5) .innovation-dashboard-icon { background: linear-gradient(145deg, #8b4c6b, #552c43); }

.mi-dashboard-panel {
  margin-top: 22px;
  padding: 26px;
  border: 1px solid #d8c59f;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(202, 165, 78, .14), transparent 30%),
    linear-gradient(145deg, rgba(255, 254, 249, .99), rgba(246, 236, 213, .96));
  box-shadow: 0 12px 28px rgba(57, 42, 20, .08);
}

.mi-dashboard-panel.mi-dashboard-standalone {
  position: relative;
  margin: 34px 0 54px;
  padding: 32px;
  scroll-margin-top: 122px;
  border-top: 7px solid #8f3027;
  border-radius: 5px 5px 20px 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .62), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(202, 165, 78, .2), transparent 34%),
    linear-gradient(145deg, #fffdf7, #f4e5c8);
  box-shadow: 0 22px 48px rgba(57, 42, 20, .13);
}

.mi-dashboard-panel.mi-dashboard-standalone::before {
  content: "";
  position: absolute;
  inset: -7px 0 auto;
  height: 7px;
  border-radius: 5px 5px 0 0;
  background: repeating-linear-gradient(135deg, #8f3027 0 11px, #d1ad55 11px 16px, #17384f 16px 27px);
}

.mi-dashboard-panel.mi-dashboard-standalone .mi-dashboard-heading h4 {
  font-size: clamp(30px, 3vw, 42px);
}

.mi-dashboard-panel[hidden],
.mi-work-card[hidden],
.mi-empty-state[hidden] {
  display: none !important;
}

.mi-dashboard-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #dfd0b4;
}

.mi-dashboard-kicker {
  color: #96352b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .025em;
}

.mi-dashboard-heading h4 {
  margin: 5px 0 6px;
  color: #17384f;
  font-size: clamp(26px, 2.7vw, 37px);
  line-height: 1.25;
}

.mi-dashboard-heading p {
  max-width: 850px;
  margin: 0;
  color: #5f6c68;
  font-size: 16px;
  line-height: 1.7;
}

.mi-dashboard-heading .btn {
  min-width: 190px;
  text-decoration: none;
}

.mi-dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.mi-dashboard-summary article {
  position: relative;
  min-width: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #ded1ba;
  border-radius: 13px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 18px rgba(60, 46, 25, .06);
}

.mi-dashboard-summary article::after {
  content: "";
  position: absolute;
  inset: auto -22px -30px auto;
  width: 76px;
  height: 76px;
  border: 13px solid rgba(171, 127, 46, .08);
  border-radius: 50%;
}

.mi-dashboard-summary span,
.mi-dashboard-summary small {
  display: block;
  color: #64726d;
  font-size: 13px;
  font-weight: 700;
}

.mi-dashboard-summary strong {
  display: inline-block;
  margin: 8px 5px 2px 0;
  color: #8f3027;
  font-family: Tahoma, sans-serif;
  font-size: 36px;
  line-height: 1;
}

.mi-dashboard-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: end;
  padding: 18px;
  border: 1px solid #d7c6a6;
  border-radius: 14px;
  background: rgba(255, 252, 244, .92);
}

.mi-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mi-filter {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #d1c3a7;
  border-radius: 9px;
  color: #29475a;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, color .18s ease, border-color .18s ease, background .18s ease;
}

.mi-filter b {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 5px;
  border-radius: 999px;
  color: inherit;
  background: rgba(23, 56, 79, .08);
  font-family: Tahoma, sans-serif;
  font-size: 11px;
}

.mi-filter:hover,
.mi-filter:focus-visible {
  transform: translateY(-2px);
  border-color: #a67b31;
}

.mi-filter.is-active {
  border-color: #8f3027;
  color: #fff;
  background: #8f3027;
  box-shadow: 0 8px 16px rgba(143, 48, 39, .18);
}

.mi-filter.is-active b {
  background: rgba(255, 255, 255, .18);
}

.mi-search-field {
  display: grid;
  gap: 6px;
  color: #29475a;
  font-size: 13px;
  font-weight: 800;
}

.mi-search-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #cdbd9d;
  border-radius: 9px;
  color: #17384f;
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}

.mi-results-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 20px 2px 12px;
  color: #66736e;
  font-size: 14px;
}

.mi-results-bar strong {
  color: #8f3027;
  font-size: 16px;
}

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

.mi-work-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 196px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #ddd1bc;
  border-left: 5px solid #1f6d67;
  border-radius: 12px;
  color: #17384f;
  text-decoration: none;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 8px 20px rgba(49, 39, 24, .07);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.mi-work-cover {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  margin: -18px -18px 16px;
  overflow: hidden;
  border-bottom: 1px solid #ded1bc;
  background:
    radial-gradient(circle at 50% 25%, rgba(202, 166, 83, .22), transparent 42%),
    linear-gradient(145deg, #f5ead4, #e4d4b6);
}

.mi-work-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity .3s ease, transform .35s ease;
}

.mi-work-cover.is-loaded img {
  opacity: 1;
}

.mi-work-card:hover .mi-work-cover img,
.mi-work-card:focus-visible .mi-work-cover img {
  transform: scale(1.045);
}

.mi-work-cover-label {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  color: #fff;
  background: rgba(14, 47, 66, .84);
  box-shadow: 0 4px 12px rgba(9, 33, 47, .18);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(5px);
}

.mi-work-cover-fallback {
  position: absolute;
  z-index: 1;
  color: #765f34;
  font-size: 14px;
  font-weight: 800;
}

.mi-work-cover.is-loaded .mi-work-cover-fallback {
  display: none;
}

.mi-work-card.is-excellent {
  border-left-color: #b0822e;
}

.mi-work-card.is-administrator {
  border-left-color: #78415e;
}

.mi-work-card.is-resource {
  border-left-color: #1d6075;
  background: linear-gradient(145deg, #fff, #eff7f8);
}

.mi-work-card:hover,
.mi-work-card:focus-visible {
  transform: translateY(-4px);
  border-color: #b68b32;
  box-shadow: 0 15px 28px rgba(53, 39, 20, .14);
}

.mi-work-index {
  position: absolute;
  top: 13px;
  right: 14px;
  color: #a1937a;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.mi-work-type {
  width: fit-content;
  max-width: calc(100% - 42px);
  padding: 4px 9px;
  border-radius: 999px;
  color: #1f5f59;
  background: #dcefeb;
  font-size: 12px;
  font-weight: 800;
}

.mi-work-card.is-excellent .mi-work-type {
  color: #715316;
  background: #f5e5b8;
}

.mi-work-card.is-administrator .mi-work-type {
  color: #6a2f4b;
  background: #f0dce7;
}

.mi-work-card.is-resource .mi-work-type {
  color: #174f67;
  background: #dcecf2;
}

.mi-work-card > strong {
  align-self: start;
  margin: 14px 0;
  padding-right: 4px;
  color: #17384f;
  font-size: 17px;
  line-height: 1.55;
}

.mi-work-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #e3dac8;
}

.mi-work-meta i {
  color: #68736d;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.mi-work-meta b {
  color: #8f3027;
  font-size: 13px;
}

.mi-empty-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 6px;
  margin-top: 12px;
  border: 1px dashed #cbb992;
  border-radius: 12px;
  color: #6b756f;
  text-align: center;
  background: rgba(255, 255, 255, .58);
}

.mi-empty-state strong {
  color: #17384f;
  font-size: 19px;
}

.obec-year-panel {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid #d8c59f;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 254, 249, .98), rgba(246, 236, 213, .94));
  box-shadow: 0 12px 28px rgba(57, 42, 20, .08);
}

.obec-year-panel[hidden] {
  display: none !important;
}

.obec-year-heading {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid #dfd0b4;
}

.obec-year-heading span {
  color: #96352b;
  font-size: 13px;
  font-weight: 800;
}

.obec-year-heading h4 {
  margin: 4px 0 0;
  color: #17384f;
  font-size: 24px;
}

.obec-year-heading p {
  max-width: 540px;
  margin: 0;
  color: #5e655f;
  font-size: 14px;
  line-height: 1.65;
  text-align: right;
}

.obec-year-heading p strong {
  color: #27634f;
}

.obec-year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.obec-year-card {
  position: relative;
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 20px;
  border: 1px solid #ded2bd;
  border-top: 4px solid #1c6175;
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
}

.obec-year-index {
  color: #9a3429;
  font-size: 12px;
  font-weight: 800;
}

.obec-year-card > strong {
  color: #17384f;
  font-size: 20px;
}

.obec-year-card p {
  min-height: 48px;
  margin: 0;
  color: #68736d;
  font-size: 14px;
  line-height: 1.65;
}

.obec-year-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.obec-year-actions a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid #cbbd9f;
  border-radius: 9px;
  color: #17455c;
  text-decoration: none;
  background: #fffdf8;
  font-size: 13px;
  font-weight: 800;
}

.obec-year-actions a:first-child,
.obec-year-actions a.is-active {
  border-color: #9b352b;
  color: #fff;
  background: #9b352b;
}

.obec-year-actions a:hover,
.obec-year-actions a:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(53, 39, 20, .12);
}

.innovation-dashboard-card-copy {
  display: grid;
  align-content: start;
  gap: 7px;
}

.innovation-dashboard-card-copy strong {
  color: #17384f;
  font-size: 17px;
  line-height: 1.45;
}

.innovation-dashboard-card-copy small {
  color: #6f746f;
  font-size: 14px;
  line-height: 1.55;
}

.innovation-dashboard-open {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid #e3dac8;
  color: #8e3026;
  font-size: 13px;
  font-weight: 800;
}

.innovation-dashboard-open i {
  font-family: Tahoma, sans-serif;
  font-size: 18px;
  font-style: normal;
}

.innovation-results-heading {
  margin: 32px 0 17px;
  padding: 19px 22px;
  border-left: 5px solid #9a3429;
  border-radius: 0 12px 12px 0;
  background: #f4ead4;
}

.innovation-results-heading span {
  color: #9a3429;
  font-size: 13px;
  font-weight: 800;
}

.innovation-results-heading h3 {
  margin: 3px 0 0;
  color: #17384f;
  font-size: 24px;
}

.innovation-dashboard-mode:not(.has-innovation-results) > .section-heading {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .innovation-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mi-work-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .library-section.innovation-dashboard-mode {
    padding: 22px;
  }

  .innovation-dashboard-hero {
    grid-template-columns: 1fr;
    padding: 26px;
  }

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

  .mi-dashboard-heading,
  .mi-dashboard-controls {
    grid-template-columns: 1fr;
  }

  .mi-dashboard-heading .btn {
    width: fit-content;
  }

  .mi-dashboard-summary,
  .mi-work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .obec-year-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .obec-year-heading p {
    text-align: left;
  }

  .obec-year-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .library-section.innovation-dashboard-mode {
    padding: 18px 14px;
    border-radius: 14px;
  }

  .innovation-dashboard-hero {
    padding: 22px 18px;
  }

  .innovation-dashboard-copy h3 {
    font-size: 27px;
  }

  .innovation-dashboard-stats,
  .innovation-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mi-dashboard-panel {
    padding: 18px 14px;
  }

  .mi-dashboard-panel.mi-dashboard-standalone {
    margin: 26px 0 40px;
    padding: 22px 15px;
    scroll-margin-top: 92px;
  }

  .mi-dashboard-heading h4 {
    font-size: 27px;
  }

  .mi-dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mi-dashboard-summary article {
    padding: 14px;
  }

  .mi-dashboard-summary strong {
    font-size: 30px;
  }

  .mi-dashboard-controls {
    padding: 14px;
  }

  .mi-filter {
    flex: 1 1 140px;
  }

  .mi-work-grid {
    grid-template-columns: 1fr;
  }

  .mi-work-card {
    min-height: 184px;
  }

  .innovation-dashboard-stats article {
    min-height: 96px;
  }

  .innovation-dashboard-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .innovation-dashboard-card {
    min-height: 224px;
  }

  .obec-year-panel {
    padding: 18px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .innovation-dashboard-card {
    transition: none;
  }
}

html {
  scroll-padding-top: 108px;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-family: Tahoma, "Leelawadee UI", "Noto Sans Thai", sans-serif;
  letter-spacing: 0;
}

a {
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid rgba(214, 168, 47, .75);
  outline-offset: 3px;
}

.site-shell,
.topbar-inner,
.hero-inner,
.public-content {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.agency-strip {
  color: #d9e7f5;
  background: #082642;
  font-size: 12px;
  letter-spacing: .02em;
}

.agency-strip-inner {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.agency-strip-meta {
  color: #aebfd0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  color: var(--ink);
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid rgba(11, 47, 91, .12);
  box-shadow: 0 8px 28px rgba(11, 47, 91, .06);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  min-height: 80px;
  padding: 9px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(214, 168, 47, .72);
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px rgba(214, 168, 47, .72);
  font-size: 9px;
  line-height: 1.1;
}

.brand-logo span,
.brand-logo strong {
  display: block;
}

.brand-logo strong {
  margin-top: 2px;
  color: #f4d77d;
  font-size: 12px;
}

.brand-title {
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.main-nav a {
  position: relative;
  padding: 12px 11px;
  color: #31465a;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .22s ease;
}

.main-nav a:hover {
  color: var(--navy);
  background: #f5f8fb;
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-label {
  display: none;
}

.btn {
  min-height: 40px;
  border-radius: 9px;
  font-weight: 700;
  box-shadow: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

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

.btn-primary,
.btn-navy {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.btn-primary:hover,
.btn-navy:hover {
  background: #061f3c;
  box-shadow: 0 8px 20px rgba(11, 47, 91, .18);
}

.btn-gold {
  color: #1e2d3b;
  background: #e2b842;
  border-color: #e2b842;
}

.btn-gold:hover {
  background: #f0c956;
  box-shadow: 0 8px 22px rgba(214, 168, 47, .24);
}

.btn-outline-light {
  color: var(--navy);
  background: transparent;
  border: 1px solid rgba(11, 47, 91, .35);
}

.hero .btn-outline-light {
  color: #fff;
  border-color: rgba(255, 255, 255, .65);
}

.hero .btn-outline-light:hover {
  background: rgba(255, 255, 255, .12);
}

.btn-large {
  min-height: 48px;
  padding: 0 20px;
}

.hero {
  position: relative;
  min-height: 535px;
  overflow: hidden;
  color: #fff;
  background: #08294e;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 25, 49, .98) 0%, rgba(6, 36, 69, .93) 36%, rgba(7, 41, 77, .48) 66%, rgba(7, 41, 77, .12) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: -8vw;
  right: -8vw;
  bottom: -105px;
  height: 150px;
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
  background: var(--bg);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    url("hero-media-library.webp") center right / cover no-repeat;
  transform: scale(1.015);
  animation: hero-settle 1.2s cubic-bezier(.2, .7, .2, 1) both;
}

.hero-inner {
  position: relative;
  z-index: 3;
  min-height: 535px;
  display: flex;
  align-items: center;
  padding: 58px 0 92px;
}

.hero-copy {
  width: min(700px, 66%);
}

.eyebrow,
.section-kicker {
  color: #f1cf6b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 710px;
  margin: 16px 0;
  font-size: clamp(38px, 5vw, 65px);
  line-height: 1.13;
  letter-spacing: -.035em;
  text-shadow: 0 3px 28px rgba(0, 0, 0, .28);
}

.hero h1 span {
  color: #f1cf6b;
}

.hero p {
  max-width: 660px;
  margin: 0;
  color: #e4edf6;
  font-size: 17px;
  line-height: 1.8;
}

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

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 28px;
  color: #d5e1ed;
  font-size: 12px;
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-trust span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e2b842;
  box-shadow: 0 0 0 3px rgba(226, 184, 66, .18);
}

.public-content {
  padding: 0 0 72px;
}

.notice-ticker {
  position: relative;
  z-index: 5;
  min-height: 66px;
  margin-top: -34px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  border: 1px solid rgba(11, 47, 91, .1);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.notice-label {
  padding: 6px 10px;
  color: #fff;
  border-radius: 6px;
  background: var(--navy);
  font-size: 11px;
  font-weight: 800;
}

.notice-ticker .announcement {
  padding: 0;
  color: #243b51;
  background: none;
  border: 0;
  font-weight: 600;
}

.notice-ticker > a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stats-grid {
  margin: 28px 0 60px;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stat-card {
  position: relative;
  min-height: 114px;
  padding: 22px 20px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.stat-card::before {
  content: "";
  position: absolute;
  width: 52px;
  height: 3px;
  left: 20px;
  bottom: 0;
  background: var(--gold);
}

.stat-card > div:first-child {
  display: none;
}

.stat-value {
  color: var(--navy);
  font-size: 29px;
  line-height: 1.1;
  font-weight: 800;
}

.stat-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.library-section,
.news-section {
  padding: 34px 0 30px;
  scroll-margin-top: 105px;
}

.section-kicker {
  color: var(--gold-deep);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 8px 0 22px;
}

.section-heading h2,
.about-section h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.3;
  letter-spacing: -.02em;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.result-summary {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.search-panel {
  margin-bottom: 26px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(11, 47, 91, .05);
}

.search-primary label,
.filters label {
  display: grid;
  gap: 7px;
  color: #4f6376;
  font-size: 11px;
  font-weight: 700;
}

.search-field {
  position: relative;
}

.search-field span {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  color: var(--navy);
  font-size: 27px;
  line-height: 1;
  transform: translateY(-54%);
}

.search-field .input {
  height: 52px;
  padding-left: 49px;
  font-size: 15px;
}

.filters {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid #cfd9e2;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.input,
.select {
  min-height: 42px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, .12);
}

.media-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.media-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(11, 47, 91, .06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.media-card:hover {
  transform: translateY(-4px);
  border-color: rgba(23, 105, 170, .35);
  box-shadow: 0 18px 42px rgba(11, 47, 91, .13);
}

.thumb {
  aspect-ratio: 16 / 9;
  height: auto;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, #e7eff7, #f7f9fb);
}

.thumb img {
  transition: transform .35s ease;
}

.media-card:hover .thumb img {
  transform: scale(1.035);
}

.featured-badge {
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  color: #2c3641;
  background: #efd070;
  border-radius: 6px;
  font-size: 10px;
}

.card-body {
  padding: 18px 18px 14px;
}

.pill {
  color: #345675;
  border: 1px solid #d7e4ef;
  background: #f3f8fc;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.media-title {
  margin: 13px 0 8px;
  min-height: 50px;
  color: var(--navy);
  font-size: 17px;
  line-height: 1.48;
}

.media-desc {
  min-height: 58px;
  color: #5a6d7e;
  font-size: 12px;
  line-height: 1.65;
}

.media-owner {
  color: #67798a;
  font-size: 11px;
  line-height: 1.55;
}

.card-footer {
  padding: 13px 18px 17px;
  border-top: 1px solid #edf1f4;
}

.metrics {
  color: #718292;
  font-size: 11px;
}

.pagination {
  margin-top: 26px;
}

.news-section {
  margin-top: 48px;
  padding-top: 52px;
  border-top: 1px solid var(--line);
}

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

.announcement-card {
  position: relative;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.announcement-card.pinned {
  border-left: 4px solid var(--gold);
}

.announcement-badge,
.ad-label {
  display: inline-flex;
  padding: 4px 7px;
  color: var(--navy);
  border-radius: 4px;
  background: var(--gold-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}

.announcement-card h3 {
  margin: 10px 0 7px;
  color: var(--navy);
  font-size: 16px;
}

.announcement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.announcement-card a {
  display: inline-block;
  margin-top: 12px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

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

.ad-region:empty {
  display: none;
}

.ad-card {
  position: relative;
  min-height: 150px;
  display: flex;
  overflow: hidden;
  border: 1px solid #d5dde5;
  border-radius: 12px;
  color: #fff;
  background: var(--navy);
}

.ad-card-image {
  width: 42%;
  flex: 0 0 42%;
  object-fit: cover;
}

.ad-card-body {
  padding: 18px;
  align-self: center;
}

.ad-card h3 {
  margin: 8px 0 5px;
  font-size: 17px;
}

.ad-card p {
  margin: 0;
  color: #dce7f2;
  font-size: 11px;
}

.ad-card a {
  display: inline-block;
  margin-top: 10px;
  color: #f1cf6b;
  font-size: 11px;
  font-weight: 700;
}

.about-section {
  margin-top: 55px;
  padding: 38px 40px;
  display: grid;
  grid-template-columns: 1fr 1.25fr auto;
  align-items: center;
  gap: 32px;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(110deg, #082846, #0b3c70);
}

.about-section h2 {
  color: #fff;
  font-size: 27px;
}

.about-section p {
  margin: 0;
  color: #d7e4f0;
  font-size: 13px;
  line-height: 1.8;
}

.site-footer {
  color: #d7e3ee;
  background: #071f37;
}

.footer-grid {
  padding: 45px 0 36px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 40px;
}

.footer-brand {
  color: #fff;
  font-weight: 800;
}

.site-footer p {
  color: #9fb2c4;
  font-size: 12px;
}

.site-footer strong {
  display: block;
  margin-bottom: 10px;
  color: #f2d47b;
  font-size: 12px;
}

.site-footer a,
.site-footer button {
  display: block;
  margin: 7px 0;
  padding: 0;
  border: 0;
  color: #c0cedb;
  background: none;
  font-size: 11px;
  text-decoration: none;
}

.footer-bottom {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: #92a6b8;
  font-size: 10px;
}

/* Admin */
#adminApp {
  min-height: 100vh;
  color: var(--ink);
  background: #eef2f6;
}

.admin-top {
  color: #fff;
  background: #082846;
  border-bottom: 3px solid var(--gold);
}

.admin-top-inner {
  width: min(1420px, calc(100% - 32px));
  min-height: 72px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand > div {
  display: grid;
}

.admin-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #d8b24b;
  border-radius: 50%;
  color: #f0d171;
  font-size: 10px;
  font-weight: 800;
}

.admin-brand #adminIdentity {
  margin-top: 2px;
  color: #b8c9d9;
}

.admin-container {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 45px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.admin-nav {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-nav .btn {
  width: 100%;
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 13px;
  border-color: transparent;
  text-align: left;
}

.admin-tab {
  grid-column: 2;
  min-width: 0;
}

.admin-nav + .admin-tab,
.admin-tab.active {
  display: block;
}

.admin-container > .admin-tab:not(.active) {
  display: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(11, 47, 91, .05);
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(360px, .8fr) minmax(440px, 1.2fr);
  align-items: start;
  gap: 16px;
}

.admin-stats {
  grid-template-columns: repeat(4, 1fr);
}

.section-title {
  gap: 14px;
}

.section-title h3 {
  color: var(--navy);
}

table {
  font-size: 12px;
}

th {
  color: #34516c;
  background: #eff4f8;
}

td,
th {
  border-bottom-color: #e6ebef;
}

.ai-notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  display: grid;
  gap: 3px;
  border-left: 4px solid var(--gold);
  border-radius: 9px;
  color: #5e4a12;
  background: #fff9e9;
  font-size: 12px;
}

.ai-brief {
  min-height: 180px;
}

.ai-result {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #cfdce8;
  border-radius: 10px;
  background: #f8fbfd;
}

.ai-result h4 {
  margin: 0 0 12px;
  color: var(--navy);
}

.ai-result-section {
  margin: 14px 0;
}

.ai-result-section strong {
  display: block;
  margin-bottom: 4px;
  color: #38536c;
  font-size: 11px;
}

.modal {
  z-index: 200;
  background: rgba(5, 23, 41, .68);
  backdrop-filter: blur(4px);
}

.modal-card {
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .25);
}

.modal-head {
  color: var(--navy);
  background: #f5f8fa;
}

/* Search-indexable media detail page */
.media-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #edf3f8 0, #f7f9fb 340px, #f7f9fb 100%);
}

.detail-site-header {
  color: #fff;
  background: #082846;
  border-bottom: 3px solid var(--gold);
}

.detail-site-header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.detail-site-header .brand-title {
  color: #fff;
}

.detail-site-header .brand-subtitle {
  color: #b9cada;
}

.detail-site-header .btn-outline-light {
  color: #fff;
  border-color: rgba(255, 255, 255, .5);
}

.media-detail-main {
  padding-top: 30px;
  padding-bottom: 70px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
  color: #61778a;
  font-size: 11px;
}

.breadcrumbs a {
  color: var(--blue);
}

.media-detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.media-detail-cover {
  width: 100%;
  max-height: 470px;
  display: block;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.media-detail-content {
  padding: clamp(24px, 5vw, 55px);
}

.media-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.media-detail-tags span {
  padding: 5px 9px;
  border: 1px solid #d5e1ec;
  border-radius: 5px;
  color: #365874;
  background: #f1f6fa;
  font-size: 10px;
  font-weight: 700;
}

.media-detail-content h1,
.media-not-found h1 {
  max-width: 900px;
  margin: 18px 0 8px;
  color: var(--navy);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.3;
  letter-spacing: -.03em;
}

.media-byline {
  color: #677b8e;
  font-size: 12px;
}

.media-detail-description {
  max-width: 900px;
  margin: 30px 0;
  color: #31485d;
  font-size: 16px;
  line-height: 1.95;
}

.media-detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 25px 0;
}

.media-detail-facts div {
  padding: 15px;
  border: 1px solid #e0e7ed;
  border-radius: 9px;
  background: #f8fafb;
}

.media-detail-facts dt {
  color: #718395;
  font-size: 10px;
}

.media-detail-facts dd {
  margin: 4px 0 0;
  color: #243e56;
  font-size: 13px;
  font-weight: 700;
}

.media-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 30px;
}

.media-not-found {
  padding: clamp(35px, 7vw, 80px);
  text-align: center;
}

.media-not-found .section-kicker {
  color: var(--gold-deep);
}

.media-not-found p {
  color: var(--muted);
}

.media-not-found .btn {
  margin-top: 20px;
}

.reveal {
  animation: reveal-up .65s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-settle {
  from { opacity: .55; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1.015); }
}

@media (max-width: 1080px) {
  .main-nav {
    display: none;
  }

  .hero-copy {
    width: min(760px, 82%);
  }

  .filters {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-section {
    grid-template-columns: 1fr 1.2fr;
  }

  .about-section .btn {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .admin-container {
    display: block;
  }

  .admin-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    margin-bottom: 16px;
  }

  .admin-nav .btn {
    width: auto;
    min-width: max-content;
  }

  .admin-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-shell,
  .topbar-inner,
  .hero-inner,
  .public-content {
    width: min(100% - 24px, 1180px);
  }

  .agency-strip-meta,
  .brand-subtitle {
    display: none;
  }

  .topbar-inner {
    width: min(100% - 32px, 1180px);
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }

  .brand {
    min-width: 0;
    overflow: hidden;
  }

  .brand > div:last-child {
    min-width: 0;
    overflow: hidden;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand-title {
    max-width: none;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-actions {
    width: 112px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .top-actions .btn {
    width: 100%;
    min-height: 32px;
    padding: 5px 6px;
    font-size: 10px;
    line-height: 1.15;
  }

  .top-actions #submitButton {
    display: none;
  }

  .top-actions .desktop-label {
    display: none;
  }

  .top-actions .mobile-label {
    display: inline;
  }

  .hero,
  .hero-inner {
    min-height: 590px;
  }

  .hero {
    padding: 0;
  }

  .hero-inner {
    padding: 46px 0 78px;
  }

  .hero::before {
    background: linear-gradient(90deg, rgba(4, 25, 49, .98), rgba(6, 36, 69, .87));
  }

  .hero-copy {
    width: 100%;
    padding-right: 14px;
  }

  .hero h1 {
    font-size: clamp(29px, 8.3vw, 34px);
    line-height: 1.18;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
  }

  .hero p {
    font-size: 14px;
    line-height: 1.75;
  }

  .hero-actions {
    width: 100%;
    max-width: 260px;
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .btn {
    width: 100%;
    white-space: normal;
  }

  .hero-trust {
    display: grid;
    gap: 11px;
    margin-top: 22px;
  }

  .notice-ticker {
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-top: -27px;
  }

  .notice-ticker > a {
    grid-column: 2;
  }

  .stats-grid,
  .media-grid,
  .announcement-list,
  .ad-region {
    grid-template-columns: 1fr;
  }

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

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

  .section-heading {
    display: block;
  }

  .result-summary {
    margin-top: 12px;
  }

  .about-section {
    padding: 28px 24px;
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .admin-container,
  .admin-top-inner {
    width: min(100% - 18px, 1420px);
  }

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

  .detail-site-header-inner {
    min-height: 70px;
  }

  .detail-site-header .btn {
    padding-inline: 10px;
    font-size: 10px;
  }

  .media-detail-facts {
    grid-template-columns: 1fr;
  }
}

.member-course-grid {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.member-course-card {
  display: grid;
  padding: 16px;
  border: 1px solid #d9cdb7;
  border-radius: 10px;
  gap: 10px;
  background: #fffdf8;
}

.member-course-card > div:first-child {
  display: grid;
  gap: 3px;
}

.member-course-card span {
  color: #9a372f;
  font-size: 9px;
  font-weight: 900;
}

.member-course-card strong {
  color: #173c4f;
  font-size: 13px;
}

.member-course-card small {
  color: #718087;
}

.member-course-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9dfcc;
}

.member-course-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #98372f, #d5ad43);
}

@media (max-width: 820px) {
  .member-course-grid {
    grid-template-columns: 1fr;
  }
}

/* Frontpage learning hub layout */
.hero,
.hero-inner {
  min-height: 610px;
}

.hero::before {
  background:
    linear-gradient(90deg, rgba(4, 28, 52, .98) 0%, rgba(7, 48, 82, .91) 44%, rgba(7, 48, 82, .48) 72%, rgba(7, 48, 82, .18) 100%);
}

.hero-inner {
  padding-block: 58px 104px;
}

.hero-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
  align-items: center;
  gap: clamp(36px, 6vw, 82px);
}

.hero-copy {
  width: auto;
}

.hero-copy p {
  max-width: 610px;
}

.hero-portal-card {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 18px;
  color: #102e49;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 26px 70px rgba(0, 18, 38, .30);
  backdrop-filter: blur(18px);
}

.portal-label {
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}

.hero-portal-card h2 {
  margin: 7px 0 2px;
  color: var(--navy);
  font-size: 26px;
}

.hero-portal-card > p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.hero-portal-card a {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  color: inherit;
  border-top: 1px solid #e2e9ef;
  text-decoration: none;
  transition: transform .18s ease, color .18s ease;
}

.hero-portal-card a:hover {
  color: var(--blue);
  transform: translateX(4px);
}

.portal-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--navy);
  font-size: 11px;
  font-weight: 900;
}

.hero-portal-card a:nth-of-type(2) .portal-icon {
  color: #3f300a;
  background: #edc75c;
}

.hero-portal-card a:nth-of-type(3) .portal-icon {
  background: #19806d;
}

.hero-portal-card strong,
.hero-portal-card small {
  display: block;
}

.hero-portal-card strong {
  font-size: 13px;
}

.hero-portal-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.innovation-portal {
  padding: 24px 22px 18px;
}

.innovation-portal > p {
  margin: 3px 0 10px;
  color: #52676f;
  font-size: 11px;
  line-height: 1.55;
}

.innovation-portal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 10px;
}

.innovation-portal-summary > div {
  min-width: 0;
  padding: 8px 5px 7px;
  border: 1px solid rgba(176, 130, 46, .28);
  border-radius: 10px;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 252, 244, .98), rgba(246, 236, 210, .78));
}

.innovation-portal-summary strong {
  color: #8f3027;
  font-family: Tahoma, sans-serif;
  font-size: 18px;
  line-height: 1;
}

.innovation-portal-summary span {
  display: block;
  margin-top: 4px;
  color: #52676f;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.3;
}

.hero-portal-card .innovation-site-entry {
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  margin: 1px 0 9px;
  padding: 9px 12px;
  color: #fff;
  background: linear-gradient(135deg, #173f50, #0c3041);
  border: 1px solid rgba(210, 174, 84, .75);
  border-radius: 11px;
  box-shadow: 0 7px 17px rgba(10, 42, 56, .17);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.hero-portal-card .innovation-site-entry:hover,
.hero-portal-card .innovation-site-entry:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #1d5064, #103a4d);
  box-shadow: 0 10px 22px rgba(10, 42, 56, .24);
  transform: translateY(-2px);
}

.innovation-site-entry span {
  min-width: 0;
  display: grid;
}

.innovation-site-entry strong {
  font-size: 11px;
  line-height: 1.35;
}

.innovation-site-entry small {
  margin-top: 2px;
  color: rgba(255, 255, 255, .72);
  font-size: 8.5px;
  line-height: 1.35;
}

.innovation-site-entry i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #3d3112;
  background: #e7c865;
  border-radius: 50%;
  font-size: 16px;
  font-style: normal;
  transition: transform .2s ease;
}

.innovation-site-entry:hover i {
  transform: translateX(3px);
}

.innovation-menu {
  display: grid;
}

.hero-portal-card .innovation-link {
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  min-height: 61px;
  padding: 9px 3px;
}

.hero-portal-card .innovation-link strong {
  font-size: 14px;
  line-height: 1.42;
}

.hero-portal-card .innovation-link small {
  font-size: 11px;
  line-height: 1.4;
}

.hero-portal-card .innovation-link.is-featured-dashboard {
  position: relative;
  min-height: 78px;
  margin: 3px 0 7px;
  padding: 11px 10px;
  overflow: hidden;
  border: 1px solid rgba(164, 119, 38, .38);
  border-radius: 13px;
  color: #17384f;
  background:
    radial-gradient(circle at 100% 0%, rgba(202, 166, 83, .23), transparent 48%),
    linear-gradient(135deg, #fffdf7, #f4ead4);
  box-shadow: 0 10px 22px rgba(72, 48, 19, .11);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.hero-portal-card .innovation-link.is-featured-dashboard::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(#8f3027, #d1ad55, #17384f);
}

.hero-portal-card .innovation-link.is-featured-dashboard .portal-icon {
  width: 42px;
  height: 42px;
  border: 1px solid #d7b75e;
  border-radius: 50% 50% 43% 43%;
  background: linear-gradient(145deg, #a43b31, #71251f);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .08), 0 7px 14px rgba(104, 39, 31, .16);
}

.hero-portal-card .innovation-link.is-featured-dashboard:hover,
.hero-portal-card .innovation-link.is-featured-dashboard:focus-visible {
  color: #17384f;
  border-color: #a9802f;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(72, 48, 19, .16);
}

.innovation-source-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: Tahoma, sans-serif;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.35;
}

.innovation-source-badge.is-external {
  color: #714f16;
  background: #f5df9d;
}

.innovation-source-badge.is-internal {
  color: #e9f7f5;
  background: #1f6d67;
}

.innovation-link > i {
  color: #9a7420;
  font-family: Tahoma, sans-serif;
  font-size: 24px;
  font-style: normal;
  transition: transform .2s ease, color .2s ease;
}

.innovation-link:hover > i,
.innovation-link:focus-visible > i {
  color: #8f3027;
  transform: translateX(3px);
}

.discovery-section,
.subject-section,
.stats-section,
.highlight-section {
  scroll-margin-top: 108px;
}

.discovery-section {
  margin: 34px 0 52px;
  padding: 30px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 2% 0%, rgba(42, 154, 184, .35), transparent 42%),
    linear-gradient(135deg, #092f50, #0c4a70);
  box-shadow: 0 20px 52px rgba(9, 47, 80, .18);
}

.discovery-heading h2 {
  margin: 7px 0 5px;
  color: #fff;
  font-size: 29px;
  line-height: 1.28;
}

.discovery-heading p {
  margin: 0;
  color: #c8ddeb;
  font-size: 12px;
  line-height: 1.7;
}

.discovery-section .search-panel {
  margin: 0;
  padding: 20px;
  box-shadow: 0 14px 38px rgba(0, 20, 40, .18);
}

.discovery-section .filters {
  grid-template-columns: repeat(5, minmax(110px, 1fr)) auto;
}

.search-actions {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.search-actions .btn {
  white-space: nowrap;
}

.subject-section {
  padding: 18px 0 54px;
}

.section-link,
.highlight-head > a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

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

.subject-card {
  position: relative;
  min-height: 235px;
  padding: 0 15px 17px;
  overflow: hidden;
  text-align: left;
  border: 1px solid #dce5ec;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 7px 22px rgba(11, 47, 91, .05);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.subject-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: #1675a5;
}

.subject-card:nth-child(2n)::after { background: #d6a82f; }
.subject-card:nth-child(3n)::after { background: #278368; }
.subject-card:nth-child(4n)::after { background: #a65776; }
.subject-card:nth-child(5n)::after { background: #7d64ad; }

.subject-card:hover {
  transform: translateY(-5px);
  border-color: rgba(23, 105, 170, .38);
  box-shadow: 0 18px 38px rgba(11, 47, 91, .12);
}

.subject-number {
  position: absolute;
  top: 10px;
  right: 11px;
  z-index: 2;
  min-width: 28px;
  padding: 4px 6px;
  text-align: center;
  border-radius: 99px;
  color: #63778a;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 4px 12px rgba(12, 44, 71, .08);
  font-size: 10px;
  font-weight: 900;
}

.subject-art {
  height: 135px;
  display: grid;
  place-items: center;
  margin: 0 -15px 14px;
  overflow: hidden;
  border-bottom: 1px solid #ece7dc;
  background: #fbf8f0;
}

.subject-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center 54%;
  transition: transform .28s ease;
}

.subject-card:hover .subject-art img {
  transform: scale(1.045);
}

.subject-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  margin: 20px 0 17px;
  border-radius: 13px;
  color: #fff;
  background: var(--navy);
  font-size: 21px;
  font-weight: 900;
}

.subject-card:nth-child(2n) .subject-icon { color: #443407; background: #edc75c; }
.subject-card:nth-child(3n) .subject-icon { background: #278368; }
.subject-card:nth-child(4n) .subject-icon { background: #a65776; }
.subject-card:nth-child(5n) .subject-icon { background: #7d64ad; }

.subject-card strong,
.subject-card > span:last-child {
  display: block;
}

.subject-card strong {
  min-height: 39px;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.5;
}

.subject-card > span:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.stats-section {
  margin: 0 0 58px;
  padding: 34px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(13, 69, 103, .96), rgba(7, 44, 75, .99)),
    url("hero-media-library.webp") center / cover;
}

.stats-intro h2 {
  margin: 8px 0 4px;
  color: #fff;
  font-size: 28px;
}

.stats-intro p {
  margin: 0;
  color: #c7dbe9;
  font-size: 12px;
  line-height: 1.7;
}

.stats-section .stats-grid {
  margin: 0;
  gap: 9px;
}

.stats-section .stat-card {
  min-height: 142px;
  padding: 20px 15px 17px;
  color: #fff;
  border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .09);
  backdrop-filter: blur(8px);
}

.stats-section .stat-card::before {
  left: 15px;
  width: 34px;
}

.stat-index {
  position: absolute;
  top: 10px;
  right: 12px;
  color: rgba(255, 255, 255, .42);
  font-size: 9px;
  font-weight: 900;
}

.stat-icon {
  display: block;
  margin-bottom: 12px;
  color: #f0cc68;
  font-size: 22px;
}

.stats-section .stat-value {
  color: #fff;
  font-size: 27px;
}

.stats-section .stat-label {
  color: #c8dae7;
  line-height: 1.45;
}

.highlight-section {
  margin-bottom: 58px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.highlight-column {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(11, 47, 91, .06);
}

.highlight-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.highlight-head h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font-size: 22px;
}

.highlight-list {
  border-top: 1px solid #e5ebf0;
}

.recommended-innovation-card {
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid #ddc88c;
  border-radius: 14px;
  background: linear-gradient(135deg, #fffaf0, #f5ead0);
  box-shadow: 0 10px 24px rgba(88, 61, 27, .08);
}

.recommended-innovation-card:hover,
.recommended-innovation-card:focus-visible {
  border-color: #b68a2f;
  box-shadow: 0 14px 30px rgba(88, 61, 27, .14);
}

.recommended-innovation-thumb {
  color: #fff;
  background: linear-gradient(145deg, #a33a30, #742720);
}

.recommended-innovation-thumb svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recommended-innovation-thumb b {
  color: #60400e;
  background: #f0cf69;
}

.highlight-card {
  min-height: 104px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  color: inherit;
  border-bottom: 1px solid #e5ebf0;
  text-decoration: none;
}

.highlight-card:hover h3 {
  color: var(--blue);
}

.highlight-thumb {
  position: relative;
  width: 92px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  color: var(--blue);
  background: #eaf2f8;
  font-size: 25px;
}

.highlight-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.highlight-thumb b {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 3px 5px;
  border-radius: 4px;
  color: #fff;
  background: rgba(8, 38, 66, .86);
  font-size: 8px;
}

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

.highlight-copy > span {
  color: var(--gold-deep);
  font-size: 9px;
  font-weight: 900;
}

.highlight-copy h3 {
  margin: 4px 0;
  overflow: hidden;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.45;
  transition: color .18s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.highlight-copy p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.highlight-arrow {
  color: #8fa2b1;
  font-size: 25px;
}

.highlight-empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 30px;
  }

  .hero h1 {
    font-size: clamp(36px, 5.5vw, 54px);
  }

  .discovery-section,
  .stats-section {
    grid-template-columns: 1fr;
  }

  .discovery-section .filters {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 760px) {
  .hero,
  .hero-inner {
    min-height: 590px;
  }

  .hero-inner {
    padding: 44px 0 82px;
  }

  .hero-layout {
    display: block;
  }

  .hero-portal-card {
    display: none;
  }

  .hero-portal-card.innovation-portal {
    display: block;
    margin-top: 28px;
  }

  .discovery-section {
    margin: 24px 0 36px;
    padding: 20px 16px;
    gap: 16px;
    border-radius: 14px;
  }

  .discovery-heading h2 {
    font-size: 24px;
  }

  .discovery-section .search-panel {
    padding: 14px;
  }

  .discovery-section .filters {
    grid-template-columns: 1fr;
  }

  .search-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .subject-section {
    padding-bottom: 40px;
  }

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

  .subject-card {
    min-height: 205px;
    padding: 0 12px 14px;
  }

  .subject-art {
    height: 112px;
    margin: 0 -12px 12px;
  }

  .subject-icon {
    width: 41px;
    height: 41px;
    margin-bottom: 12px;
  }

  .stats-section {
    padding: 24px 16px;
    gap: 20px;
  }

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

  .stats-section .stat-card {
    min-height: 126px;
  }

  .stats-section .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .highlight-section {
    grid-template-columns: 1fr;
  }

  .highlight-column {
    padding: 20px 15px;
  }

  .highlight-head h2 {
    font-size: 19px;
  }

  .highlight-card {
    grid-template-columns: 76px minmax(0, 1fr) 14px;
    gap: 10px;
  }

  .highlight-thumb {
    width: 76px;
  }
}

.announcement-popup {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: none;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(4, 17, 30, .78);
  backdrop-filter: blur(6px);
}

.announcement-popup.show {
  display: grid;
  animation: announcement-backdrop-in .22s ease both;
}

.announcement-popup-card {
  position: relative;
  width: min(960px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(390px, 1.1fr);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 36px 110px rgba(0, 13, 28, .48);
  animation: announcement-card-in .32s cubic-bezier(.2, .8, .2, 1) both;
}

.announcement-popup-close {
  position: absolute;
  z-index: 3;
  top: -19px;
  right: -19px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--navy);
  border: 1px solid #d5e0e8;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 9px 25px rgba(7, 38, 65, .24);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.announcement-popup-close:hover {
  color: #fff;
  background: var(--navy);
}

.announcement-popup-visual {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: 21px 0 0 21px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 14%, rgba(72, 205, 255, .56), transparent 24%),
    radial-gradient(circle at 20% 80%, rgba(242, 189, 51, .30), transparent 32%),
    linear-gradient(145deg, #063361 0%, #07558c 52%, #0887b0 100%);
}

.announcement-popup-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .30;
  background-image:
    linear-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: perspective(500px) rotateX(56deg) scale(1.7) translateY(25%);
  transform-origin: bottom;
}

.announcement-popup-visual::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -96px;
  bottom: -96px;
  border: 34px solid rgba(255, 255, 255, .10);
  border-radius: 50%;
}

.announcement-popup-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
}

.orbit-one {
  width: 300px;
  height: 300px;
  top: 88px;
  right: -120px;
}

.orbit-two {
  width: 210px;
  height: 210px;
  top: 132px;
  right: -74px;
}

.announcement-popup-seal {
  position: absolute;
  z-index: 1;
  top: 30px;
  left: 30px;
  width: 70px;
  height: 70px;
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(241, 207, 107, .8);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .16);
  font-size: 10px;
  line-height: 1.15;
}

.announcement-popup-seal strong {
  display: block;
  color: #f1cf6b;
  font-size: 15px;
}

.announcement-popup-megaphone {
  position: absolute;
  z-index: 1;
  top: 128px;
  left: 38px;
  color: #f3cc59;
  font-family: Arial, sans-serif;
  font-size: 66px;
  font-weight: 900;
  letter-spacing: -.1em;
  text-shadow: 0 8px 30px rgba(0, 15, 32, .32);
  transform: rotate(-8deg);
}

.announcement-popup-visual-copy {
  position: absolute;
  z-index: 1;
  left: 32px;
  right: 32px;
  bottom: 40px;
}

.announcement-popup-visual-copy span {
  display: block;
  margin-bottom: 9px;
  color: #f1cf6b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}

.announcement-popup-visual-copy strong {
  display: block;
  font-size: clamp(34px, 4vw, 49px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.announcement-popup-visual-copy small {
  display: block;
  margin-top: 14px;
  color: #d6e8f4;
  font-size: 13px;
}

.announcement-popup-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 48px 42px;
}

.announcement-popup-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}

.announcement-popup-meta span {
  padding: 5px 9px;
  color: #fff;
  border-radius: 6px;
  background: var(--navy);
  font-weight: 800;
}

.announcement-popup-body h2 {
  margin: 0 0 15px;
  color: var(--navy);
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.34;
  letter-spacing: -.02em;
}

.announcement-popup-body > p {
  max-height: 176px;
  margin: 0;
  overflow-y: auto;
  color: #4b6173;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
}

.announcement-popup-today {
  margin-top: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #dce5ec;
  border-radius: 11px;
  background: #f6f9fb;
  cursor: pointer;
}

.announcement-popup-today input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--navy);
}

.announcement-popup-today strong,
.announcement-popup-today small {
  display: block;
}

.announcement-popup-today strong {
  color: var(--navy);
  font-size: 12px;
}

.announcement-popup-today small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.announcement-popup-actions {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}

body.announcement-popup-open {
  overflow: hidden;
}

@keyframes announcement-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes announcement-card-in {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .announcement-popup {
    align-items: start;
    padding: 30px 12px 20px;
  }

  .announcement-popup-card {
    width: min(100%, 520px);
    min-height: 0;
    grid-template-columns: 1fr;
    border-radius: 17px;
  }

  .announcement-popup-close {
    top: -15px;
    right: -2px;
    width: 42px;
    height: 42px;
    font-size: 28px;
  }

  .announcement-popup-visual {
    min-height: 215px;
    border-radius: 16px 16px 0 0;
  }

  .announcement-popup-seal {
    top: 20px;
    left: 20px;
    width: 57px;
    height: 57px;
  }

  .announcement-popup-megaphone {
    top: 74px;
    left: 22px;
    font-size: 48px;
  }

  .announcement-popup-visual-copy {
    left: 20px;
    right: 20px;
    bottom: 22px;
  }

  .announcement-popup-visual-copy span,
  .announcement-popup-visual-copy small {
    display: none;
  }

  .announcement-popup-visual-copy strong {
    text-align: right;
    font-size: 28px;
  }

  .announcement-popup-body {
    padding: 26px 20px 22px;
  }

  .announcement-popup-body h2 {
    font-size: 24px;
  }

  .announcement-popup-body > p {
    max-height: 138px;
    font-size: 13px;
  }

.announcement-popup-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Member access — separate login and registration experiences */
.auth-guest[hidden],
.auth-view[hidden],
#accountDashboard[hidden] {
  display: none !important;
}

.account-modal {
  padding: 24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(126, 82, 255, .3), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(255, 117, 112, .28), transparent 34%),
    rgba(3, 17, 34, .78);
  backdrop-filter: blur(12px);
}

.account-modal .auth-shell {
  width: min(1180px, 100%);
  max-height: min(92vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 28px;
  background: #f7f8fc;
  box-shadow:
    0 40px 100px rgba(2, 15, 31, .42),
    0 0 0 1px rgba(9, 43, 78, .06);
}

.account-modal .auth-shell-head {
  position: relative;
  min-height: 76px;
  padding: 14px 22px;
  border-bottom: 1px solid #e4e8ef;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #0a2846;
}

.auth-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.auth-brand strong {
  font-size: 15px;
  line-height: 1.25;
}

.auth-brand small {
  color: #6d7e91;
  font-size: 10px;
}

.auth-brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #153d7a, #7552d8 56%, #ff786f);
  box-shadow: 0 9px 24px rgba(67, 64, 171, .25);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.account-modal .auth-close {
  width: 44px;
  height: 44px;
  color: #19344d;
  background: #eef2f6;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.account-modal .auth-close:hover {
  transform: rotate(6deg);
  background: #e2e8ef;
}

.account-modal-body {
  padding: 0;
}

.auth-guest,
.auth-view {
  min-height: min(720px, calc(92vh - 76px));
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  background: #f7f8fc;
  animation: authViewIn .34s cubic-bezier(.2, .7, .25, 1);
}

.auth-register-view {
  grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr);
}

@keyframes authViewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-form-pane {
  display: grid;
  align-items: center;
  padding: 54px clamp(34px, 5vw, 72px);
  background:
    linear-gradient(rgba(255, 255, 255, .78), rgba(255, 255, 255, .78)),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(25, 52, 77, .035) 32px),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(25, 52, 77, .035) 32px);
}

.auth-form-wrap {
  width: min(430px, 100%);
  margin: auto;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #6953c7;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .17em;
}

.auth-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, #7552d8, #ff786f);
}

.auth-form-pane h2 {
  margin: 0;
  color: #0b2945;
  font-size: clamp(30px, 3vw, 43px);
  line-height: 1.12;
  letter-spacing: -.035em;
}

.auth-lead,
.auth-register-heading p {
  margin: 14px 0 28px;
  color: #68798c;
  font-size: 13px;
  line-height: 1.75;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-field {
  gap: 8px;
}

.auth-field label,
.auth-register-form .field label {
  color: #173650;
  font-size: 12px;
  font-weight: 800;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap > span {
  position: absolute;
  left: 17px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: #8493a2;
  font-size: 12px;
}

.auth-input-wrap .input {
  min-height: 54px;
  padding-left: 44px;
  border-color: #d8dfe8;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(19, 47, 75, .045);
}

.auth-input-wrap .input:focus {
  border-color: #7357d5;
  box-shadow: 0 0 0 4px rgba(115, 87, 213, .1);
}

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: -2px;
}

.auth-security-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #748496;
  font-size: 10px;
}

.auth-security-note::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28a46b;
  box-shadow: 0 0 0 4px rgba(40, 164, 107, .1);
}

.auth-text-button,
.auth-back-button,
.auth-switch button {
  border: 0;
  padding: 0;
  color: #5d49bc;
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-text-button:hover,
.auth-back-button:hover,
.auth-switch button:hover {
  color: #e05c67;
  text-decoration: underline;
}

.auth-primary-action {
  min-height: 54px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(100deg, #694fd0 0%, #8c57c3 35%, #f36d79 100%);
  box-shadow: 0 15px 28px rgba(167, 76, 154, .25);
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease;
}

.auth-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 34px rgba(167, 76, 154, .32);
}

.auth-primary-action span {
  font-size: 19px;
  transition: transform .18s ease;
}

.auth-primary-action:hover span {
  transform: translateX(4px);
}

.auth-switch {
  margin-top: 25px;
  padding-top: 21px;
  display: flex;
  justify-content: center;
  gap: 7px;
  border-top: 1px solid #e1e6ed;
  color: #718194;
  font-size: 12px;
}

.auth-story {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin: 18px 18px 18px 0;
  padding: clamp(42px, 5vw, 68px);
  border-radius: 29px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 82%, rgba(68, 109, 255, .75), transparent 34%),
    radial-gradient(circle at 15% 12%, rgba(232, 89, 155, .54), transparent 40%),
    linear-gradient(145deg, #0f0714 0%, #190a18 36%, #071a3a 100%);
}

.auth-story::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .28;
  background-image:
    linear-gradient(rgba(255, 255, 255, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .11) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

.auth-story::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -112px;
  z-index: -1;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(174, 183, 255, .42);
  transform: rotate(18deg);
  background:
    repeating-conic-gradient(from 0deg, rgba(142, 157, 255, .58) 0 1deg, transparent 1deg 13deg);
  clip-path: polygon(50% 0, 61% 38%, 100% 21%, 69% 50%, 100% 79%, 61% 62%, 50% 100%, 39% 62%, 0 79%, 31% 50%, 0 21%, 39% 38%);
}

.auth-story-content {
  position: relative;
  z-index: 2;
  max-width: 490px;
}

.auth-story-kicker {
  display: inline-block;
  margin-bottom: 30px;
  color: #ff9695;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}

.auth-story h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.13;
  letter-spacing: -.045em;
}

.auth-story p {
  max-width: 450px;
  margin: 22px 0 25px;
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  line-height: 1.75;
}

.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-benefits span {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 99px;
  color: rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .07);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 800;
}

.auth-story blockquote {
  margin: 35px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
  line-height: 1.8;
}

.auth-story-card {
  position: absolute;
  right: 30px;
  bottom: 28px;
  z-index: 3;
  width: min(280px, calc(100% - 60px));
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 20px 20px 20px 6px;
  color: #19324c;
  background: rgba(255, 255, 255, .89);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
  backdrop-filter: blur(14px);
}

.auth-story-card strong {
  font-size: 14px;
}

.auth-story-card span {
  color: #68788b;
  font-size: 10px;
}

.auth-story-orb {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
}

.auth-story-orb-one {
  top: -75px;
  right: -45px;
  width: 220px;
  height: 220px;
  background: rgba(255, 107, 119, .19);
}

.auth-story-orb-two {
  left: -50px;
  bottom: 40px;
  width: 170px;
  height: 170px;
  background: rgba(110, 79, 208, .3);
}

.auth-register-story {
  margin: 18px 0 18px 18px;
  background:
    radial-gradient(circle at 65% 90%, rgba(81, 119, 255, .62), transparent 35%),
    radial-gradient(circle at 15% 12%, rgba(245, 101, 140, .48), transparent 42%),
    linear-gradient(145deg, #100815 0%, #151032 46%, #071b3e 100%);
}

.auth-register-story h3 {
  font-size: clamp(30px, 3vw, 43px);
}

.auth-steps {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
}

.auth-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, .87);
  font-size: 12px;
}

.auth-steps span {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  color: #ff9a99;
  background: rgba(255, 255, 255, .08);
  font-size: 9px;
  font-weight: 900;
}

.auth-register-pane {
  display: block;
  max-height: min(720px, calc(92vh - 76px));
  overflow-y: auto;
  padding: 32px clamp(30px, 4vw, 54px) 40px;
}

.auth-register-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.auth-register-heading h2 {
  font-size: clamp(28px, 3vw, 38px);
}

.auth-register-heading p {
  margin-bottom: 20px;
}

.auth-back-button {
  flex: 0 0 auto;
  margin-top: 5px;
  font-size: 11px;
}

.auth-register-form {
  gap: 14px;
}

.auth-register-form .form-grid {
  gap: 13px;
}

.auth-register-form .input {
  min-height: 47px;
  margin-top: 7px;
  border-color: #d7dfea;
  border-radius: 13px;
  background: rgba(255, 255, 255, .92);
}

.auth-register-form .input:focus {
  border-color: #7357d5;
  box-shadow: 0 0 0 4px rgba(115, 87, 213, .1);
}

.auth-register-form .password-policy-note {
  margin-top: 9px;
  border-radius: 11px;
}

.auth-consent {
  display: grid;
  grid-template-columns: 19px 1fr;
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #dce3eb;
  border-radius: 13px;
  color: #53677b;
  background: rgba(255, 255, 255, .76);
  font-size: 11px;
  line-height: 1.6;
}

.auth-consent input {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: #6f52cf;
}

.auth-register-actions {
  margin-top: 0;
}

.auth-register-actions .auth-primary-action {
  width: min(280px, 100%);
}

#accountDashboard {
  min-height: min(650px, calc(92vh - 76px));
  overflow-y: auto;
  padding: 28px;
  background: #f7f9fb;
}

@media (max-width: 900px) {
  .account-modal {
    padding: 12px;
  }

  .account-modal .auth-shell {
    max-height: 96vh;
    border-radius: 22px;
  }

  .auth-guest,
  .auth-view {
    min-height: calc(96vh - 70px);
  }

  .auth-view,
  .auth-register-view {
    grid-template-columns: 1fr;
  }

  .auth-story {
    display: none;
  }

  .auth-form-pane {
    min-height: calc(96vh - 70px);
    padding: 42px clamp(24px, 8vw, 64px);
  }

  .auth-register-pane {
    min-height: 0;
    max-height: calc(96vh - 70px);
    padding-top: 28px;
  }
}

@media (max-width: 580px) {
  .account-modal {
    padding: 0;
  }

  .account-modal .auth-shell {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .account-modal .auth-shell-head {
    min-height: 68px;
    padding: 10px 16px;
  }

  .auth-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .auth-brand small {
    display: none;
  }

  .auth-guest,
  .auth-view {
    min-height: calc(100dvh - 68px);
  }

  .auth-form-pane {
    min-height: calc(100dvh - 68px);
    padding: 34px 20px;
  }

  .auth-form-pane h2 {
    font-size: 32px;
  }

  .auth-register-pane {
    max-height: calc(100dvh - 68px);
    padding: 24px 18px 32px;
  }

  .auth-register-heading {
    display: grid;
    gap: 0;
  }

  .auth-back-button {
    grid-row: 1;
    justify-self: start;
    margin: 0 0 17px;
  }

  .auth-register-form .form-grid {
    grid-template-columns: 1fr;
  }

  .auth-register-form .span-2 {
    grid-column: auto;
  }

  .auth-register-actions .auth-primary-action {
    width: 100%;
  }
}

/* Member access V2 — faithful glass-gradient composition */
@media (min-width: 901px) {
  .account-modal {
    padding: 30px;
    background:
      linear-gradient(rgba(255, 255, 255, .08), rgba(255, 255, 255, .08)),
      repeating-linear-gradient(90deg, transparent 0 36px, rgba(255, 255, 255, .07) 37px),
      repeating-linear-gradient(0deg, transparent 0 36px, rgba(255, 255, 255, .07) 37px),
      radial-gradient(circle at 8% 12%, #a842ff 0, transparent 34%),
      radial-gradient(circle at 89% 13%, #ff4e7f 0, transparent 38%),
      radial-gradient(circle at 91% 88%, #ffb071 0, transparent 35%),
      linear-gradient(120deg, #943cf6 0%, #e24eaa 46%, #ff746f 100%);
  }

  .account-modal .auth-shell {
    position: relative;
    width: min(1090px, 100%);
    height: min(780px, calc(100vh - 60px));
    max-height: none;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 30px;
    background:
      linear-gradient(112deg, rgba(50, 17, 73, .84), rgba(132, 70, 76, .68) 62%, rgba(82, 67, 79, .72)),
      rgba(35, 25, 43, .78);
    box-shadow:
      0 35px 90px rgba(68, 12, 68, .4),
      inset 0 1px 0 rgba(255, 255, 255, .12);
    backdrop-filter: blur(30px);
  }

  .account-modal .auth-shell-head {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 8;
    min-height: 88px;
    padding: 25px 34px;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  .account-modal .auth-shell-head > * {
    pointer-events: auto;
  }

  .auth-brand {
    color: #fff;
  }

  .auth-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background:
      linear-gradient(135deg, #ff766d, #ff4c8e 48%, #814eee);
    box-shadow: 0 10px 30px rgba(24, 7, 34, .28);
  }

  .auth-brand strong {
    color: #fff;
  }

  .auth-brand small {
    color: rgba(255, 255, 255, .68);
  }

  .account-modal .auth-close {
    color: #fff;
    background: rgba(0, 0, 0, .28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  }

  .account-modal .auth-close:hover {
    background: rgba(0, 0, 0, .48);
  }

  .account-modal-body,
  .auth-guest,
  .auth-view {
    height: 100%;
    min-height: 0;
  }

  .auth-view {
    grid-template-columns: minmax(420px, .98fr) minmax(480px, 1.02fr);
    background: transparent;
  }

  .auth-form-pane {
    align-items: center;
    padding: 115px 66px 58px 72px;
    background: transparent;
  }

  .auth-form-wrap {
    width: min(380px, 100%);
  }

  .auth-eyebrow {
    margin-bottom: 10px;
    color: #ffb1aa;
  }

  .auth-form-pane h2 {
    color: #fff;
    font-size: 39px;
  }

  .auth-lead {
    max-width: 340px;
    margin: 11px 0 31px;
    color: rgba(255, 255, 255, .74);
    font-size: 13px;
  }

  .auth-field label {
    color: rgba(255, 255, 255, .88);
    font-weight: 600;
  }

  .auth-input-wrap > span {
    left: 20px;
    color: rgba(255, 255, 255, .52);
  }

  .auth-input-wrap .input {
    min-height: 53px;
    padding: 13px 22px 13px 46px;
    border-color: rgba(255, 255, 255, .08);
    border-radius: 999px;
    color: #fff;
    background:
      linear-gradient(180deg, #09090b, #030304);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .08),
      0 12px 26px rgba(12, 5, 16, .22);
  }

  .auth-input-wrap .input::placeholder {
    color: rgba(255, 255, 255, .42);
  }

  .auth-input-wrap .input:focus {
    border-color: rgba(255, 139, 156, .82);
    box-shadow:
      0 0 0 4px rgba(255, 113, 139, .15),
      inset 0 1px 0 rgba(255, 255, 255, .08);
  }

  .auth-input-wrap input:-webkit-autofill,
  .auth-input-wrap input:-webkit-autofill:hover,
  .auth-input-wrap input:-webkit-autofill:focus {
    border-color: rgba(255, 255, 255, .08);
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    box-shadow:
      0 0 0 1000px #050506 inset,
      0 12px 26px rgba(12, 5, 16, .22);
    transition: background-color 9999s ease-out 0s;
  }

  .auth-form-row {
    color: rgba(255, 255, 255, .72);
  }

  .auth-security-note {
    color: rgba(255, 255, 255, .64);
  }

  .auth-security-note::before {
    background: #78dda9;
  }

  .auth-text-button,
  .auth-switch button {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .auth-primary-action {
    min-height: 53px;
    border-radius: 999px;
    color: #151218;
    background: linear-gradient(90deg, #ffae8e 0%, #ff897f 55%, #ff6686 100%);
    box-shadow: 0 16px 30px rgba(61, 18, 43, .28);
  }

  .auth-switch {
    margin-top: 22px;
    padding-top: 19px;
    border-color: rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .65);
  }

  .auth-story {
    align-self: center;
    height: calc(100% - 82px);
    margin: 41px 38px 41px 0;
    padding: 58px 47px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 24px 24px 64px 24px;
    background:
      radial-gradient(circle at 75% 82%, rgba(38, 83, 204, .88), transparent 35%),
      radial-gradient(circle at 8% 85%, rgba(255, 98, 105, .52), transparent 30%),
      linear-gradient(145deg, #0b0509 0%, #10070d 54%, #071126 100%);
    box-shadow: 0 24px 50px rgba(13, 5, 13, .28);
  }

  .auth-story::before {
    opacity: .12;
    background-size: 38px 38px;
  }

  .auth-story::after {
    right: -40px;
    bottom: 20px;
    width: 300px;
    height: 300px;
    opacity: .9;
  }

  .auth-story-kicker {
    margin-bottom: 26px;
  }

  .auth-story h3 {
    max-width: 420px;
    font-size: 45px;
    line-height: 1.16;
  }

  .auth-story p {
    max-width: 390px;
    color: rgba(255, 255, 255, .84);
    font-size: 13px;
  }

  .auth-benefits {
    max-width: 390px;
  }

  .auth-benefits span {
    border-color: rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .08);
  }

  .auth-story blockquote {
    max-width: 380px;
    margin-top: 28px;
  }

  .auth-story-card {
    right: 28px;
    bottom: -20px;
    width: 340px;
    min-height: 132px;
    align-content: center;
    padding: 24px 28px;
    border-radius: 24px 24px 42px 24px;
    background:
      radial-gradient(circle at 22% 100%, rgba(235, 92, 255, .2), transparent 36%),
      rgba(255, 255, 255, .95);
  }

  .auth-story-card strong {
    max-width: 235px;
    font-size: 17px;
  }

  .auth-register-view {
    grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr);
  }

  .auth-register-story {
    height: calc(100% - 68px);
    margin: 34px 0 34px 34px;
    padding: 115px 38px 42px;
  }

  .auth-register-story h3 {
    font-size: 36px;
  }

  .auth-register-pane {
    align-self: stretch;
    max-height: none;
    padding: 98px 50px 36px 44px;
    color: #fff;
    background: transparent;
  }

  .auth-register-heading h2 {
    color: #fff;
  }

  .auth-register-heading p {
    color: rgba(255, 255, 255, .7);
  }

  .auth-back-button {
    color: #fff;
  }

  .auth-register-form .field label {
    color: rgba(255, 255, 255, .86);
  }

  .auth-register-form .input {
    border-color: rgba(255, 255, 255, .12);
    color: #fff;
    background: rgba(7, 7, 10, .88);
  }

  .auth-register-form .input::placeholder {
    color: rgba(255, 255, 255, .4);
  }

  .auth-register-form .password-policy-note,
  .auth-consent {
    border-color: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .75);
    background: rgba(5, 5, 9, .28);
  }

  .auth-register-form .muted {
    color: rgba(255, 255, 255, .66);
  }

  .auth-register-form a {
    color: #ffc2c5;
  }
}

@media (max-width: 900px) {
  .account-modal {
    background:
      radial-gradient(circle at 12% 8%, rgba(172, 59, 255, .95), transparent 42%),
      radial-gradient(circle at 92% 10%, rgba(255, 77, 125, .9), transparent 45%),
      linear-gradient(145deg, #7e35dd, #df4fa2 52%, #ff8b79);
  }

  .account-modal .auth-shell {
    background:
      linear-gradient(145deg, rgba(51, 19, 72, .95), rgba(117, 58, 75, .9));
  }

  .account-modal .auth-shell-head {
    border: 0;
    background: transparent;
  }

  .auth-brand,
  .auth-brand strong {
    color: #fff;
  }

  .auth-brand small {
    color: rgba(255, 255, 255, .66);
  }

  .account-modal .auth-close {
    color: #fff;
    background: rgba(0, 0, 0, .28);
  }

  .auth-form-pane {
    color: #fff;
    background: transparent;
  }

  .auth-form-pane h2,
  .auth-field label,
  .auth-register-form .field label,
  .auth-register-heading h2 {
    color: #fff;
  }

  .auth-lead,
  .auth-register-heading p,
  .auth-security-note,
  .auth-switch,
  .auth-register-form .muted {
    color: rgba(255, 255, 255, .7);
  }

  .auth-input-wrap .input,
  .auth-register-form .input {
    border-color: rgba(255, 255, 255, .1);
    border-radius: 999px;
    color: #fff;
    background: #070709;
  }

  .auth-input-wrap .input::placeholder,
  .auth-register-form .input::placeholder {
    color: rgba(255, 255, 255, .42);
  }

  .auth-input-wrap input:-webkit-autofill,
  .auth-input-wrap input:-webkit-autofill:hover,
  .auth-input-wrap input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    box-shadow: 0 0 0 1000px #070709 inset;
    transition: background-color 9999s ease-out 0s;
  }

  .auth-primary-action {
    border-radius: 999px;
    color: #171318;
    background: linear-gradient(90deg, #ffad8d, #ff6685);
  }

  .auth-text-button,
  .auth-switch button,
  .auth-back-button,
  .auth-register-form a {
    color: #ffd2d2;
  }

  .auth-switch {
    border-color: rgba(255, 255, 255, .14);
  }

  .auth-register-form .password-policy-note,
  .auth-consent {
    border-color: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .76);
    background: rgba(0, 0, 0, .2);
  }
}

/* Member access V3 — editorial education portal */
@media (min-width: 901px) {
  .auth-editorial.account-modal {
    padding: 28px;
    background:
      linear-gradient(rgba(5, 25, 46, .76), rgba(5, 25, 46, .82)),
      url("hero-media-library.webp") center / cover;
    backdrop-filter: blur(14px);
  }

  .auth-editorial .auth-shell {
    width: min(1160px, 100%);
    height: min(760px, calc(100vh - 56px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 24px;
    background: #f4f1e9;
    box-shadow: 0 38px 100px rgba(0, 14, 28, .44);
  }

  .auth-editorial .auth-shell-head {
    min-height: 86px;
    padding: 22px 30px;
  }

  .auth-editorial .auth-brand {
    color: #0b2b49;
  }

  .auth-editorial .auth-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: #fff;
    background: #0b2b49;
    box-shadow: 0 0 0 5px rgba(190, 148, 65, .16);
  }

  .auth-editorial .auth-brand strong {
    color: #0b2b49;
    font-family: "Noto Serif Thai", "Noto Sans Thai", sans-serif;
    font-size: 16px;
  }

  .auth-editorial .auth-brand small {
    color: #6e7c87;
  }

  .auth-editorial .auth-close {
    color: #0b2b49;
    background: rgba(255, 255, 255, .8);
    box-shadow:
      0 8px 20px rgba(5, 33, 56, .12),
      inset 0 0 0 1px rgba(9, 43, 73, .08);
  }

  .auth-editorial .auth-close:hover {
    color: #fff;
    background: #0b2b49;
  }

  .auth-editorial .auth-view {
    grid-template-columns: minmax(430px, .86fr) minmax(520px, 1.14fr);
    background: #f4f1e9;
  }

  .auth-editorial .auth-form-pane {
    padding: 116px 68px 58px;
    color: #102d45;
    background:
      linear-gradient(90deg, rgba(188, 145, 57, .07) 1px, transparent 1px) 0 0 / 34px 34px,
      #f4f1e9;
  }

  .auth-editorial .auth-form-wrap {
    width: min(390px, 100%);
  }

  .auth-editorial .auth-eyebrow {
    color: #a77625;
    letter-spacing: .2em;
  }

  .auth-editorial .auth-eyebrow::before {
    width: 32px;
    background: #b88a36;
  }

  .auth-editorial .auth-form-pane h2 {
    color: #0b2b49;
    font-family: "Noto Serif Thai", "Noto Sans Thai", sans-serif;
    font-size: 42px;
    letter-spacing: -.025em;
  }

  .auth-editorial .auth-lead {
    margin: 13px 0 30px;
    color: #617383;
    line-height: 1.8;
  }

  .auth-editorial .auth-field label {
    color: #183b56;
    font-weight: 800;
  }

  .auth-editorial .auth-input-wrap > span {
    color: #8a7344;
  }

  .auth-editorial .auth-input-wrap .input {
    min-height: 55px;
    border: 1px solid #d9d5ca;
    border-radius: 10px;
    color: #102d45;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 8px 20px rgba(14, 43, 65, .055);
  }

  .auth-editorial .auth-input-wrap .input::placeholder {
    color: #98a3ac;
  }

  .auth-editorial .auth-input-wrap .input:focus {
    border-color: #b88a36;
    box-shadow:
      0 0 0 4px rgba(184, 138, 54, .12),
      0 8px 20px rgba(14, 43, 65, .055);
  }

  .auth-editorial .auth-input-wrap input:-webkit-autofill,
  .auth-editorial .auth-input-wrap input:-webkit-autofill:hover,
  .auth-editorial .auth-input-wrap input:-webkit-autofill:focus {
    border-color: #d9d5ca;
    -webkit-text-fill-color: #102d45;
    caret-color: #102d45;
    box-shadow:
      0 0 0 1000px #fff inset,
      0 8px 20px rgba(14, 43, 65, .055);
  }

  .auth-editorial .auth-security-note {
    color: #71808c;
  }

  .auth-editorial .auth-text-button,
  .auth-editorial .auth-switch button {
    color: #0b4775;
  }

  .auth-editorial .auth-primary-action {
    min-height: 55px;
    justify-content: space-between;
    padding: 0 9px 0 22px;
    border-radius: 10px;
    color: #fff;
    background: #0b2b49;
    box-shadow: 0 14px 28px rgba(11, 43, 73, .2);
  }

  .auth-editorial .auth-primary-action span {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #0b2b49;
    background: #d9b45e;
  }

  .auth-editorial .auth-primary-action:hover {
    background: #113c62;
    box-shadow: 0 17px 32px rgba(11, 43, 73, .27);
  }

  .auth-editorial .auth-switch {
    border-color: #d8d3c8;
    color: #75838e;
  }

  .auth-editorial .auth-story {
    height: 100%;
    margin: 0;
    padding: 126px 58px 58px;
    border: 0;
    border-radius: 0;
    background:
      linear-gradient(90deg, rgba(5, 29, 52, .94) 0%, rgba(5, 29, 52, .78) 48%, rgba(5, 29, 52, .2) 100%),
      url("hero-media-library.webp") 65% center / cover;
    box-shadow: none;
  }

  .auth-editorial .auth-story::before {
    opacity: .22;
    background:
      linear-gradient(135deg, transparent 0 71%, rgba(216, 180, 94, .38) 71% 71.5%, transparent 71.5%),
      linear-gradient(45deg, transparent 0 80%, rgba(255, 255, 255, .2) 80% 80.4%, transparent 80.4%);
    background-size: 160px 160px;
    mask-image: none;
  }

  .auth-editorial .auth-story::after {
    right: -80px;
    bottom: -110px;
    width: 340px;
    height: 340px;
    border: 48px solid rgba(213, 176, 90, .12);
    border-radius: 50%;
    clip-path: none;
    transform: none;
    background: transparent;
  }

  .auth-editorial .auth-story-kicker {
    color: #e5c679;
  }

  .auth-editorial .auth-story h3 {
    max-width: 440px;
    color: #fff;
    font-family: "Noto Serif Thai", "Noto Sans Thai", sans-serif;
    font-size: 48px;
    line-height: 1.2;
  }

  .auth-editorial .auth-story p {
    max-width: 410px;
    color: rgba(255, 255, 255, .78);
    line-height: 1.85;
  }

  .auth-editorial .auth-benefits span {
    border-color: rgba(226, 195, 118, .35);
    color: #f4e4b9;
    background: rgba(8, 36, 61, .58);
  }

  .auth-editorial .auth-story blockquote {
    border-color: rgba(225, 192, 113, .34);
    color: rgba(255, 255, 255, .84);
  }

  .auth-editorial .auth-story-card {
    right: 38px;
    bottom: 34px;
    width: 310px;
    min-height: 112px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 4px 22px 4px 22px;
    color: #0b2b49;
    background: rgba(248, 245, 237, .94);
    box-shadow: 0 20px 46px rgba(0, 18, 34, .28);
  }

  .auth-editorial .auth-register-view {
    grid-template-columns: minmax(350px, .72fr) minmax(0, 1.28fr);
  }

  .auth-editorial .auth-register-story {
    height: 100%;
    margin: 0;
    padding: 132px 42px 48px;
    background:
      linear-gradient(90deg, rgba(5, 29, 52, .91), rgba(5, 29, 52, .55)),
      url("hero-media-library.webp") 70% center / cover;
  }

  .auth-editorial .auth-register-story h3 {
    font-size: 40px;
  }

  .auth-editorial .auth-register-pane {
    max-height: 100%;
    padding: 106px 52px 38px;
    color: #102d45;
    background: #f4f1e9;
  }

  .auth-editorial .auth-register-heading h2 {
    color: #0b2b49;
  }

  .auth-editorial .auth-register-heading p {
    color: #657786;
  }

  .auth-editorial .auth-back-button {
    color: #0b4775;
  }

  .auth-editorial .auth-register-form .field label {
    color: #183b56;
  }

  .auth-editorial .auth-register-form .input {
    border-color: #d9d5ca;
    border-radius: 8px;
    color: #102d45;
    background: rgba(255, 255, 255, .94);
  }

  .auth-editorial .auth-register-form .input::placeholder {
    color: #98a3ac;
  }

  .auth-editorial .auth-register-form .password-policy-note,
  .auth-editorial .auth-consent {
    border-color: #d8d3c8;
    color: #586d7d;
    background: rgba(255, 255, 255, .6);
  }

  .auth-editorial .auth-register-form .muted {
    color: #657786;
  }

  .auth-editorial .auth-register-form a {
    color: #0b4775;
  }
}

@media (max-width: 900px) {
  .auth-editorial.account-modal {
    background:
      linear-gradient(rgba(5, 29, 52, .78), rgba(5, 29, 52, .86)),
      url("hero-media-library.webp") 64% center / cover;
  }

  .auth-editorial .auth-shell {
    background: #f4f1e9;
  }

  .auth-editorial .auth-shell-head {
    border-bottom: 1px solid #ddd8cd;
    background: rgba(244, 241, 233, .96);
  }

  .auth-editorial .auth-brand,
  .auth-editorial .auth-brand strong,
  .auth-editorial .auth-form-pane h2,
  .auth-editorial .auth-field label,
  .auth-editorial .auth-register-form .field label,
  .auth-editorial .auth-register-heading h2 {
    color: #0b2b49;
  }

  .auth-editorial .auth-brand small,
  .auth-editorial .auth-lead,
  .auth-editorial .auth-register-heading p,
  .auth-editorial .auth-security-note,
  .auth-editorial .auth-switch,
  .auth-editorial .auth-register-form .muted {
    color: #687988;
  }

  .auth-editorial .auth-close {
    color: #0b2b49;
    background: #fff;
  }

  .auth-editorial .auth-form-pane,
  .auth-editorial .auth-register-pane {
    color: #102d45;
    background: #f4f1e9;
  }

  .auth-editorial .auth-input-wrap .input,
  .auth-editorial .auth-register-form .input {
    border-color: #d9d5ca;
    border-radius: 10px;
    color: #102d45;
    background: #fff;
  }

  .auth-editorial .auth-input-wrap .input::placeholder,
  .auth-editorial .auth-register-form .input::placeholder {
    color: #98a3ac;
  }

  .auth-editorial .auth-primary-action {
    border-radius: 10px;
    color: #fff;
    background: #0b2b49;
  }

  .auth-editorial .auth-text-button,
  .auth-editorial .auth-switch button,
  .auth-editorial .auth-back-button,
  .auth-editorial .auth-register-form a {
    color: #0b4775;
  }

  .auth-editorial .auth-register-form .password-policy-note,
  .auth-editorial .auth-consent {
    border-color: #d8d3c8;
    color: #586d7d;
    background: rgba(255, 255, 255, .65);
  }
}

/* Member access V4 — formal, clear and task-focused */
.auth-formal.account-modal {
  padding: 20px;
  background: rgba(4, 24, 43, .82);
  backdrop-filter: blur(7px);
}

.auth-formal .auth-shell {
  width: min(1040px, 100%);
  height: min(730px, calc(100vh - 40px));
  max-height: none;
  overflow: hidden;
  border: 1px solid #cfd8e0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 12, 24, .34);
}

.auth-formal .auth-shell-head {
  position: relative;
  inset: auto;
  z-index: 5;
  min-height: 74px;
  padding: 13px 20px;
  border-bottom: 4px solid #c7a449;
  color: #fff;
  background: #082d4e;
}

.auth-formal .auth-brand,
.auth-formal .auth-brand strong {
  color: #fff;
}

.auth-formal .auth-brand small {
  color: #c4d3df;
}

.auth-formal .auth-brand-mark {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  color: #082d4e;
  background: #e4c978;
  box-shadow: none;
}

.auth-formal .auth-close {
  width: 42px;
  height: 42px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.auth-formal .auth-close:hover {
  color: #082d4e;
  background: #fff;
  transform: none;
}

.auth-formal .account-modal-body,
.auth-formal .auth-guest {
  height: calc(100% - 74px);
  min-height: 0;
}

.auth-formal .auth-view {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 330px;
  color: #172f43;
  background: #fff;
  animation: none;
}

.auth-formal .auth-form-pane {
  min-height: 0;
  padding: 42px 58px;
  color: #172f43;
  background: #fff;
}

.auth-formal .auth-form-wrap {
  width: min(430px, 100%);
}

.auth-formal .auth-eyebrow {
  margin-bottom: 9px;
  color: #9a7420;
  font-size: 10px;
  letter-spacing: .08em;
}

.auth-formal .auth-eyebrow::before {
  width: 24px;
  background: #c7a449;
}

.auth-formal .auth-form-pane h2 {
  margin: 0;
  color: #082d4e;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 32px;
  letter-spacing: 0;
}

.auth-formal .auth-lead,
.auth-formal .auth-register-heading p {
  margin: 10px 0 24px;
  color: #617486;
  font-size: 13px;
  line-height: 1.7;
}

.auth-formal .auth-form {
  gap: 16px;
}

.auth-formal .auth-field,
.auth-formal .auth-register-form .field {
  gap: 7px;
}

.auth-formal .auth-field label,
.auth-formal .auth-register-form .field label {
  color: #183851;
  font-size: 12px;
  font-weight: 800;
}

.auth-formal .auth-input-wrap > span {
  left: 15px;
  color: #60798d;
}

.auth-formal .auth-input-wrap .input,
.auth-formal .auth-register-form .input {
  min-height: 48px;
  margin-top: 0;
  padding: 10px 13px;
  border: 1px solid #bcc9d3;
  border-radius: 5px;
  color: #17354d;
  background: #fff;
  box-shadow: none;
}

.auth-formal .auth-input-wrap .input {
  padding-left: 40px;
}

.auth-formal .auth-input-wrap .input::placeholder,
.auth-formal .auth-register-form .input::placeholder {
  color: #8b9aa6;
}

.auth-formal .auth-input-wrap .input:focus,
.auth-formal .auth-register-form .input:focus {
  border-color: #1f5f91;
  box-shadow: 0 0 0 3px rgba(31, 95, 145, .13);
}

.auth-formal .auth-input-wrap input:-webkit-autofill,
.auth-formal .auth-input-wrap input:-webkit-autofill:hover,
.auth-formal .auth-input-wrap input:-webkit-autofill:focus {
  border-color: #bcc9d3;
  -webkit-text-fill-color: #17354d;
  caret-color: #17354d;
  box-shadow: 0 0 0 1000px #fff inset;
}

.auth-formal .auth-security-note {
  color: #647787;
}

.auth-formal .auth-text-button,
.auth-formal .auth-back-button,
.auth-formal .auth-switch button {
  color: #07548e;
}

.auth-formal .auth-primary-action {
  min-height: 48px;
  width: 100%;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid #082d4e;
  border-radius: 5px;
  color: #fff;
  background: #082d4e;
  box-shadow: none;
}

.auth-formal .auth-primary-action:hover {
  transform: none;
  background: #11456f;
  box-shadow: none;
}

.auth-formal .auth-primary-action span {
  width: auto;
  height: auto;
  display: inline;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-size: 16px;
}

.auth-formal .auth-primary-action:hover span {
  transform: none;
}

.auth-formal .auth-switch {
  margin-top: 18px;
  padding-top: 17px;
  border-color: #d9e0e6;
  color: #657684;
}

.auth-formal .auth-story {
  height: 100%;
  margin: 0;
  padding: 42px 30px;
  border: 0;
  border-left: 1px solid #d8e0e6;
  border-radius: 0;
  color: #183851;
  background: #eef3f6;
  box-shadow: none;
}

.auth-formal .auth-story::before,
.auth-formal .auth-story::after,
.auth-formal .auth-story-orb {
  display: none;
}

.auth-formal .auth-story-content {
  max-width: none;
}

.auth-formal .auth-story-kicker {
  margin-bottom: 16px;
  color: #8b6a22;
  font-size: 10px;
  letter-spacing: .08em;
}

.auth-formal .auth-story h3 {
  margin: 0;
  color: #082d4e;
  font-family: "Noto Sans Thai", sans-serif;
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: 0;
}

.auth-formal .auth-story p {
  margin: 14px 0 20px;
  color: #536a7c;
  font-size: 12px;
  line-height: 1.75;
}

.auth-formal .auth-benefits {
  display: grid;
  gap: 8px;
}

.auth-formal .auth-benefits span {
  padding: 10px 12px;
  border: 1px solid #cfdae2;
  border-radius: 5px;
  color: #23475f;
  background: #fff;
  font-size: 11px;
}

.auth-formal .auth-story blockquote {
  margin: 22px 0 0;
  padding: 16px;
  border: 1px solid #d8e0e6;
  border-left: 4px solid #c7a449;
  border-radius: 4px;
  color: #536a7c;
  background: rgba(255, 255, 255, .65);
  font-size: 11px;
  line-height: 1.7;
}

.auth-formal .auth-story-card {
  position: static;
  width: auto;
  min-height: 0;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #c9d5de;
  border-radius: 5px;
  color: #082d4e;
  background: #fff;
  box-shadow: none;
}

.auth-formal .auth-register-view {
  grid-template-columns: 280px minmax(0, 1fr);
}

.auth-formal .auth-register-story {
  order: 0;
  height: 100%;
  margin: 0;
  padding: 38px 25px;
  border: 0;
  border-right: 1px solid #d8e0e6;
  background: #eef3f6;
}

.auth-formal .auth-register-story h3 {
  font-size: 25px;
}

.auth-formal .auth-steps {
  gap: 9px;
  margin-top: 24px;
}

.auth-formal .auth-steps li {
  color: #38566b;
  font-size: 11px;
}

.auth-formal .auth-steps span {
  width: 34px;
  height: 34px;
  border-color: #b9c8d3;
  border-radius: 50%;
  color: #fff;
  background: #0d426b;
}

.auth-formal .auth-register-pane {
  order: 1;
  max-height: 100%;
  overflow-y: auto;
  padding: 30px 38px 36px;
  color: #172f43;
  background: #fff;
}

.auth-formal .auth-register-heading {
  align-items: center;
}

.auth-formal .auth-register-heading h2 {
  color: #082d4e;
  font-size: 28px;
}

.auth-formal .auth-register-heading p {
  margin-bottom: 18px;
}

.auth-formal .auth-register-form {
  gap: 12px;
}

.auth-formal .auth-register-form .form-grid {
  gap: 12px;
}

.auth-formal .auth-register-form .password-policy-note {
  margin-top: 7px;
  border: 1px solid #d2dde5;
  border-radius: 4px;
  color: #4e6679;
  background: #f3f6f8;
}

.auth-formal .auth-register-form .password-policy-note,
.auth-formal .auth-register-form .password-strength,
.auth-formal .auth-register-form #registerPasswordStrengthText {
  display: none;
}

.auth-formal .auth-register-form .muted {
  color: #607486;
}

.auth-formal .auth-consent {
  border-color: #ccd7df;
  border-radius: 5px;
  color: #4e6577;
  background: #f7f9fa;
}

.auth-formal .auth-register-form a {
  color: #07548e;
}

.auth-formal .auth-register-actions {
  justify-content: flex-start;
}

.auth-formal .auth-register-actions .auth-primary-action {
  width: min(260px, 100%);
}

.auth-formal #accountRegisterHeading[hidden],
.auth-formal #contributorRegisterForm[hidden],
.auth-formal #contributorRegisterSuccess[hidden] {
  display: none !important;
}

.auth-formal .auth-form-status {
  padding: 12px 14px;
  border: 1px solid #b9d2e4;
  border-radius: 6px;
  color: #174b70;
  background: #edf6fc;
  font-size: 15px;
  line-height: 1.6;
}

.auth-formal .auth-form-status.is-error {
  border-color: #e0aca6;
  color: #8f2920;
  background: #fff1ef;
}

.auth-formal .auth-register-success {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid #d7c894;
  border-radius: 12px;
  color: #17354d;
  background: #fffdf8;
  box-shadow: 0 18px 42px rgba(8, 45, 78, .1);
}

.auth-formal .auth-register-success:focus {
  outline: 3px solid rgba(31, 95, 145, .18);
  outline-offset: 4px;
}

.auth-formal .auth-register-success h2 {
  margin: 6px 0 8px;
  color: #082d4e;
  font-size: clamp(28px, 3.2vw, 38px);
}

.auth-formal .auth-register-success > p {
  margin: 0 0 22px;
  color: #526b7d;
  font-size: 17px;
  line-height: 1.7;
}

.auth-formal .auth-success-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  place-items: center;
  border: 5px solid #dff2e7;
  border-radius: 50%;
  color: #fff;
  background: #24865a;
  font-size: 30px;
  font-weight: 900;
}

.auth-formal .auth-success-email {
  display: grid;
  gap: 3px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-left: 4px solid #c7a449;
  color: #3b566a;
  background: #f5f1e6;
}

.auth-formal .auth-success-email span,
.auth-formal .auth-success-next small {
  font-size: 14px;
}

.auth-formal .auth-success-email strong {
  overflow-wrap: anywhere;
  color: #082d4e;
  font-size: 17px;
}

.auth-formal .auth-success-next {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.auth-formal .auth-success-next li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
}

.auth-formal .auth-success-next li > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #8f3027;
  font-weight: 800;
}

.auth-formal .auth-success-next div {
  display: grid;
  gap: 2px;
}

.auth-formal .auth-success-next small {
  color: #607486;
  line-height: 1.5;
}

.auth-formal .account-system-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.auth-formal .account-system-links a {
  display: grid;
  min-height: 54px;
  padding: 8px 10px;
  place-items: center;
  border: 1px solid #c9d9e5;
  border-radius: 8px;
  color: #07548e;
  background: #f4f9fc;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.auth-formal .account-system-links a:hover,
.auth-formal .account-system-links a:focus-visible {
  border-color: #1f6fb2;
  background: #eaf4fb;
}

/* Additional service menu moved from the primary navigation. */
.more-services-section {
  margin: clamp(28px, 5vw, 64px) 0;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid rgba(202, 168, 76, .35);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 8%, rgba(241, 203, 92, .18), transparent 32%),
    linear-gradient(135deg, #102f43, #174a63);
  box-shadow: 0 18px 50px rgba(10, 41, 59, .14);
}

.more-services-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.more-services-heading h2 {
  margin: 5px 0 0;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.more-services-heading .section-kicker {
  color: #f1cf6b;
}

.more-services-heading p {
  max-width: 610px;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  line-height: 1.75;
}

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

.more-service-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  min-height: 218px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 18px;
  color: #17354d;
  background: #fffdf7;
  box-shadow: 0 12px 30px rgba(4, 28, 42, .14);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.more-service-card::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(196, 44, 101, .07);
  content: "";
}

.more-service-card:hover,
.more-service-card:focus-visible {
  transform: translateY(-4px);
  border-color: #f1cf6b;
  box-shadow: 0 18px 38px rgba(4, 28, 42, .22);
}

.more-service-number {
  position: absolute;
  top: 15px;
  right: 17px;
  color: #9d7042;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}

.more-service-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: #a72959;
  font-size: 1.35rem;
  font-weight: 900;
}

.more-service-card.prompts .more-service-icon {
  color: #4b3610;
  background: #f1cf6b;
}

.more-service-card.examples .more-service-icon {
  background: #1b6680;
}

.more-service-copy {
  display: block;
  padding-top: 7px;
}

.more-service-copy strong,
.more-service-copy small {
  display: block;
}

.more-service-copy strong {
  color: #102f43;
  font-size: 1.14rem;
}

.more-service-copy small {
  margin-top: 9px;
  color: #5e7280;
  font-size: .84rem;
  line-height: 1.7;
}

.more-service-open {
  grid-column: 1 / -1;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
  border-top: 1px solid #e7dfcc;
  color: #8e2d52;
  font-size: .84rem;
  font-weight: 900;
}

.more-service-open i {
  font-size: 1.15rem;
  font-style: normal;
}

@media (max-width: 900px) {
  .more-services-heading {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .more-services-grid {
    grid-template-columns: 1fr;
  }

  .more-service-card {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .more-services-section {
    margin-inline: -4px;
    padding: 22px 15px;
    border-radius: 18px;
  }

  .more-service-card {
    padding: 18px;
  }
}

/* Homepage featured learning game */
body.thai-heritage-theme .main-nav a.nav-featured-game {
  color: #3d2a08;
  background: linear-gradient(135deg, #ffe79a, #e8bc4f);
  border: 1px solid rgba(137, 87, 21, .22);
  box-shadow: 0 6px 15px rgba(137, 87, 21, .14);
}

body.thai-heritage-theme .main-nav a.nav-featured-game::after {
  background: #9b352b;
  transform: scaleX(1);
}

body.thai-heritage-theme .main-nav a.nav-featured-game:hover,
body.thai-heritage-theme .main-nav a.nav-featured-game:focus-visible {
  color: #fffaf0;
  background: linear-gradient(135deg, #a53a2f, #74251f);
}

.auth-formal .auth-register-pane:has(.auth-register-success:not([hidden])) {
  display: block;
  scrollbar-gutter: stable;
}

@media (min-width: 901px) {
  .auth-formal .auth-register-pane {
    padding: 20px 30px;
  }

  .auth-formal .auth-register-heading p {
    margin-bottom: 8px;
  }

  .auth-formal .auth-register-form,
  .auth-formal .auth-register-form .form-grid {
    gap: 8px;
  }

  .auth-formal .auth-register-form .input {
    min-height: 42px;
    padding-block: 7px;
  }

  .auth-formal .auth-consent {
    padding: 8px 10px;
    line-height: 1.45;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .auth-formal .auth-register-story {
    display: none;
  }

  .auth-formal .auth-register-view {
    grid-template-columns: 1fr;
  }

  .auth-formal .auth-register-pane {
    padding-top: 24px;
  }

  .auth-formal .auth-register-success {
    padding: 20px 28px;
  }

  .auth-formal .auth-success-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border-width: 4px;
    font-size: 24px;
  }

  .auth-formal .auth-register-success > p,
  .auth-formal .auth-success-email {
    margin-bottom: 12px;
  }

  .auth-formal .auth-success-next {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
  }

  .auth-formal .auth-success-next li {
    align-items: start;
  }
}

@media (max-width: 900px) {
  .auth-formal.account-modal {
    padding: 8px;
    background: rgba(4, 24, 43, .88);
  }

  .auth-formal .auth-shell {
    height: calc(100dvh - 16px);
    border-radius: 7px;
  }

  .auth-formal .auth-shell-head {
    min-height: 68px;
    padding: 10px 14px;
    border-bottom-width: 3px;
    background: #082d4e;
  }

  .auth-formal .auth-brand,
  .auth-formal .auth-brand strong {
    color: #fff;
  }

  .auth-formal .auth-brand small {
    color: #c4d3df;
  }

  .auth-formal .auth-close {
    color: #fff;
    background: rgba(255, 255, 255, .1);
  }

  .auth-formal .account-modal-body,
  .auth-formal .auth-guest {
    height: calc(100% - 68px);
  }

  .auth-formal .auth-view {
    display: block;
    height: 100%;
    background: #fff;
  }

  .auth-formal .auth-story {
    display: none;
  }

  .auth-formal .auth-form-pane {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    padding: 32px clamp(20px, 7vw, 46px);
    color: #172f43;
    background: #fff;
  }

  .auth-formal .auth-form-pane h2,
  .auth-formal .auth-field label,
  .auth-formal .auth-register-form .field label,
  .auth-formal .auth-register-heading h2 {
    color: #082d4e;
  }

  .auth-formal .auth-lead,
  .auth-formal .auth-register-heading p,
  .auth-formal .auth-security-note,
  .auth-formal .auth-switch,
  .auth-formal .auth-register-form .muted {
    color: #617486;
  }

  .auth-formal .auth-input-wrap .input,
  .auth-formal .auth-register-form .input {
    border-color: #bcc9d3;
    border-radius: 5px;
    color: #17354d;
    background: #fff;
  }

  .auth-formal .auth-input-wrap .input::placeholder,
  .auth-formal .auth-register-form .input::placeholder {
    color: #8b9aa6;
  }

  .auth-formal .auth-primary-action {
    border-radius: 5px;
    color: #fff;
    background: #082d4e;
  }

  .auth-formal .auth-text-button,
  .auth-formal .auth-switch button,
  .auth-formal .auth-back-button,
  .auth-formal .auth-register-form a {
    color: #07548e;
  }

  .auth-formal .auth-register-form .password-policy-note,
  .auth-formal .auth-consent {
    border-color: #ccd7df;
    color: #4e6577;
    background: #f7f9fa;
  }
}

@media (max-width: 520px) {
  .auth-formal .account-system-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .auth-formal.account-modal {
    padding: 0;
  }

  .auth-formal .auth-shell {
    height: 100dvh;
    border-radius: 0;
  }

  .auth-formal .auth-form-pane {
    padding: 26px 18px 34px;
  }

  .auth-formal .auth-form-pane h2 {
    font-size: 27px;
  }

  .auth-formal .auth-register-heading {
    display: grid;
  }

  .auth-formal .auth-register-actions .auth-primary-action {
    width: 100%;
  }
}

body.high-contrast {
  --navy: #000;
  --blue: #0645ad;
  --ink: #000;
  --muted: #222;
  --line: #000;
  --bg: #fff;
}
body.high-contrast .panel,
body.high-contrast .media-card,
body.high-contrast .search-panel {
  border: 2px solid #000;
  box-shadow: none;
}
.governance-item,
.collection-admin-item,
.notification-item {
  border: 1px solid #dce7f0;
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 10px;
  background: #fff;
}
.governance-item textarea {
  width: 100%;
  min-height: 150px;
}
#mfaSecret {
  display: block;
  padding: 12px;
  margin: 10px 0;
  overflow-wrap: anywhere;
  background: #eef5fb;
  border-radius: 9px;
}

.settings-subsection {
  margin-top: 8px;
  padding: 18px 20px;
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  background: #f2f8fd;
}
.settings-subsection h4 {
  margin: 0 0 5px;
  color: var(--navy);
}
.settings-subsection p {
  margin: 0;
}
.password-policy-note {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #eef5fb;
  color: #31536d;
  font-size: 12px;
  line-height: 1.65;
}
.password-policy-note.is-error {
  background: #fff0f0;
  color: #a32828;
}
.password-strength {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9f1;
}
.password-strength span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #b14545;
  transition: width .2s ease, background-color .2s ease;
}
.password-strength span[data-level="accepted"] {
  background: #c48713;
}
.password-strength span[data-level="strong"] {
  background: #207a4a;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Course learning system: five practical topics, assignment and certificate */
.course-page {
  color: #17354a;
  background:
    radial-gradient(circle at 8% 18%, rgba(208, 164, 63, .1), transparent 24%),
    #f7f2e8;
}

.course-page .lesson-topbar {
  position: relative;
  z-index: 30;
}

.course-page .header-action,
.course-page .brand {
  text-decoration: none;
}

.course-hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  color: #fff;
  background: #082f43;
}

.course-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 12px;
  content: "";
  background:
    linear-gradient(135deg, #f8f0dc 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(225deg, #f8f0dc 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(315deg, #c38d31 25%, transparent 25%) 12px 0 / 24px 24px,
    linear-gradient(45deg, #9d342b 25%, transparent 25%) 12px 0 / 24px 24px;
}

.course-hero-backdrop,
.course-hero-backdrop::after {
  position: absolute;
  inset: 0;
}

.course-hero-backdrop::after {
  content: "";
  background: linear-gradient(90deg, rgba(4, 35, 52, .98) 0%, rgba(4, 35, 52, .9) 48%, rgba(4, 35, 52, .48) 100%);
}

.course-hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .62;
}

.course-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 390px;
  padding-top: 38px;
  padding-bottom: 54px;
  flex-direction: column;
  justify-content: center;
}

.course-breadcrumb {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  gap: 9px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.course-breadcrumb a {
  color: #f2d574;
  text-decoration: none;
}

.course-hero-copy {
  max-width: 900px;
}

.course-label {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  padding: 0 15px;
  border: 1px solid rgba(240, 205, 104, .62);
  border-radius: 999px;
  color: #f6dc83;
  background: rgba(105, 35, 33, .62);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.course-hero h1 {
  max-width: 850px;
  margin: 17px 0 10px;
  color: #fff;
  font-size: clamp(34px, 4.3vw, 62px);
  line-height: 1.18;
  letter-spacing: -.025em;
}

.course-hero-copy > p {
  max-width: 800px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 1.85;
}

.course-hero-meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 22px;
  gap: 10px;
}

.course-hero-meta span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  color: rgba(255, 255, 255, .76);
  background: rgba(5, 39, 55, .68);
  font-size: 11px;
  gap: 8px;
}

.course-hero-meta b {
  color: #f3d574;
}

.course-progress-banner {
  position: relative;
  z-index: 4;
  display: grid;
  min-height: 88px;
  margin-top: -30px;
  padding: 18px 22px;
  border: 1px solid #dfcfae;
  border-top: 5px solid #9d342b;
  border-radius: 12px;
  align-items: center;
  grid-template-columns: minmax(230px, auto) minmax(220px, 1fr) auto;
  gap: 22px;
  background: #fffdf8;
  box-shadow: 0 18px 45px rgba(42, 47, 44, .12);
}

.course-progress-label {
  display: block;
  margin-bottom: 3px;
  color: #9d342b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.course-progress-banner strong {
  font-size: 14px;
}

.course-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfcb;
}

.course-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9d342b, #d8ad43);
  box-shadow: 0 0 16px rgba(216, 173, 67, .36);
  transition: width .45s ease;
}

.course-layout {
  display: grid;
  padding-top: 42px;
  padding-bottom: 70px;
  align-items: start;
  grid-template-columns: minmax(250px, 315px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 42px);
}

.course-sidebar {
  position: sticky;
  top: 18px;
  overflow: hidden;
  border: 1px solid #dfd2ba;
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 14px 35px rgba(35, 55, 64, .08);
}

.course-side-head {
  display: flex;
  min-height: 66px;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: #123c50;
}

.course-side-head span {
  font-size: 13px;
  font-weight: 800;
}

.course-side-head strong {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  color: #f0cf69;
  font-size: 10px;
}

.course-topic-nav {
  display: grid;
  padding: 8px;
  gap: 4px;
}

.course-topic-nav a {
  position: relative;
  display: grid;
  min-height: 82px;
  padding: 12px 34px 12px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  align-items: center;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  color: #17354a;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.course-topic-nav a:hover {
  border-color: #d7c39f;
  background: #faf3e6;
  transform: translateX(2px);
}

.course-topic-nav a.active {
  border-color: #d5b964;
  background: linear-gradient(110deg, #fff3cc, #fffaf0);
}

.course-topic-nav a.locked:not(.active) {
  opacity: .62;
}

.course-topic-number {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: #173f52;
  font-size: 12px;
  font-weight: 900;
}

.course-topic-nav a.completed .course-topic-number {
  color: #fff;
  background: #25856f;
}

.course-topic-nav small,
.course-topic-nav strong {
  display: block;
}

.course-topic-nav small {
  margin-bottom: 3px;
  color: #856f52;
  font-size: 9px;
}

.course-topic-nav strong {
  font-size: 11px;
  line-height: 1.45;
}

.course-topic-nav i {
  position: absolute;
  top: 50%;
  right: 12px;
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: #25856f;
  font-size: 10px;
  font-style: normal;
  transform: translateY(-50%);
}

.course-topic-nav a.completed i {
  display: grid;
}

.course-side-note {
  margin: 8px;
  padding: 15px;
  border-radius: 9px;
  color: #6c5639;
  background: #f6ecd8;
}

.course-side-note strong {
  display: block;
  margin-bottom: 5px;
  color: #87312b;
  font-size: 11px;
}

.course-side-note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.65;
}

.course-topic {
  min-width: 0;
}

.course-topic-head,
.course-content-card,
.course-complete-panel,
.course-assignment-panel,
.course-certificate-panel {
  overflow: hidden;
  border: 1px solid #ddcfb5;
  border-radius: 15px;
  background: #fffdf9;
  box-shadow: 0 12px 34px rgba(28, 49, 57, .07);
}

.course-topic-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #123c50;
}

.course-topic-image::after {
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  content: "";
  background: linear-gradient(transparent, rgba(5, 30, 42, .58));
}

.course-topic-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-topic-image > span {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 16px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  color: #fff;
  background: rgba(109, 35, 32, .86);
  font-size: 10px;
  font-weight: 900;
}

.course-topic-heading {
  padding: clamp(24px, 4vw, 42px);
}

.course-topic-heading h2 {
  margin: 9px 0 10px;
  color: #143a4e;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.25;
}

.course-topic-heading > p {
  margin: 0;
  color: #66747b;
  font-size: 14px;
  line-height: 1.8;
}

.course-outcome {
  display: grid;
  margin-top: 20px;
  padding: 16px 18px;
  border-left: 4px solid #d6ad43;
  border-radius: 0 9px 9px 0;
  grid-template-columns: auto 1fr;
  gap: 12px;
  background: #f7eedb;
  font-size: 12px;
}

.course-outcome b {
  color: #8a342d;
}

.course-content-card {
  margin-top: 22px;
  padding: clamp(22px, 3.4vw, 36px);
}

.course-section-title {
  display: flex;
  margin-bottom: 22px;
  align-items: center;
  gap: 12px;
}

.course-section-title > span {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: #91342d;
  font-size: 11px;
  font-weight: 900;
}

.course-section-title small {
  display: block;
  margin-bottom: 2px;
  color: #b17c26;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
}

.course-section-title h3 {
  margin: 0;
  color: #173b4e;
  font-size: clamp(20px, 2.2vw, 28px);
}

.course-concepts {
  display: grid;
  gap: 10px;
}

.course-concepts > div {
  display: grid;
  padding: 16px;
  border: 1px solid #e6dac4;
  border-radius: 10px;
  align-items: start;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  background: #fff;
}

.course-concepts b {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  place-items: center;
  color: #fff;
  background: #1e6a67;
  font-size: 10px;
}

.course-concepts p,
.course-workflow p {
  margin: 0;
  color: #4f636d;
  font-size: 13px;
  line-height: 1.8;
}

.course-workflow {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: course-step;
  gap: 0;
}

.course-workflow li {
  position: relative;
  display: grid;
  min-height: 64px;
  padding-bottom: 18px;
  grid-template-columns: 38px 1fr;
  gap: 13px;
}

.course-workflow li:not(:last-child)::after {
  position: absolute;
  top: 32px;
  bottom: 0;
  left: 18px;
  width: 2px;
  content: "";
  background: #ddc98f;
}

.course-workflow li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  border: 2px solid #d9b54e;
  border-radius: 50%;
  place-items: center;
  color: #7d2d29;
  background: #fffaf0;
  font-size: 11px;
  font-weight: 900;
}

.course-prompt-card {
  border-color: #b9cfc7;
  background: linear-gradient(135deg, #eef7f2, #fffdf8 66%);
}

.course-prompt-card pre {
  margin: 0;
  padding: 19px;
  overflow: auto;
  border: 1px solid #bfd3ca;
  border-radius: 10px;
  color: #183f4a;
  background: rgba(255, 255, 255, .82);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.course-copy-button {
  min-height: 40px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1px solid #1e6660;
  border-radius: 8px;
  color: #fff;
  background: #1e6660;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.course-practice-card {
  border-top: 5px solid #d5ac42;
}

.course-practice {
  margin: 0;
  padding: 18px;
  border-radius: 10px;
  color: #643328;
  background: #f8ecd4;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
}

.course-checklist {
  display: flex;
  flex-wrap: wrap;
  margin-top: 14px;
  gap: 8px;
}

.course-checklist span {
  padding: 7px 10px;
  border: 1px solid #cddfd6;
  border-radius: 999px;
  color: #1d6557;
  background: #f3faf6;
  font-size: 10px;
  font-weight: 700;
}

.course-complete-panel {
  display: grid;
  margin-top: 22px;
  padding: 22px 24px;
  border-color: #d6b65c;
  align-items: center;
  grid-template-columns: 1fr auto;
  gap: 18px;
  background: linear-gradient(120deg, #fff6d9, #fffdf8);
}

.course-complete-panel.completed {
  border-color: #90c7b5;
  background: linear-gradient(120deg, #e9f6ef, #fffdf8);
}

.course-complete-panel span {
  color: #9c372f;
  font-size: 9px;
  font-weight: 900;
}

.course-complete-panel h3 {
  margin: 3px 0;
  color: #173c4f;
  font-size: 18px;
}

.course-complete-panel p {
  margin: 0;
  color: #687479;
  font-size: 11px;
}

.course-topic-pager {
  display: flex;
  padding: 20px 3px;
  justify-content: space-between;
}

.course-topic-pager a {
  color: #7e302b;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.course-assignment-panel {
  margin-top: 12px;
  border-top: 7px solid #97362e;
}

.course-assignment-head {
  padding: clamp(24px, 3.5vw, 38px);
  color: #fff;
  background: #123d51;
}

.course-assignment-head > span {
  color: #edcf72;
  font-size: 10px;
  font-weight: 900;
}

.course-assignment-head h2 {
  margin: 6px 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 36px);
}

.course-assignment-head p {
  max-width: 750px;
  margin: 0;
  color: rgba(255, 255, 255, .77);
  font-size: 12px;
  line-height: 1.8;
}

.course-assignment-lock {
  padding: 36px 24px;
  text-align: center;
}

.course-assignment-lock > span {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: #9b372f;
}

.course-assignment-lock strong {
  display: block;
  color: #153c4f;
  font-size: 17px;
}

.course-assignment-lock p {
  margin: 5px 0 0;
  color: #78858b;
  font-size: 11px;
}

.course-assignment-form {
  display: grid;
  padding: clamp(22px, 3.5vw, 38px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.course-assignment-form[hidden] {
  display: none;
}

.course-assignment-form label {
  display: grid;
  color: #2a4958;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
}

.course-assignment-form label:nth-of-type(3),
.course-assignment-form label:nth-of-type(4),
.course-assignment-form .course-consent,
.course-assignment-form button {
  grid-column: 1 / -1;
}

.course-assignment-form input,
.course-assignment-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #d6cbb8;
  border-radius: 8px;
  color: #193a4b;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.course-assignment-form input[type="file"] {
  min-height: 58px;
}

.course-assignment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.course-assignment-form label > small {
  color: #7b8588;
  font-weight: 400;
  line-height: 1.5;
}

.course-assignment-form .course-consent {
  display: flex;
  padding: 14px;
  border-radius: 8px;
  align-items: flex-start;
  background: #f5eddd;
  gap: 10px;
  line-height: 1.65;
}

.course-consent input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.course-submission-result {
  display: grid;
  margin: 24px;
  padding: 18px;
  border: 1px solid #a8d2bd;
  border-radius: 10px;
  background: #edf8f1;
  gap: 4px;
}

.course-submission-result strong {
  color: #166b53;
}

.course-submission-result small {
  color: #60756d;
}

.course-certificate-panel {
  display: grid;
  margin-top: 22px;
  padding: 24px;
  border-color: #d4b04e;
  align-items: center;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(255, 252, 238, .96), rgba(244, 228, 178, .92)),
    #fff8dc;
}

.course-certificate-panel[hidden] {
  display: none;
}

.course-certificate-mark {
  display: grid;
  width: 62px;
  height: 62px;
  border: 4px double #f4d679;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: #1f7a63;
  font-size: 24px;
}

.course-certificate-panel span {
  color: #97372f;
  font-size: 10px;
  font-weight: 900;
}

.course-certificate-panel h2 {
  margin: 3px 0;
  color: #153b4d;
  font-size: 22px;
}

.course-certificate-panel p {
  margin: 0;
  color: #756343;
  font-size: 11px;
}

.course-toast {
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 13px 17px;
  border: 1px solid #82b9a2;
  border-radius: 9px;
  color: #fff;
  background: #1d6e5b;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}

.course-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.course-toast.error {
  border-color: #d99a8e;
  background: #96382f;
}

.course-footer {
  margin-top: 0;
}

.course-not-found,
.certificate-not-found {
  display: grid;
  min-height: 100vh;
  padding: 30px;
  place-items: center;
  background: #f7f0e2;
}

.course-not-found > div,
.certificate-not-found-card {
  max-width: 620px;
  padding: 46px;
  border: 1px solid #ddcfb3;
  border-radius: 16px;
  text-align: center;
  background: #fffdf8;
}

/* Printable verifiable course certificate */
.certificate-page {
  min-height: 100vh;
  background: #eee5d5;
}

.certificate-toolbar {
  display: flex;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 0;
  justify-content: space-between;
}

.certificate-toolbar a,
.certificate-toolbar button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #9a7a3d;
  border-radius: 8px;
  color: #173c4f;
  background: #fffaf0;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.certificate-stage {
  display: grid;
  min-height: calc(100vh - 70px);
  padding: 22px;
  place-items: center;
}

.certificate-sheet {
  position: relative;
  width: min(1080px, 100%);
  aspect-ratio: 1.414 / 1;
  overflow: hidden;
  padding: clamp(34px, 5vw, 70px);
  color: #183b4c;
  background:
    radial-gradient(circle at 50% 45%, rgba(219, 181, 76, .13), transparent 32%),
    linear-gradient(135deg, #fffefa, #faf0d9);
  box-shadow: 0 24px 65px rgba(42, 40, 34, .2);
}

.certificate-border {
  position: absolute;
  inset: 17px;
  border: 3px double #b28a31;
  pointer-events: none;
}

.certificate-border::before {
  position: absolute;
  inset: 8px;
  border: 1px solid #8f332c;
  content: "";
}

.certificate-corner {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 28px solid rgba(18, 61, 80, .08);
  border-radius: 50%;
}

.certificate-corner-one {
  top: -100px;
  left: -100px;
}

.certificate-corner-two {
  right: -100px;
  bottom: -100px;
}

.certificate-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: left;
}

.certificate-head img {
  width: clamp(70px, 8vw, 105px);
  height: clamp(70px, 8vw, 105px);
  object-fit: contain;
}

.certificate-head strong,
.certificate-head span {
  display: block;
}

.certificate-head strong {
  font-size: clamp(15px, 2vw, 25px);
}

.certificate-head span {
  margin-top: 3px;
  color: #8b6b33;
  font-size: clamp(9px, 1.1vw, 13px);
}

.certificate-copy {
  margin-top: clamp(18px, 2.5vw, 34px);
  text-align: center;
}

.certificate-kicker,
.certificate-statement,
.certificate-school {
  margin: 0;
}

.certificate-kicker {
  color: #86652c;
  font-size: clamp(12px, 1.45vw, 17px);
}

.certificate-copy h1 {
  display: inline-block;
  min-width: 58%;
  margin: 10px 0 3px;
  padding: 0 25px 5px;
  border-bottom: 1px solid #b99444;
  color: #872f2a;
  font-size: clamp(28px, 4.3vw, 54px);
  line-height: 1.25;
}

.certificate-school {
  color: #5f6a6c;
  font-size: clamp(10px, 1.2vw, 14px);
}

.certificate-statement {
  margin-top: clamp(13px, 1.7vw, 21px);
  color: #5c6668;
  font-size: clamp(10px, 1.3vw, 15px);
}

.certificate-copy h2 {
  max-width: 850px;
  margin: 7px auto;
  color: #133c50;
  font-size: clamp(18px, 2.7vw, 34px);
  line-height: 1.35;
}

.certificate-footer {
  display: grid;
  margin-top: clamp(18px, 2.8vw, 34px);
  align-items: end;
  grid-template-columns: 1fr auto 1fr;
  gap: 35px;
}

.certificate-date,
.certificate-sign {
  display: grid;
  text-align: center;
  gap: 3px;
}

.certificate-date span,
.certificate-sign small {
  color: #7b6d54;
  font-size: clamp(8px, 1vw, 11px);
}

.certificate-date strong,
.certificate-sign strong {
  font-size: clamp(10px, 1.2vw, 14px);
}

.certificate-seal {
  display: grid;
  width: clamp(82px, 9vw, 112px);
  height: clamp(82px, 9vw, 112px);
  border: 5px double #e4c463;
  border-radius: 50%;
  place-items: center;
  align-content: center;
  color: #f6df8e;
  background: #123d51;
  box-shadow: 0 0 0 4px #8e312b;
}

.certificate-seal span,
.certificate-seal small {
  font-size: clamp(7px, .8vw, 10px);
}

.certificate-seal strong {
  font-size: clamp(15px, 1.7vw, 21px);
}

.certificate-sign-line {
  display: block;
  width: min(240px, 100%);
  height: 30px;
  margin: 0 auto 4px;
  border-bottom: 1px solid #947944;
}

.certificate-verify {
  position: absolute;
  right: clamp(38px, 5vw, 70px);
  bottom: clamp(30px, 4vw, 53px);
  left: clamp(38px, 5vw, 70px);
  display: flex;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 121, 68, .35);
  justify-content: space-between;
  color: #766b59;
  font-size: clamp(6px, .72vw, 9px);
}

@media (max-width: 900px) {
  .course-progress-banner {
    grid-template-columns: 1fr auto;
  }

  .course-progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .course-layout {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: static;
  }

  .course-topic-nav {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(175px, 1fr));
  }

  .course-topic-nav a {
    min-height: 76px;
  }
}

@media (max-width: 680px) {
  .course-page .lesson-nav {
    display: none;
  }

  .course-page .top-actions .btn-outline-light {
    display: none;
  }

  .course-hero,
  .course-hero-inner {
    min-height: 360px;
  }

  .course-hero h1 {
    font-size: 34px;
  }

  .course-progress-banner {
    margin-right: 12px;
    margin-left: 12px;
    padding: 16px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .course-progress-banner .btn {
    width: 100%;
  }

  .course-layout {
    padding-top: 26px;
  }

  .course-topic-heading {
    padding: 22px 18px;
  }

  .course-topic-heading h2 {
    font-size: 28px;
  }

  .course-outcome {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .course-content-card {
    padding: 20px 16px;
  }

  .course-complete-panel,
  .course-certificate-panel {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .course-complete-panel .btn,
  .course-certificate-panel .btn {
    width: 100%;
  }

  .course-certificate-mark {
    margin: 0 auto;
  }

  .course-assignment-form {
    grid-template-columns: 1fr;
  }

  .course-assignment-form label,
  .course-assignment-form button {
    grid-column: auto !important;
  }

  .certificate-stage {
    padding: 10px;
  }

  .certificate-sheet {
    min-height: 690px;
    aspect-ratio: auto;
    padding: 45px 32px;
  }

  .certificate-head {
    text-align: center;
    flex-direction: column;
  }

  .certificate-footer {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .certificate-seal {
    margin: auto;
    grid-row: 1;
  }

  .certificate-verify {
    position: static;
    margin-top: 18px;
    flex-direction: column;
    gap: 4px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  .certificate-page {
    background: #fff;
  }

  .certificate-toolbar {
    display: none !important;
  }

  .certificate-stage {
    min-height: auto;
    padding: 0;
  }

  .certificate-sheet {
    width: 297mm;
    height: 210mm;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ==========================================================
   Desktop full-width layout
   Use the available monitor width without affecting tablets
   or mobile layouts. A fluid outer gutter keeps content clear
   of the browser edge on every desktop resolution.
   ========================================================== */
@media (min-width: 1024px) and (any-hover: hover) and (any-pointer: fine) {
  body.thai-heritage-theme {
    --pb1-desktop-gutter: clamp(16px, 1.5vw, 32px);
  }

  body.thai-heritage-theme .site-shell,
  body.thai-heritage-theme .topbar-inner,
  body.thai-heritage-theme .hero-inner,
  body.thai-heritage-theme .public-content,
  body.thai-heritage-theme .admin-container,
  body.thai-heritage-theme .admin-top-inner {
    width: calc(100% - (var(--pb1-desktop-gutter) * 2));
    max-width: none;
  }
}

@media (min-width: 1600px) {
  body.thai-heritage-theme .media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.media-detail-v2 .media-v2-hero-grid {
    grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
  }

  body.media-detail-v2 .media-v2-content-grid {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
}

/* Media detail v2 — unified with the Thai heritage front page */
body.media-detail-v2 {
  min-height: 100vh;
  color: #173a4d;
  background:
    radial-gradient(circle at 8% 16%, rgba(197, 158, 68, .09), transparent 24%),
    linear-gradient(180deg, #f7f1e6 0, #fffdf8 46%, #f6efe2 100%);
}

.media-detail-v2 .media-v2-topbar {
  top: 0;
}

.media-detail-v2 .main-nav a.is-active {
  color: #fff9e7;
  border-color: #8c2d24;
  background: linear-gradient(145deg, #9b382e, #74241e);
  box-shadow: 0 7px 16px rgba(83, 31, 25, .18);
}

.media-detail-v2 .media-header-library {
  min-width: 132px;
}

.media-v2-hero {
  position: relative;
  min-height: 690px;
  overflow: hidden;
  color: #fff;
  background: #0a3042;
}

.media-v2-hero::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 15px;
  pointer-events: none;
  background:
    linear-gradient(135deg, #fff9e9 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(225deg, #fff9e9 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(135deg, #9a342a 25%, transparent 25%) 14px 0 / 28px 28px,
    linear-gradient(225deg, #d1ae55 25%, transparent 25%) 14px 0 / 28px 28px;
}

.media-v2-hero-backdrop,
.media-v2-not-found-backdrop {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 37, 52, .98) 0%, rgba(7, 43, 59, .91) 44%, rgba(8, 34, 45, .65) 100%),
    linear-gradient(180deg, rgba(5, 35, 49, .12), rgba(5, 35, 49, .7)),
    url("hero-media-library.webp") center 43% / cover no-repeat;
  transform: scale(1.025);
}

.media-v2-hero-backdrop::before,
.media-v2-not-found-backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 74% 24%, rgba(236, 199, 105, .25), transparent 18%),
    linear-gradient(112deg, transparent 28%, rgba(255, 229, 166, .09) 48%, transparent 66%);
  animation: pb1-media-v2-light 9s ease-in-out infinite alternate;
}

.media-v2-hero-inner {
  position: relative;
  z-index: 3;
  padding-top: 28px;
  padding-bottom: 70px;
}

.media-v2-breadcrumb {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
}

.media-v2-breadcrumb a {
  color: #f3d779;
  text-decoration: none;
}

.media-v2-breadcrumb a:hover {
  color: #fff;
}

.media-v2-breadcrumb > span:last-child {
  max-width: min(520px, 50vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-v2-hero-grid {
  display: grid;
  grid-template-columns: minmax(330px, 460px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(42px, 6vw, 88px);
}

.media-v2-visual {
  position: relative;
}

.media-v2-cover-button,
.media-v2-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(229, 199, 121, .72);
  border-radius: 7px 7px 28px 7px;
  background: #f5ead1;
  box-shadow:
    0 34px 75px rgba(0, 0, 0, .3),
    12px 12px 0 rgba(229, 199, 121, .14);
}

.media-v2-cover-button {
  padding: 0;
  cursor: zoom-in;
}

.media-v2-cover-button::before,
.media-v2-placeholder::before,
.media-v2-guide::before,
.media-v2-overview::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  height: 9px;
  pointer-events: none;
  background: repeating-linear-gradient(135deg, #8b2c24 0 10px, #d3ae52 10px 20px, #173e50 20px 30px);
}

.media-v2-cover-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .4s ease;
}

.media-v2-cover-button:hover img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.02);
}

.media-v2-zoom {
  position: absolute;
  right: 17px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 50%;
  color: #fff;
  background: rgba(8, 43, 58, .78);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
  transition: transform .25s ease, background-color .25s ease;
}

.media-v2-zoom svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.media-v2-cover-button:hover .media-v2-zoom {
  background: #8f3027;
  transform: scale(1.08);
}

.media-v2-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 36px;
  color: #163d50;
  text-align: center;
  background:
    radial-gradient(circle at 82% 18%, rgba(211, 174, 82, .4), transparent 28%),
    linear-gradient(145deg, #fffaf0, #eadbb9);
}

.media-v2-placeholder-pattern {
  position: absolute;
  inset: 0;
  opacity: .2;
  background:
    linear-gradient(45deg, transparent 46%, #8b2c24 47% 49%, transparent 50%) 0 0 / 38px 38px,
    linear-gradient(-45deg, transparent 46%, #173e50 47% 49%, transparent 50%) 0 0 / 38px 38px;
}

.media-v2-type-symbol {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border: 1px solid #c69e40;
  border-radius: 50% 50% 48% 48% / 58% 58% 42% 42%;
  color: #fff8e3;
  background: linear-gradient(145deg, #1b5367, #0c3547);
  box-shadow:
    inset 0 0 0 7px rgba(229, 199, 121, .14),
    0 18px 34px rgba(35, 50, 43, .2);
  font-family: Georgia, serif;
  font-size: 51px;
}

.media-v2-placeholder small,
.media-v2-placeholder strong,
.media-v2-placeholder > span:last-child {
  position: relative;
}

.media-v2-placeholder small {
  color: #8c3329;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
}

.media-v2-placeholder strong {
  margin: 4px 0;
  font-size: 25px;
}

.media-v2-placeholder > span:last-child {
  color: #6c6657;
  font-size: 11px;
}

.media-v2-verified {
  position: absolute;
  z-index: 4;
  right: -22px;
  bottom: -28px;
  min-width: 244px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 17px;
  border: 1px solid #dfc16e;
  border-radius: 4px 4px 16px 4px;
  color: #183d4e;
  background: #fffaf0;
  box-shadow: 0 18px 35px rgba(1, 23, 33, .26);
}

.media-v2-verified > span {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #218459;
  box-shadow: 0 0 0 5px rgba(33, 132, 89, .12);
}

.media-v2-verified div {
  display: grid;
}

.media-v2-verified strong {
  font-size: 12px;
}

.media-v2-verified small {
  color: #697a80;
  font-size: 9px;
}

.media-v2-copy {
  max-width: 700px;
}

.media-v2-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: #f3d779;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}

.media-v2-kicker span {
  padding: 6px 10px;
  border: 1px solid rgba(229, 199, 121, .45);
  border-radius: 999px;
  color: #442019;
  background: #e4c76f;
}

.media-v2-kicker b {
  color: rgba(255, 255, 255, .65);
  font-weight: 600;
}

.media-detail-v2 .media-detail-tags {
  margin-bottom: 15px;
}

.media-detail-v2 .media-detail-tags span {
  border-color: rgba(229, 199, 121, .42);
  color: #fff6dd;
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(7px);
}

.media-v2-copy h1 {
  max-width: 760px;
  margin: 0;
  color: #fffdf7;
  font-size: clamp(36px, 4.6vw, 66px);
  line-height: 1.2;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.media-v2-owner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.media-v2-owner-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #e4c66f;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #9b382e, #6f241e);
  font-weight: 900;
}

.media-v2-owner > div {
  display: grid;
}

.media-v2-owner small {
  color: rgba(255, 255, 255, .62);
  font-size: 9px;
}

.media-v2-owner strong {
  color: #fff;
  font-size: 13px;
}

.media-v2-owner div span {
  color: #e8d79e;
  font-size: 10px;
}

.media-detail-v2 .media-detail-description {
  max-width: 650px;
  margin: 20px 0 25px;
  color: rgba(255, 255, 255, .83);
  font-size: 14px;
  line-height: 1.9;
}

.media-v2-actions {
  justify-content: flex-start;
  margin: 0;
}

.media-v2-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  gap: 9px;
  text-align: center;
}

.media-v2-actions svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-v2-primary-action {
  min-width: 220px;
}

.media-v2-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 24px;
  color: rgba(255, 255, 255, .65);
  font-size: 9px;
}

.media-v2-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.media-v2-trust i {
  color: #dfbd5e;
  font-style: normal;
}

.media-v2-main {
  padding-top: 64px;
  padding-bottom: 75px;
}

.media-v2-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
  gap: 24px;
}

.media-v2-overview,
.media-v2-guide,
.media-v2-quality,
.media-v2-rights {
  position: relative;
  overflow: hidden;
  border: 1px solid #dfd4bd;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 16px 38px rgba(73, 54, 28, .08);
}

.media-v2-overview {
  padding: clamp(26px, 4vw, 45px);
  border-radius: 5px 5px 22px 5px;
}

.media-v2-overview .section-heading {
  margin-bottom: 26px;
}

.media-v2-overview .section-heading h2,
.media-v2-guide h2,
.media-v2-related .section-heading h2 {
  color: #143c50;
}

.media-v2-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.media-v2-facts > div {
  min-height: 116px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 4px 11px;
  padding: 15px;
  border: 1px solid #e4d9c4;
  border-radius: 4px 4px 13px 4px;
  background: linear-gradient(145deg, #fffdf8, #f8f2e7);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.media-v2-facts > div:hover {
  border-color: #c7a654;
  box-shadow: 0 12px 25px rgba(87, 58, 25, .1);
  transform: translateY(-3px);
}

.media-v2-fact-icon {
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #d1af58;
  border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  color: #8b3027;
  background: #fff8e7;
}

.media-v2-fact-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-v2-facts dt {
  color: #7a807c;
  font-size: 9px;
}

.media-v2-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #163b4d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.media-v2-counter {
  font-size: 22px !important;
  font-variant-numeric: tabular-nums;
}

.media-v2-keywords {
  margin-top: 24px;
  padding: 21px;
  border-left: 3px solid #9a342a;
  border-radius: 0 12px 12px 0;
  background: #faf5ea;
}

.media-v2-keywords h3 {
  margin: 0 0 11px;
  color: #173e50;
  font-size: 13px;
}

.media-v2-keywords > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.media-v2-keywords span {
  padding: 6px 10px;
  border: 1px solid #dfcfa9;
  border-radius: 999px;
  color: #6d332b;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.media-v2-transcript {
  margin-top: 18px;
  border: 1px solid #d9c99f;
  border-radius: 6px 6px 15px 6px;
  background: #fffdf8;
}

.media-v2-transcript summary {
  display: grid;
  grid-template-columns: 40px 1fr 28px;
  align-items: center;
  gap: 11px;
  padding: 15px 17px;
  list-style: none;
  cursor: pointer;
}

.media-v2-transcript summary::-webkit-details-marker {
  display: none;
}

.media-v2-transcript summary > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #173e50;
  font-weight: 900;
}

.media-v2-transcript summary > div {
  display: grid;
}

.media-v2-transcript summary strong {
  color: #173e50;
  font-size: 12px;
}

.media-v2-transcript summary small {
  color: #7b8689;
  font-size: 9px;
}

.media-v2-transcript summary b {
  color: #8b3027;
  font-size: 22px;
  text-align: center;
  transition: transform .25s ease;
}

.media-v2-transcript[open] summary b {
  transform: rotate(45deg);
}

.media-v2-transcript > div {
  padding: 17px 22px 22px;
  border-top: 1px solid #e6dcc5;
  color: #445a64;
  font-size: 12px;
  line-height: 1.85;
}

.media-v2-sidebar {
  display: grid;
  gap: 14px;
}

.media-v2-guide {
  padding: 29px;
  border-radius: 5px 5px 19px 5px;
}

.media-v2-guide h2 {
  margin: 8px 0 22px;
  font-size: 23px;
}

.media-v2-guide ol {
  display: grid;
  gap: 0;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.media-v2-guide li {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 0 0 18px;
}

.media-v2-guide li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 41px;
  bottom: 2px;
  width: 1px;
  background: #dccb9f;
}

.media-v2-guide li > span {
  width: 42px;
  height: 42px;
  display: grid;
  z-index: 1;
  place-items: center;
  border: 1px solid #d3af55;
  border-radius: 50%;
  color: #fff8e3;
  background: linear-gradient(145deg, #9b382e, #6e241e);
  font-size: 14px;
  font-weight: 900;
}

.media-v2-guide li div {
  display: grid;
  align-content: start;
  padding-top: 3px;
}

.media-v2-guide li strong {
  color: #183f51;
  font-size: 12px;
}

.media-v2-guide li small {
  color: #788489;
  font-size: 9px;
  line-height: 1.55;
}

.media-v2-guide .btn {
  width: 100%;
}

.media-v2-quality {
  padding: 21px;
  border-radius: 5px 5px 16px 5px;
}

.media-v2-quality-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.media-v2-quality-head > div {
  display: grid;
}

.media-v2-quality-head small {
  color: #798488;
  font-size: 9px;
}

.media-v2-quality-head strong {
  color: #173e50;
  font-size: 21px;
}

.media-v2-quality-head > span {
  color: #8f3027;
  font-size: 11px;
  font-weight: 900;
}

.media-v2-quality-track {
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e0d1;
}

.media-v2-quality-track i {
  display: block;
  width: var(--quality-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8f3027, #d6b354);
  transform: scaleX(0);
  transform-origin: left;
}

.media-v2-quality-track i.show {
  animation: pb1-media-quality 1s .3s cubic-bezier(.2, .8, .2, 1) forwards;
}

.media-v2-quality p,
.media-v2-rights p {
  margin: 0;
  color: #778287;
  font-size: 9px;
  line-height: 1.65;
}

.media-v2-rights {
  display: grid;
  grid-template-columns: 43px 1fr;
  gap: 13px;
  padding: 19px;
  border-radius: 5px 5px 16px 5px;
  color: #fff;
  background: linear-gradient(145deg, #173f51, #0a3042);
}

.media-v2-rights > span {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  border: 1px solid #d2b35d;
  border-radius: 50%;
  color: #f1d577;
  font-family: Georgia, serif;
  font-size: 20px;
}

.media-v2-rights strong {
  display: block;
  margin-bottom: 3px;
  color: #fff;
  font-size: 11px;
}

.media-v2-rights p {
  color: rgba(255, 255, 255, .66);
}

.media-v2-related {
  margin-top: 58px;
  padding-top: 32px;
  border-top: 1px solid #d9c89f;
}

.media-v2-related .section-heading > a {
  color: #8b3027;
  font-size: 11px;
  font-weight: 800;
}

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

.media-v2-related-card {
  position: relative;
  min-height: 125px;
  display: grid;
  grid-template-columns: 125px 1fr 30px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #dfd3bb;
  border-radius: 5px 5px 16px 5px;
  color: inherit;
  background: #fffdf8;
  box-shadow: 0 10px 25px rgba(76, 54, 29, .07);
  text-decoration: none;
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.media-v2-related-card:hover {
  border-color: #c8a448;
  box-shadow: 0 17px 34px rgba(76, 54, 29, .13);
  transform: translateY(-4px);
}

.media-v2-related-visual {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f7dfa0;
  background:
    radial-gradient(circle at 75% 15%, rgba(229, 199, 121, .32), transparent 28%),
    linear-gradient(145deg, #173f51, #092c3d);
}

.media-v2-related-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.media-v2-related-card:hover .media-v2-related-visual img {
  transform: scale(1.06);
}

.media-v2-related-visual b {
  font-family: Georgia, serif;
  font-size: 38px;
}

.media-v2-related-body {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 18px;
}

.media-v2-related-body small {
  color: #8a3028;
  font-size: 9px;
  font-weight: 800;
}

.media-v2-related-body strong {
  overflow: hidden;
  color: #173e50;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-v2-related-body span {
  color: #7a8589;
  font-size: 9px;
}

.media-v2-related-card > i {
  align-self: center;
  color: #a1372e;
  font-size: 28px;
  font-style: normal;
  transition: transform .25s ease;
}

.media-v2-related-card:hover > i {
  transform: translateX(4px);
}

.media-v2-footer {
  margin-top: 0;
}

.media-v2-not-found {
  position: relative;
  min-height: 700px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: #0a3042;
}

.media-v2-not-found-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  display: grid;
  justify-items: center;
  padding-top: 70px;
  padding-bottom: 90px;
  text-align: center;
}

.media-v2-not-found-mark {
  position: relative;
  width: 155px;
  height: 155px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(229, 199, 121, .58);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 10px rgba(229, 199, 121, .05);
}

.media-v2-not-found-mark span {
  color: #f0d372;
  font-family: Georgia, serif;
  font-size: 37px;
  font-weight: 900;
}

.media-v2-not-found-mark b {
  position: absolute;
  top: -7px;
  color: #f0d372;
  font-size: 18px;
  transform-origin: 8px 84px;
  animation: pb1-empty-orbit 6s linear infinite;
}

.media-v2-not-found h1 {
  margin: 8px 0 12px;
  color: #fff;
  font-size: clamp(36px, 5vw, 62px);
}

.media-v2-not-found p {
  max-width: 620px;
  margin: 0 0 25px;
  color: rgba(255, 255, 255, .74);
  line-height: 1.8;
}

.media-v2-toast {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: 24px;
  max-width: min(90vw, 430px);
  padding: 11px 17px;
  border: 1px solid #dbbd67;
  border-radius: 999px;
  color: #fff;
  background: #173e50;
  box-shadow: 0 15px 35px rgba(3, 26, 37, .28);
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 15px);
  transition: opacity .25s ease, visibility .25s ease, transform .3s ease;
}

.media-v2-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.media-v2-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .65s cubic-bezier(.2, .75, .2, 1), transform .7s cubic-bezier(.2, .75, .2, 1);
}

.media-v2-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pb1-media-v2-light {
  from { opacity: .4; transform: translateX(-5%) scale(.98); }
  to { opacity: .85; transform: translateX(6%) scale(1.04); }
}

@keyframes pb1-media-quality {
  to { transform: scaleX(1); }
}

@media (max-width: 1050px) {
  .media-v2-hero {
    min-height: auto;
  }

  .media-v2-hero-grid {
    grid-template-columns: minmax(270px, 380px) minmax(0, 1fr);
    gap: 42px;
  }

  .media-v2-copy h1 {
    font-size: clamp(34px, 4.6vw, 50px);
  }

  .media-v2-content-grid {
    grid-template-columns: 1fr;
  }

  .media-v2-sidebar {
    grid-template-columns: 1.3fr 1fr 1fr;
    align-items: stretch;
  }

  .media-v2-guide {
    grid-row: span 2;
  }
}

@media (max-width: 760px) {
  .media-detail-v2 .media-header-library .desktop-label {
    display: none;
  }

  .media-detail-v2 .media-header-library .mobile-label {
    display: inline;
  }

  .media-v2-hero-inner {
    padding-top: 19px;
    padding-bottom: 55px;
  }

  .media-v2-breadcrumb {
    margin-bottom: 18px;
  }

  .media-v2-breadcrumb > span:last-child {
    max-width: 48vw;
  }

  .media-v2-hero-grid {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .media-v2-visual {
    max-width: 520px;
    margin-inline: auto;
  }

  .media-v2-copy {
    text-align: left;
  }

  .media-v2-copy h1 {
    font-size: clamp(33px, 10vw, 48px);
  }

  .media-v2-verified {
    right: 12px;
  }

  .media-v2-main {
    padding-top: 42px;
    padding-bottom: 55px;
  }

  .media-v2-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-v2-sidebar {
    grid-template-columns: 1fr;
  }

  .media-v2-related-grid {
    grid-template-columns: 1fr;
  }
}

/* ICT Center card on the public home page */
body.thai-heritage-theme:not(.high-contrast) .ict-center-column {
  position: relative;
  overflow: hidden;
  border-color: rgba(202, 166, 83, .56);
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(240, 201, 92, .2), transparent 15rem),
    linear-gradient(145deg, #0c3850, #105b68 66%, #176f72);
  box-shadow: 0 18px 42px rgba(9, 47, 64, .16);
}

.ict-center-column::after {
  position: absolute;
  right: -54px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

body.thai-heritage-theme .ict-center-column .section-kicker {
  color: #f4d77d;
}

body.thai-heritage-theme .ict-center-column .highlight-head h2 {
  color: #fff;
}

body.thai-heritage-theme:not(.high-contrast) .ict-center-column .highlight-head > a {
  position: relative;
  z-index: 1;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, .1);
}

.ict-center-intro {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 0 17px;
  color: rgba(255, 255, 255, .82);
  line-height: 1.65;
}

.ict-submenu {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ict-submenu > a {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 13px;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, .09);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.ict-submenu > a:hover,
.ict-submenu > a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(244, 215, 125, .72);
  background: rgba(255, 255, 255, .16);
}

.ict-submenu-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: #17384f;
  background: #f4d77d;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.ict-video-icon {
  color: #fff;
  background: #bd3c57;
}

.ict-submenu strong,
.ict-submenu small {
  display: block;
}

.ict-submenu strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ict-submenu small {
  margin-top: 2px;
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
  line-height: 1.35;
}

.ict-submenu i {
  color: #f4d77d;
  font-style: normal;
  font-weight: 900;
}

@media (max-width: 1160px) and (min-width: 821px) {
  .ict-submenu {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .ict-submenu {
    grid-template-columns: 1fr;
  }
}

/* Recommended media card on the public home page */
body.thai-heritage-theme:not(.high-contrast) .recommended-media-column {
  position: relative;
  overflow: hidden;
  border-color: #d8c7a8;
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 201, 92, .19), transparent 15rem),
    linear-gradient(160deg, #fffdf8, #f8f2e7);
  box-shadow: 0 18px 42px rgba(78, 55, 29, .1);
}

.recommended-media-column::after {
  position: absolute;
  right: -70px;
  bottom: -82px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(169, 117, 38, .13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

body.thai-heritage-theme:not(.high-contrast) .recommended-media-column .highlight-head > a {
  position: relative;
  z-index: 1;
  padding: 8px 12px;
  border: 1px solid #d4c09d;
  border-radius: 999px;
  color: #8c3027;
  text-decoration: none;
  background: rgba(255, 255, 255, .72);
}

.recommended-media-intro {
  position: relative;
  z-index: 1;
  margin: 0 0 17px;
  color: #657681;
  line-height: 1.65;
}

.recommended-guide-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 11px;
}

.recommended-guide-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid #e1d5c1;
  border-radius: 15px;
  color: #17384f;
  text-decoration: none;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 22px rgba(79, 57, 30, .06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.recommended-guide-card:hover,
.recommended-guide-card:focus-visible {
  transform: translateY(-2px);
  border-color: #c89f45;
  box-shadow: 0 13px 28px rgba(79, 57, 30, .11);
}

.recommended-guide-badge {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #15536d, #0b7880);
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.game-guide .recommended-guide-badge {
  background: linear-gradient(145deg, #a72d59, #d95771);
}

.recommended-guide-copy small,
.recommended-guide-copy strong,
.recommended-guide-copy em {
  display: block;
}

.recommended-guide-copy small {
  color: #9b7626;
  font-size: 11px;
  font-weight: 900;
}

.recommended-guide-copy strong {
  margin-top: 2px;
  font-size: 17px;
  line-height: 1.35;
}

.recommended-guide-copy em {
  margin-top: 3px;
  color: #6a7b86;
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.recommended-guide-card > i {
  color: #a72d59;
  font-style: normal;
  font-size: 20px;
  font-weight: 900;
}

.recommended-media-source-links {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  margin-top: 14px;
}

.recommended-media-source-links a {
  color: #8c3027;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 520px) {
  .recommended-guide-card {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    padding: 12px;
  }

  .recommended-guide-badge {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 520px) {
  .media-v2-hero-grid {
    gap: 54px;
  }

  .media-v2-visual {
    width: calc(100% - 2px);
  }

  .media-v2-placeholder {
    padding: 25px;
  }

  .media-v2-type-symbol {
    width: 86px;
    height: 86px;
    font-size: 38px;
  }

  .media-v2-verified {
    left: 13px;
    right: 13px;
    bottom: -30px;
    min-width: 0;
  }

  .media-v2-kicker {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .media-v2-actions {
    display: grid;
  }

  .media-v2-actions .btn {
    width: 100%;
  }

  .media-v2-trust {
    display: grid;
    gap: 8px;
  }

  .media-v2-overview {
    padding: 25px 18px;
  }

  .media-v2-facts {
    grid-template-columns: 1fr;
  }

  .media-v2-facts > div {
    min-height: 90px;
  }

  .media-v2-related-card {
    grid-template-columns: 92px 1fr 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .media-v2-hero-backdrop::before,
  .media-v2-not-found-backdrop::before,
  .media-v2-not-found-mark b,
  .media-v2-quality-track i.show {
    animation: none !important;
  }

  .media-v2-quality-track i {
    transform: none !important;
  }

  .media-v2-reveal,
  .media-v2-reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

@media print {
  .media-detail-v2 .agency-strip,
  .media-detail-v2 .topbar,
  .media-detail-v2 .site-footer,
  .media-detail-v2 .back-to-top,
  .media-v2-actions,
  .media-v2-trust,
  .media-v2-related {
    display: none !important;
  }

  .media-v2-hero {
    min-height: auto;
    color: #111;
    background: #fff;
  }

  .media-v2-hero-backdrop {
    display: none;
  }

  .media-v2-copy h1,
  .media-detail-v2 .media-detail-description,
  .media-v2-owner strong {
    color: #111;
  }

  .media-v2-content-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   Thai contemporary institutional theme
   Inspired by Phetchabun landscape, Thai craft and temple form
   ========================================================== */
body.thai-heritage-theme {
  --navy: #17384f;
  --navy-2: #244e66;
  --blue: #315f72;
  --blue-soft: #edf2ef;
  --gold: #caa653;
  --gold-deep: #9d772a;
  --gold-soft: #f6ead0;
  --ink: #26362f;
  --muted: #667069;
  --line: #ddd3bf;
  --surface: #fffdf8;
  --bg: #f7f2e8;
  --thai-red: #932f25;
  --thai-red-deep: #69241e;
  --thai-jade: #416d60;
  --thai-ivory: #fffaf0;
  --thai-silk: #eee1c7;
  --shadow: 0 18px 46px rgba(61, 47, 28, .11);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 14%, rgba(202, 166, 83, .08), transparent 28rem),
    radial-gradient(circle at 94% 42%, rgba(147, 47, 37, .055), transparent 30rem),
    var(--bg);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}

body.thai-heritage-theme:not(.high-contrast) .agency-strip {
  position: relative;
  color: #f8e9ca;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .025) 50%, transparent 50%) 0 0 / 28px 28px,
    #67261f;
  border-bottom: 1px solid rgba(235, 203, 129, .45);
}

body.thai-heritage-theme:not(.high-contrast) .agency-strip::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e5c779 18%, #e5c779 82%, transparent);
}

body.thai-heritage-theme .agency-strip-inner {
  min-height: 34px;
}

body.thai-heritage-theme:not(.high-contrast) .agency-strip-meta {
  color: #e6cfa8;
}

body.thai-heritage-theme:not(.high-contrast) .topbar {
  color: #24372f;
  background: rgba(255, 252, 244, .97);
  border-bottom: 0;
  box-shadow: 0 9px 28px rgba(63, 47, 26, .09);
}

body.thai-heritage-theme:not(.high-contrast) .topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background:
    linear-gradient(90deg, #76271f 0 12%, #d0aa54 12% 16%, #17384f 16% 84%, #d0aa54 84% 88%, #76271f 88% 100%);
}

body.thai-heritage-theme .topbar-inner {
  min-height: 88px;
}

body.thai-heritage-theme .brand {
  gap: 14px;
}

body.thai-heritage-theme:not(.high-contrast) .brand-logo {
  position: relative;
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  color: #fff9e9;
  background:
    radial-gradient(circle, #17384f 0 53%, transparent 54%),
    conic-gradient(from 22.5deg, #caa653 0 12.5%, #6d251f 12.5% 25%, #caa653 25% 37.5%, #6d251f 37.5% 50%, #caa653 50% 62.5%, #6d251f 62.5% 75%, #caa653 75% 87.5%, #6d251f 87.5% 100%);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fffaf0, 0 0 0 4px #caa653, 0 7px 20px rgba(60, 39, 17, .14);
}

body.thai-heritage-theme:not(.high-contrast) .brand-logo::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(234, 203, 126, .62);
  border-radius: inherit;
}

body.thai-heritage-theme .brand-logo span,
body.thai-heritage-theme .brand-logo strong {
  position: relative;
  z-index: 1;
}

body.thai-heritage-theme .brand-title {
  color: #17384f;
  font-size: 17px;
  letter-spacing: -.01em;
}

body.thai-heritage-theme .brand-subtitle {
  color: #74695a;
}

body.thai-heritage-theme .main-nav {
  gap: 0;
}

body.thai-heritage-theme .main-nav a {
  padding-inline: 10px;
  color: #4c5049;
  border-radius: 2px;
  font-weight: 700;
}

body.thai-heritage-theme:not(.high-contrast) .main-nav a::after {
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, #a63428 18%, #caa653 50%, #a63428 82%, transparent);
}

body.thai-heritage-theme:not(.high-contrast) .main-nav a:hover {
  color: var(--thai-red);
  background: #f7edde;
}

body.thai-heritage-theme .btn {
  border-radius: 7px;
}

body.thai-heritage-theme:not(.high-contrast) .btn-primary,
body.thai-heritage-theme:not(.high-contrast) .btn-navy,
body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-primary-action {
  color: #fffaf0;
  border-color: var(--thai-red);
  background: linear-gradient(135deg, #a43a2f, #7b2922);
  box-shadow: 0 7px 18px rgba(121, 38, 31, .18);
}

body.thai-heritage-theme:not(.high-contrast) .btn-primary:hover,
body.thai-heritage-theme:not(.high-contrast) .btn-navy:hover,
body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-primary-action:hover {
  background: linear-gradient(135deg, #b34638, #70231d);
  box-shadow: 0 10px 24px rgba(121, 38, 31, .24);
}

body.thai-heritage-theme:not(.high-contrast) .btn-gold {
  color: #352915;
  border-color: #d6b664;
  background: linear-gradient(135deg, #ecd489, #cda649);
  box-shadow: 0 7px 20px rgba(111, 80, 19, .18);
}

body.thai-heritage-theme:not(.high-contrast) .btn-outline-light {
  color: #17384f;
  border-color: #9c8b6d;
  background: rgba(255, 252, 244, .62);
}

body.thai-heritage-theme:not(.high-contrast) .hero {
  min-height: 650px;
  color: #fff9ef;
  background: #112f43;
  border-bottom: 7px solid #caa653;
}

body.thai-heritage-theme:not(.high-contrast) .hero-backdrop {
  background: url("hero-thai-heritage-v1.webp") center right / cover no-repeat;
  transform: scale(1.01);
}

body.thai-heritage-theme:not(.high-contrast) .hero::before {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(12, 35, 51, .98) 0%, rgba(17, 46, 64, .92) 36%, rgba(23, 56, 79, .58) 58%, rgba(23, 56, 79, .08) 100%),
    linear-gradient(0deg, rgba(68, 30, 25, .34), transparent 44%);
}

body.thai-heritage-theme:not(.high-contrast) .hero::after {
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34px;
  border-radius: 0;
  background:
    linear-gradient(135deg, transparent 33.33%, rgba(255, 249, 232, .96) 33.33% 66.66%, transparent 66.66%) 0 0 / 30px 30px,
    linear-gradient(45deg, transparent 33.33%, rgba(202, 166, 83, .95) 33.33% 66.66%, transparent 66.66%) 15px 0 / 30px 30px,
    #76271f;
  clip-path: polygon(0 55%, 1.5% 18%, 3% 55%, 4.5% 18%, 6% 55%, 7.5% 18%, 9% 55%, 10.5% 18%, 12% 55%, 13.5% 18%, 15% 55%, 16.5% 18%, 18% 55%, 19.5% 18%, 21% 55%, 22.5% 18%, 24% 55%, 25.5% 18%, 27% 55%, 28.5% 18%, 30% 55%, 31.5% 18%, 33% 55%, 34.5% 18%, 36% 55%, 37.5% 18%, 39% 55%, 40.5% 18%, 42% 55%, 43.5% 18%, 45% 55%, 46.5% 18%, 48% 55%, 49.5% 18%, 51% 55%, 52.5% 18%, 54% 55%, 55.5% 18%, 57% 55%, 58.5% 18%, 60% 55%, 61.5% 18%, 63% 55%, 64.5% 18%, 66% 55%, 67.5% 18%, 69% 55%, 70.5% 18%, 72% 55%, 73.5% 18%, 75% 55%, 76.5% 18%, 78% 55%, 79.5% 18%, 81% 55%, 82.5% 18%, 84% 55%, 85.5% 18%, 87% 55%, 88.5% 18%, 90% 55%, 91.5% 18%, 93% 55%, 94.5% 18%, 96% 55%, 97.5% 18%, 99% 55%, 100% 55%, 100% 100%, 0 100%);
}

body.thai-heritage-theme .hero-inner {
  min-height: 650px;
  padding-block: 58px 92px;
}

body.thai-heritage-theme .hero-layout {
  grid-template-columns: minmax(0, 1.14fr) minmax(330px, .72fr);
  gap: clamp(32px, 5vw, 72px);
}

body.thai-heritage-theme .thai-hero-badge {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding: 7px 12px 7px 7px;
  border: 1px solid rgba(235, 206, 136, .42);
  border-radius: 999px;
  color: #f6e9c9;
  background: rgba(78, 30, 26, .42);
  backdrop-filter: blur(9px);
  font-size: 11px;
}

body.thai-heritage-theme .thai-hero-badge span {
  padding: 4px 9px;
  border-radius: 999px;
  color: #3c2b15;
  background: linear-gradient(135deg, #f1d889, #c79d40);
  font-weight: 900;
}

body.thai-heritage-theme .thai-hero-badge strong {
  font-weight: 700;
}

body.thai-heritage-theme .hero .eyebrow {
  color: #e5c46e;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: none;
}

body.thai-heritage-theme .hero h1 {
  max-width: 690px;
  margin: 13px 0 18px;
  font-size: clamp(40px, 4.65vw, 61px);
  line-height: 1.18;
  letter-spacing: -.035em;
}

body.thai-heritage-theme .hero h1 span {
  color: #f0d381;
}

body.thai-heritage-theme .hero p {
  color: #f0ede4;
}

body.thai-heritage-theme .hero .btn-outline-light {
  color: #fffaf0;
  border-color: rgba(237, 214, 156, .72);
  background: rgba(17, 42, 56, .34);
}

body.thai-heritage-theme:not(.high-contrast) .hero-portal-card {
  position: relative;
  padding: 29px 26px 24px;
  overflow: hidden;
  border: 1px solid rgba(206, 171, 93, .8);
  border-radius: 4px 4px 18px 18px;
  color: #263a31;
  background:
    linear-gradient(rgba(255, 252, 244, .97), rgba(255, 250, 239, .97)),
    var(--thai-ivory);
  box-shadow: 0 28px 72px rgba(24, 24, 17, .32);
  backdrop-filter: blur(14px);
}

body.thai-heritage-theme:not(.high-contrast) .hero-portal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 9px;
  background:
    linear-gradient(135deg, transparent 33%, #d9ba6a 34% 65%, transparent 66%) 0 0 / 18px 18px,
    #842d24;
}

body.thai-heritage-theme .portal-label {
  color: var(--thai-red);
  letter-spacing: .06em;
}

body.thai-heritage-theme .hero-portal-card h2 {
  color: #17384f;
}

body.thai-heritage-theme .hero .innovation-portal > p {
  color: #52676f;
}

body.thai-heritage-theme .hero-portal-card a {
  border-top-color: #e5d7bd;
}

body.thai-heritage-theme .hero-portal-card a:hover {
  color: var(--thai-red);
}

body.thai-heritage-theme:not(.high-contrast) .portal-icon,
body.thai-heritage-theme:not(.high-contrast) .hero-portal-card a:nth-of-type(2) .portal-icon,
body.thai-heritage-theme:not(.high-contrast) .hero-portal-card a:nth-of-type(3) .portal-icon {
  color: #fff7e6;
  background: linear-gradient(145deg, #9b352b, #67231d);
  border: 1px solid #caa653;
  border-radius: 50% 50% 42% 42%;
  box-shadow: inset 0 0 0 3px rgba(255, 248, 230, .12);
  font-family: Tahoma, sans-serif;
  font-size: 15px;
}

body.thai-heritage-theme:not(.high-contrast) .innovation-link:nth-child(2) .portal-icon {
  background: linear-gradient(145deg, #1d526c, #102f43);
}

body.thai-heritage-theme:not(.high-contrast) .innovation-link:nth-child(3) .portal-icon {
  background: linear-gradient(145deg, #a97d2f, #73511f);
}

body.thai-heritage-theme:not(.high-contrast) .innovation-link:nth-child(4) .portal-icon {
  background: linear-gradient(145deg, #267865, #174c43);
}

body.thai-heritage-theme:not(.high-contrast) .innovation-link:nth-child(5) .portal-icon {
  background: linear-gradient(145deg, #7a405e, #4e293d);
}

@media (max-width: 580px) {
  .innovation-portal-summary {
    gap: 5px;
  }

  .innovation-portal-summary > div {
    padding-inline: 3px;
  }

  .innovation-portal-summary span {
    font-size: 8px;
  }

  .hero-portal-card .innovation-link {
    min-height: 58px;
  }

  .hero-portal-card .innovation-link strong {
    font-size: 13px;
  }
}

body.thai-heritage-theme .public-content {
  position: relative;
}

body.thai-heritage-theme .public-content::before,
body.thai-heritage-theme .public-content::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 420px;
  opacity: .22;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 100%, transparent 0 38%, rgba(150, 48, 38, .22) 39% 41%, transparent 42%),
    radial-gradient(ellipse at 50% 70%, transparent 0 31%, rgba(202, 166, 83, .28) 32% 34%, transparent 35%);
}

body.thai-heritage-theme .public-content::before {
  top: 410px;
  right: calc(100% - 72px);
}

body.thai-heritage-theme .public-content::after {
  top: 980px;
  left: calc(100% - 72px);
  transform: scaleX(-1);
}

body.thai-heritage-theme:not(.high-contrast) .notice-ticker {
  margin-top: -22px;
  border: 1px solid #d7c7a9;
  border-top: 4px solid #9a3329;
  border-radius: 3px 3px 12px 12px;
  background: #fffaf0;
  box-shadow: 0 14px 34px rgba(62, 45, 25, .12);
}

body.thai-heritage-theme:not(.high-contrast) .notice-label {
  color: #fff8e9;
  background: linear-gradient(135deg, #9e382e, #70261f);
  border: 1px solid #caa653;
}

body.thai-heritage-theme:not(.high-contrast) .discovery-section {
  position: relative;
  overflow: hidden;
  color: #2d3b34;
  border: 1px solid #d9c7a5;
  border-radius: 4px 4px 18px 18px;
  background:
    radial-gradient(circle at 0 0, rgba(202, 166, 83, .18), transparent 32%),
    linear-gradient(120deg, #fff9ed, #f3e7cf);
  box-shadow: 0 20px 52px rgba(77, 55, 28, .12);
}

body.thai-heritage-theme:not(.high-contrast) .discovery-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: repeating-linear-gradient(135deg, #892f26 0 10px, #caa653 10px 14px, #17384f 14px 24px);
}

body.thai-heritage-theme .discovery-heading h2 {
  color: #17384f;
}

body.thai-heritage-theme .discovery-heading p {
  color: #68685e;
}

body.thai-heritage-theme .section-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--thai-red);
  font-size: 12px;
  letter-spacing: .035em;
  text-transform: none;
}

body.thai-heritage-theme .section-kicker::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 1px solid #a9802f;
  background: #caa653;
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px rgba(202, 166, 83, .13);
}

body.thai-heritage-theme .stats-section .section-kicker,
body.thai-heritage-theme .site-footer .section-kicker {
  color: #f0d27e;
}

body.thai-heritage-theme .section-heading h2,
body.thai-heritage-theme .highlight-head h2,
body.thai-heritage-theme .subject-section h2,
body.thai-heritage-theme .library-section h2,
body.thai-heritage-theme .news-section h2 {
  color: #17384f;
  letter-spacing: -.02em;
}

body.thai-heritage-theme:not(.high-contrast) .search-panel {
  border: 1px solid #ded3bf;
  border-radius: 12px;
  background: rgba(255, 253, 248, .97);
  box-shadow: 0 13px 34px rgba(77, 55, 29, .10);
}

body.thai-heritage-theme:not(.high-contrast) .input,
body.thai-heritage-theme:not(.high-contrast) .select,
body.thai-heritage-theme:not(.high-contrast) textarea {
  border-color: #cfc2aa;
  border-radius: 7px;
  background: #fffefa;
}

body.thai-heritage-theme:not(.high-contrast) .input:focus,
body.thai-heritage-theme:not(.high-contrast) .select:focus,
body.thai-heritage-theme:not(.high-contrast) textarea:focus {
  border-color: #9d772a;
  box-shadow: 0 0 0 3px rgba(202, 166, 83, .17);
}

body.thai-heritage-theme .subject-section {
  position: relative;
  padding-top: 30px;
}

body.thai-heritage-theme .subject-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(540px, 72%);
  height: 1px;
  background: linear-gradient(90deg, transparent, #b88f3c 25%, #8d3027 50%, #b88f3c 75%, transparent);
  transform: translateX(-50%);
}

body.thai-heritage-theme:not(.high-contrast) .subject-card {
  min-height: 242px;
  border-color: #ddd0b8;
  border-radius: 5px 5px 16px 16px;
  background: #fffdf7;
  box-shadow: 0 8px 24px rgba(67, 49, 27, .07);
}

body.thai-heritage-theme:not(.high-contrast) .subject-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #782820 0 34%, #caa653 34% 66%, #17384f 66% 100%);
}

body.thai-heritage-theme:not(.high-contrast) .subject-card::after,
body.thai-heritage-theme:not(.high-contrast) .subject-card:nth-child(2n)::after,
body.thai-heritage-theme:not(.high-contrast) .subject-card:nth-child(3n)::after,
body.thai-heritage-theme:not(.high-contrast) .subject-card:nth-child(4n)::after,
body.thai-heritage-theme:not(.high-contrast) .subject-card:nth-child(5n)::after {
  height: 5px;
  background: linear-gradient(90deg, #17384f, #caa653 50%, #8f3027);
}

body.thai-heritage-theme:not(.high-contrast) .subject-card:hover {
  border-color: rgba(157, 119, 42, .62);
  box-shadow: 0 18px 38px rgba(75, 48, 20, .14);
}

body.thai-heritage-theme:not(.high-contrast) .subject-art {
  position: relative;
  height: 140px;
  border-bottom-color: #e2d6c0;
  background:
    radial-gradient(circle at 50% 110%, rgba(202, 166, 83, .25), transparent 58%),
    #fbf5e8;
  clip-path: polygon(0 12%, 12% 12%, 18% 5%, 24% 12%, 76% 12%, 82% 5%, 88% 12%, 100% 12%, 100% 100%, 0 100%);
}

body.thai-heritage-theme .subject-card strong {
  color: #17384f;
  font-size: 14px;
}

body.thai-heritage-theme:not(.high-contrast) .subject-number {
  color: #fff7e7;
  border: 1px solid #caa653;
  background: #7e2a23;
}

body.thai-heritage-theme:not(.high-contrast) .stats-section {
  position: relative;
  overflow: hidden;
  border: 1px solid #caa653;
  border-radius: 4px 4px 18px 18px;
  background:
    linear-gradient(105deg, rgba(18, 49, 67, .98), rgba(32, 66, 79, .88)),
    url("hero-thai-heritage-v1.webp") 72% center / cover;
}

body.thai-heritage-theme:not(.high-contrast) .stats-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: repeating-linear-gradient(135deg, #9b352b 0 11px, #d2b35f 11px 15px, #17384f 15px 26px);
}

body.thai-heritage-theme:not(.high-contrast) .stats-section .stat-card {
  border-color: rgba(229, 199, 121, .35);
  border-radius: 5px 5px 13px 13px;
  background: rgba(255, 249, 235, .10);
}

body.thai-heritage-theme .stat-icon {
  --stat-accent: #f0d27e;
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 0 14px;
  color: var(--stat-accent);
  border: 1px solid currentColor;
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .14), transparent 58%),
    rgba(255, 255, 255, .07);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, .035),
    0 9px 20px rgba(4, 26, 37, .18);
  transition: transform .22s ease, background-color .22s ease, box-shadow .22s ease;
}

body.thai-heritage-theme .stat-icon::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  background: #17384f;
  transform: translateX(-50%) rotate(45deg);
}

body.thai-heritage-theme .stat-icon svg {
  position: relative;
  z-index: 1;
  width: 31px;
  height: 31px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.thai-heritage-theme .stat-icon .stat-icon-accent {
  fill: currentColor;
  stroke: none;
  opacity: .15;
}

body.thai-heritage-theme .stat-card:nth-child(1) .stat-icon {
  --stat-accent: #f1d078;
  background-color: rgba(241, 208, 120, .10);
}

body.thai-heritage-theme .stat-card:nth-child(2) .stat-icon {
  --stat-accent: #9fd7c0;
  background-color: rgba(93, 176, 145, .11);
}

body.thai-heritage-theme .stat-card:nth-child(3) .stat-icon {
  --stat-accent: #f2c86a;
  background-color: rgba(242, 200, 106, .10);
}

body.thai-heritage-theme .stat-card:nth-child(4) .stat-icon {
  --stat-accent: #efa98a;
  background-color: rgba(199, 91, 63, .12);
}

body.thai-heritage-theme .stat-card:nth-child(5) .stat-icon {
  --stat-accent: #b9cad8;
  background-color: rgba(151, 181, 202, .12);
}

body.thai-heritage-theme .stats-section .stat-card:hover .stat-icon {
  transform: translateY(-3px) rotate(-2deg);
  background-color: rgba(255, 255, 255, .13);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, .055),
    0 13px 24px rgba(4, 26, 37, .24);
}

body.thai-heritage-theme:not(.high-contrast) .highlight-column,
body.thai-heritage-theme:not(.high-contrast) .library-section,
body.thai-heritage-theme:not(.high-contrast) .news-section {
  border-color: #ded1b9;
}

body.thai-heritage-theme:not(.high-contrast) .highlight-column {
  position: relative;
  border: 1px solid #ded1b9;
  border-top: 4px solid #8f3027;
  border-radius: 3px 3px 15px 15px;
  background: #fffdf8;
}

body.thai-heritage-theme:not(.high-contrast) .highlight-column:nth-child(2) {
  border-top-color: #c39d49;
}

body.thai-heritage-theme:not(.high-contrast) .media-card,
body.thai-heritage-theme:not(.high-contrast) .announcement-card,
body.thai-heritage-theme:not(.high-contrast) .collection-card,
body.thai-heritage-theme:not(.high-contrast) .panel {
  border-color: #ded1b9;
  border-radius: 6px 6px 15px 15px;
  background: #fffdf8;
  box-shadow: 0 8px 24px rgba(67, 49, 27, .07);
}

body.thai-heritage-theme:not(.high-contrast) .media-card:hover {
  border-color: rgba(157, 119, 42, .66);
  box-shadow: 0 18px 38px rgba(75, 48, 20, .14);
}

body.thai-heritage-theme:not(.high-contrast) .announcement-card.pinned {
  border-color: #caa653;
  background: linear-gradient(135deg, #fff9e9, #f8ead1);
}

body.thai-heritage-theme:not(.high-contrast) .section-link,
body.thai-heritage-theme:not(.high-contrast) .highlight-head > a,
body.thai-heritage-theme:not(.high-contrast) .announcement-card a {
  color: #8c3027;
}

body.thai-heritage-theme:not(.high-contrast) .site-footer {
  position: relative;
  overflow: hidden;
  color: #f1eadc;
  background:
    radial-gradient(circle at 78% 8%, rgba(202, 166, 83, .11), transparent 30rem),
    linear-gradient(140deg, #102f43, #193d4d 62%, #4c2924);
  border-top: 8px solid #8e3027;
}

body.thai-heritage-theme:not(.high-contrast) .site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, transparent, #d6b968 12%, #d6b968 88%, transparent);
}

body.thai-heritage-theme:not(.high-contrast) .site-footer::after {
  content: "";
  position: absolute;
  right: -45px;
  bottom: -86px;
  width: 330px;
  height: 210px;
  opacity: .14;
  border: 2px solid #efd17e;
  border-radius: 50% 50% 0 0;
  box-shadow: 0 -24px 0 -21px #efd17e, 0 -48px 0 -45px #efd17e, 0 -72px 0 -69px #efd17e;
  transform: rotate(-8deg);
}

body.thai-heritage-theme .footer-brand {
  color: #f2d985;
}

body.thai-heritage-theme:not(.high-contrast) .site-footer a,
body.thai-heritage-theme:not(.high-contrast) .site-footer button {
  color: #e8dfce;
}

body.thai-heritage-theme:not(.high-contrast) .site-footer a:hover,
body.thai-heritage-theme:not(.high-contrast) .site-footer button:hover {
  color: #f2d985;
}

body.thai-heritage-theme:not(.high-contrast) .footer-bottom {
  border-top-color: rgba(226, 194, 113, .28);
}

body.thai-heritage-theme:not(.high-contrast) .announcement-popup-card {
  border: 1px solid #d2ad58;
  border-radius: 4px 4px 18px 18px;
  background: #fffaf0;
}

body.thai-heritage-theme:not(.high-contrast) .announcement-popup-visual {
  background:
    linear-gradient(135deg, rgba(20, 50, 67, .90), rgba(89, 35, 29, .68)),
    url("hero-thai-heritage-v1.webp") 72% center / cover;
}

body.thai-heritage-theme:not(.high-contrast) .announcement-popup-visual::before {
  border-color: rgba(235, 206, 133, .42);
}

body.thai-heritage-theme:not(.high-contrast) .announcement-popup-seal {
  color: #fff7e5;
  border-color: #dbbc68;
  background: #822d25;
}

body.thai-heritage-theme:not(.high-contrast) .announcement-popup-meta span {
  color: #fff9ea;
  background: #8d3027;
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-shell {
  border: 1px solid #cfae62;
  border-radius: 5px 5px 18px 18px;
  background: #fffaf0;
  box-shadow: 0 30px 80px rgba(45, 34, 20, .28);
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-shell-head {
  background: #fff9ee;
  border-bottom-color: #ddcfb4;
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-brand-mark {
  border-color: #caa653;
  background: #7d2a23;
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-form-pane,
body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-register-pane {
  background:
    radial-gradient(circle at 0 0, rgba(202, 166, 83, .10), transparent 22rem),
    #fffdf8;
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-story,
body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-register-story {
  background:
    linear-gradient(145deg, rgba(18, 50, 68, .95), rgba(97, 38, 31, .72)),
    url("hero-thai-heritage-v1.webp") 68% center / cover;
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-story::before {
  border-color: rgba(228, 196, 116, .34);
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-eyebrow {
  color: #9a342a;
}

body.thai-heritage-theme:not(.high-contrast) .auth-formal .auth-eyebrow::before {
  background: #caa653;
  transform: rotate(45deg);
}

body.thai-heritage-theme:not(.high-contrast) .admin-nav {
  padding: 8px;
  border: 1px solid #d9c9ad;
  border-radius: 5px 5px 13px 13px;
  background: #fbf4e7;
}

body.thai-heritage-theme:not(.high-contrast) .admin-nav .btn {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body.thai-heritage-theme:not(.high-contrast) .admin-nav .btn-navy {
  color: #fff9eb;
  background: linear-gradient(135deg, #96342b, #70251f);
}

@media (max-width: 1100px) {
  body.thai-heritage-theme .hero-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(290px, .72fr);
    gap: 28px;
  }

  body.thai-heritage-theme .hero h1 {
    font-size: clamp(37px, 5vw, 53px);
  }
}

@media (max-width: 820px) {
  body.thai-heritage-theme .topbar-inner {
    min-height: 74px;
  }

  body.thai-heritage-theme:not(.high-contrast) .hero,
  body.thai-heritage-theme .hero-inner {
    min-height: auto;
  }

  body.thai-heritage-theme:not(.high-contrast) .hero-backdrop {
    background-position: 68% center;
  }

  body.thai-heritage-theme:not(.high-contrast) .hero::before {
    background:
      linear-gradient(90deg, rgba(13, 37, 52, .97), rgba(17, 48, 66, .82)),
      linear-gradient(0deg, rgba(74, 31, 25, .38), transparent 48%);
  }

  body.thai-heritage-theme .hero-inner {
    padding-block: 64px 86px;
  }

  body.thai-heritage-theme .hero-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  body.thai-heritage-theme .hero-portal-card {
    max-width: 620px;
  }

  body.thai-heritage-theme .public-content::before,
  body.thai-heritage-theme .public-content::after {
    display: none;
  }
}

@media (max-width: 580px) {
  body.thai-heritage-theme .site-shell,
  body.thai-heritage-theme .topbar-inner,
  body.thai-heritage-theme .hero-inner,
  body.thai-heritage-theme .public-content {
    width: min(100% - 26px, 1180px);
  }

  body.thai-heritage-theme .thai-hero-badge {
    align-items: flex-start;
    border-radius: 12px;
    line-height: 1.5;
  }

  body.thai-heritage-theme .topbar-inner {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  body.thai-heritage-theme .top-actions {
    width: 104px;
  }

  body.thai-heritage-theme .hero h1 {
    font-size: 31px;
    overflow-wrap: normal;
  }

  body.thai-heritage-theme .hero-portal-card {
    padding: 27px 18px 18px;
  }

  body.thai-heritage-theme .discovery-section,
  body.thai-heritage-theme .stats-section,
  body.thai-heritage-theme .highlight-column {
    border-radius: 4px 4px 13px 13px;
  }

  body.thai-heritage-theme .subject-grid {
    gap: 10px;
  }

  body.thai-heritage-theme .subject-card {
    min-height: 224px;
  }

  body.thai-heritage-theme .subject-art {
    height: 128px;
  }
}

/* Keep the accessibility mode independent from the decorative palette. */
body.thai-heritage-theme.high-contrast {
  --navy: #000;
  --navy-2: #000;
  --blue: #0645ad;
  --blue-soft: #fff;
  --gold: #ffdf00;
  --gold-deep: #000;
  --gold-soft: #fff;
  --ink: #000;
  --muted: #111;
  --line: #000;
  --surface: #fff;
  --bg: #fff;
  color: #000;
  background: #fff;
}

body.thai-heritage-theme.high-contrast .agency-strip,
body.thai-heritage-theme.high-contrast .site-footer {
  color: #fff;
  background: #000;
}

body.thai-heritage-theme.high-contrast .topbar,
body.thai-heritage-theme.high-contrast .hero-portal-card,
body.thai-heritage-theme.high-contrast .notice-ticker,
body.thai-heritage-theme.high-contrast .discovery-section,
body.thai-heritage-theme.high-contrast .search-panel,
body.thai-heritage-theme.high-contrast .subject-card,
body.thai-heritage-theme.high-contrast .highlight-column,
body.thai-heritage-theme.high-contrast .media-card,
body.thai-heritage-theme.high-contrast .announcement-card,
body.thai-heritage-theme.high-contrast .panel {
  color: #000;
  background: #fff;
  border: 2px solid #000;
  box-shadow: none;
}

body.thai-heritage-theme.high-contrast .hero {
  color: #fff;
  background: #000;
  border-color: #fff;
}

body.thai-heritage-theme.high-contrast .hero-backdrop,
body.thai-heritage-theme.high-contrast .hero::before {
  background: #000 !important;
}

body.thai-heritage-theme.high-contrast .hero::after {
  display: none;
}

body.thai-heritage-theme.high-contrast .hero h1,
body.thai-heritage-theme.high-contrast .hero h1 span,
body.thai-heritage-theme.high-contrast .hero p,
body.thai-heritage-theme.high-contrast .hero .eyebrow,
body.thai-heritage-theme.high-contrast .hero-trust,
body.thai-heritage-theme.high-contrast .thai-hero-badge {
  color: #fff;
}

body.thai-heritage-theme.high-contrast .btn,
body.thai-heritage-theme.high-contrast .portal-icon {
  color: #fff;
  background: #000;
  border: 2px solid #fff;
  box-shadow: none;
}

body.thai-heritage-theme.high-contrast .stat-icon {
  --stat-accent: #000 !important;
  color: #000;
  border: 2px solid #000;
  background: #fff;
  box-shadow: none;
}

body.thai-heritage-theme.high-contrast .stat-icon::before {
  background: #fff;
}

/* Header UX refresh: formal Thai identity, clearer actions and responsive navigation */
body.thai-heritage-theme .topbar {
  animation: pb1-header-arrive .58s cubic-bezier(.2, .72, .2, 1) both;
  transition: box-shadow .25s ease, background-color .25s ease;
}

body.thai-heritage-theme .topbar.is-scrolled {
  background: rgba(255, 252, 244, .985);
  box-shadow: 0 14px 38px rgba(57, 40, 20, .16);
}

body.thai-heritage-theme .topbar-inner {
  position: relative;
  width: min(1260px, calc(100% - 34px));
  gap: 16px;
  transition: min-height .25s ease, padding .25s ease;
}

body.thai-heritage-theme .topbar.is-scrolled .topbar-inner {
  min-height: 76px;
}

body.thai-heritage-theme .brand {
  min-width: 288px;
  flex: 0 1 342px;
}

body.thai-heritage-theme .brand-logo {
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), box-shadow .32s ease;
}

body.thai-heritage-theme .brand:hover .brand-logo {
  transform: translateY(-2px) rotate(-3deg);
  box-shadow: 0 0 0 2px #fffaf0, 0 0 0 5px #caa653, 0 12px 26px rgba(60, 39, 17, .22);
}

body.thai-heritage-theme .brand-title {
  transition: color .2s ease;
}

body.thai-heritage-theme .brand:hover .brand-title {
  color: #8f3027;
}

body.thai-heritage-theme .main-nav {
  flex: 0 1 auto;
  padding: 5px;
  gap: 2px;
  border: 1px solid rgba(129, 92, 38, .14);
  border-radius: 14px;
  background: rgba(248, 239, 221, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

body.thai-heritage-theme .main-nav a {
  isolation: isolate;
  overflow: hidden;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 9px;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

body.thai-heritage-theme .main-nav a::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(120deg, transparent 18%, rgba(255, 255, 255, .72) 50%, transparent 82%);
  transform: translateX(-125%);
  transition: transform .48s ease;
}

body.thai-heritage-theme .main-nav a:hover {
  transform: translateY(-1px);
}

body.thai-heritage-theme .main-nav a:hover::before {
  transform: translateX(125%);
}

body.thai-heritage-theme .main-nav a.is-active,
body.thai-heritage-theme .main-nav a[aria-current="page"] {
  color: #fffaf0;
  background: linear-gradient(135deg, #9a352b, #74251f);
  box-shadow: 0 7px 16px rgba(116, 37, 31, .19);
}

body.thai-heritage-theme .main-nav a.is-active::after,
body.thai-heritage-theme .main-nav a[aria-current="page"]::after {
  transform: scaleX(1);
  background: #e4c36d;
}

body.thai-heritage-theme .top-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap !important;
  gap: 7px;
  margin-left: auto;
}

body.thai-heritage-theme .header-action {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 44px;
  padding: 0 13px;
  gap: 8px;
  border-radius: 11px;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(55, 40, 20, .07);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), color .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

body.thai-heritage-theme .header-action::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1px;
  background: linear-gradient(115deg, transparent 22%, rgba(255, 255, 255, .72) 49%, transparent 76%);
  transform: translateX(-130%);
  transition: transform .52s ease;
}

body.thai-heritage-theme .header-action:hover::after {
  transform: translateX(130%);
}

body.thai-heritage-theme .header-action:hover {
  transform: translateY(-3px);
}

body.thai-heritage-theme .header-action-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}

body.thai-heritage-theme .header-action:hover .header-action-icon {
  transform: translateY(-1px) scale(1.09);
}

body.thai-heritage-theme .header-action-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.thai-heritage-theme:not(.high-contrast) .header-account {
  color: #17384f;
  border-color: rgba(23, 56, 79, .24);
  background: rgba(255, 252, 244, .86);
}

body.thai-heritage-theme:not(.high-contrast) .header-account:hover {
  color: #7e2a23;
  border-color: rgba(126, 42, 35, .42);
  background: #fff;
  box-shadow: 0 10px 22px rgba(82, 51, 23, .13);
}

body.thai-heritage-theme:not(.high-contrast) .header-submit {
  color: #fffaf0;
  border-color: #17384f;
  background: linear-gradient(135deg, #224d62, #17384f);
  box-shadow: 0 8px 18px rgba(23, 56, 79, .18);
}

body.thai-heritage-theme:not(.high-contrast) .header-submit:hover {
  color: #fff;
  border-color: #0f2b3e;
  background: linear-gradient(135deg, #2b5e74, #17384f);
  box-shadow: 0 12px 24px rgba(23, 56, 79, .24);
}

body.thai-heritage-theme:not(.high-contrast) .header-admin {
  color: #482e12;
  border-color: #c9a44d;
  background: linear-gradient(135deg, #f1d37c, #d7ad4f);
  box-shadow: 0 8px 18px rgba(169, 126, 35, .18);
}

body.thai-heritage-theme:not(.high-contrast) .header-admin:hover {
  color: #351e09;
  border-color: #b4872d;
  background: linear-gradient(135deg, #f7df96, #dfb756);
  box-shadow: 0 12px 24px rgba(169, 126, 35, .25);
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 0;
  border: 1px solid rgba(23, 56, 79, .24);
  border-radius: 11px;
  color: #17384f;
  background: #fffaf0;
  box-shadow: 0 5px 14px rgba(55, 40, 20, .07);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.mobile-menu-button:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 42, 35, .42);
  box-shadow: 0 9px 20px rgba(82, 51, 23, .14);
}

.mobile-menu-button span {
  width: 19px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: currentColor;
  transition: transform .24s ease, opacity .2s ease;
}

.mobile-menu-button.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-button.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(.35);
}

.mobile-menu-button.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@keyframes pb1-header-arrive {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  body.thai-heritage-theme .brand {
    min-width: 260px;
    flex-basis: 330px;
  }

  body.thai-heritage-theme .main-nav {
    position: absolute;
    z-index: 90;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    max-height: 0;
    padding: 0 10px;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    border-color: transparent;
    background: rgba(255, 252, 244, .985);
    box-shadow: 0 18px 36px rgba(54, 38, 19, .18);
    transform: translateY(-12px) scale(.985);
    transform-origin: top center;
    pointer-events: none;
    transition: max-height .34s ease, padding .3s ease, opacity .22s ease, transform .3s ease, visibility .3s ease, border-color .3s ease;
  }

  body.thai-heritage-theme .topbar.menu-open .main-nav {
    max-height: 220px;
    padding: 10px;
    visibility: visible;
    opacity: 1;
    border-color: rgba(129, 92, 38, .2);
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  body.thai-heritage-theme .main-nav a {
    justify-content: center;
    min-height: 44px;
  }

  .mobile-menu-button {
    display: grid;
  }
}

@media (max-width: 900px) {
  body.thai-heritage-theme .topbar-inner {
    width: min(100% - 24px, 1260px);
  }

  body.thai-heritage-theme .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.thai-heritage-theme .header-action {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

  body.thai-heritage-theme .header-action .desktop-label,
  body.thai-heritage-theme .header-action .mobile-label {
    display: none;
  }
}

@media (max-width: 760px) {
  body.thai-heritage-theme .topbar-inner {
    width: min(100% - 20px, 1260px);
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  body.thai-heritage-theme .topbar.is-scrolled .topbar-inner {
    min-height: 68px;
  }

  body.thai-heritage-theme .brand {
    min-width: 0;
    overflow: visible;
  }

  body.thai-heritage-theme .brand-logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  body.thai-heritage-theme .top-actions {
    width: auto;
    display: flex;
    gap: 5px;
  }

  body.thai-heritage-theme .top-actions .header-action,
  body.thai-heritage-theme .top-actions .mobile-menu-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 10px;
  }

  body.thai-heritage-theme .top-actions #submitButton {
    display: inline-flex;
  }

  body.thai-heritage-theme .header-action-icon,
  body.thai-heritage-theme .header-action-icon svg {
    width: 18px;
    height: 18px;
  }

  body.thai-heritage-theme .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.thai-heritage-theme .topbar.menu-open .main-nav {
    max-height: 310px;
  }
}

@media (max-width: 520px) {
  body.thai-heritage-theme .agency-strip-inner {
    min-height: 28px;
    font-size: 10px;
  }

  body.thai-heritage-theme .brand {
    gap: 9px;
  }

  body.thai-heritage-theme .brand-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 8px;
  }

  body.thai-heritage-theme .brand-title {
    max-width: 155px;
    font-size: 12px;
  }

  body.thai-heritage-theme .top-actions .header-action,
  body.thai-heritage-theme .top-actions .mobile-menu-button {
    width: 36px;
    min-width: 36px;
    height: 38px;
    min-height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.thai-heritage-theme .topbar,
  body.thai-heritage-theme .topbar *,
  body.thai-heritage-theme .topbar *::before,
  body.thai-heritage-theme .topbar *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Motion system: calm, purposeful movement across the public and admin experience */
html.motion-ready .motion-bound:not(.media-skeleton) {
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(.988);
  transition:
    opacity .62s cubic-bezier(.2, .72, .2, 1),
    transform .68s cubic-bezier(.2, .72, .2, 1);
  transition-delay: calc(var(--motion-order, 0) * 42ms);
}

html.motion-ready .motion-bound.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

body.thai-heritage-theme .hero-backdrop {
  animation: none;
  transform: translate3d(0, var(--hero-parallax-y, 0), 0) scale(1.065);
  transition: transform .12s linear;
  will-change: transform;
}

body.thai-heritage-theme .hero-backdrop::after {
  content: "";
  position: absolute;
  inset: -12%;
  pointer-events: none;
  background:
    radial-gradient(circle at 72% 24%, rgba(248, 211, 120, .24), transparent 14%),
    linear-gradient(112deg, transparent 28%, rgba(255, 225, 151, .10) 46%, transparent 62%);
  mix-blend-mode: screen;
  opacity: .45;
  transform: translateX(-10%);
  animation: pb1-temple-light 10s ease-in-out infinite alternate;
}

html.motion-ready .hero-copy.is-visible > * {
  animation: pb1-hero-line .7s cubic-bezier(.2, .75, .2, 1) both;
}

html.motion-ready .hero-copy.is-visible > *:nth-child(1) { animation-delay: 80ms; }
html.motion-ready .hero-copy.is-visible > *:nth-child(2) { animation-delay: 150ms; }
html.motion-ready .hero-copy.is-visible > *:nth-child(3) { animation-delay: 230ms; }
html.motion-ready .hero-copy.is-visible > *:nth-child(4) { animation-delay: 310ms; }
html.motion-ready .hero-copy.is-visible > *:nth-child(5) { animation-delay: 390ms; }
html.motion-ready .hero-copy.is-visible > *:nth-child(6) { animation-delay: 470ms; }

body.thai-heritage-theme .hero-portal-card {
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), box-shadow .32s ease;
}

body.thai-heritage-theme .hero-portal-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 54px rgba(3, 23, 34, .28);
}

body.thai-heritage-theme .hero-portal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(229, 199, 121, .16) 47%, transparent 64%);
  transform: translateX(-120%);
  animation: pb1-card-glint 7s 1.4s ease-in-out infinite;
}

body.thai-heritage-theme .subject-card {
  overflow: hidden;
  isolation: isolate;
}

body.thai-heritage-theme .subject-card::before {
  transform-origin: left center;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}

body.thai-heritage-theme .subject-card:hover::before {
  transform: scaleX(1.04);
}

body.thai-heritage-theme .subject-card .subject-art img {
  transition: transform .48s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

body.thai-heritage-theme .subject-card:hover .subject-art img {
  transform: translateY(-6px) scale(1.075) rotate(-1.5deg);
  filter: saturate(1.08) drop-shadow(0 12px 12px rgba(74, 44, 17, .16));
}

.subject-ripple {
  position: absolute;
  z-index: 5;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(229, 199, 121, .42);
  transform: translate(-50%, -50%) scale(0);
  animation: pb1-subject-ripple .68s ease-out forwards;
}

body.thai-heritage-theme .stat-icon svg path:not(.stat-icon-accent),
body.thai-heritage-theme .stat-icon svg circle {
  stroke-dasharray: 165;
  stroke-dashoffset: 165;
  transition: stroke-dashoffset 1.05s cubic-bezier(.2, .75, .2, 1);
  transition-delay: calc(160ms + var(--motion-order, 0) * 55ms);
}

body.thai-heritage-theme .stat-card.is-visible .stat-icon svg path:not(.stat-icon-accent),
body.thai-heritage-theme .stat-card.is-visible .stat-icon svg circle {
  stroke-dashoffset: 0;
}

body.thai-heritage-theme .stat-value {
  font-variant-numeric: tabular-nums;
}

body.thai-heritage-theme .search-panel {
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

body.thai-heritage-theme .search-panel:focus-within {
  transform: translateY(-3px);
  border-color: rgba(202, 166, 83, .7);
  box-shadow: 0 20px 45px rgba(61, 47, 28, .15);
}

body.thai-heritage-theme .search-field {
  transition: transform .22s ease, box-shadow .22s ease;
}

body.thai-heritage-theme .search-field:focus-within {
  transform: scale(1.008);
  box-shadow: 0 0 0 4px rgba(202, 166, 83, .13);
}

#searchNow {
  position: relative;
}

#searchNow::before {
  content: "";
  width: 15px;
  height: 15px;
  display: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}

#searchNow.is-searching::before {
  display: inline-block;
  animation: pb1-spin .72s linear infinite;
}

.active-filter-chips {
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-5px);
  transition: min-height .25s ease, margin-top .25s ease, opacity .25s ease, transform .25s ease;
}

.active-filter-chips.show {
  min-height: 32px;
  margin-top: 14px;
  opacity: 1;
  transform: translateY(0);
}

.filter-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 11px;
  border: 1px solid rgba(126, 42, 35, .2);
  border-radius: 999px;
  color: #6d2822;
  background: #fff8e9;
  font-size: 11px;
  font-weight: 700;
  animation: pb1-chip-in .28s cubic-bezier(.2, .8, .2, 1) both;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.filter-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 42, 35, .42);
  background: #fff;
}

.filter-chip b {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #8f3027;
  line-height: 1;
}

.media-skeleton {
  opacity: 1;
  transform: none;
  pointer-events: none;
}

.skeleton-block {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #ece5d7;
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 28%, rgba(255, 255, 255, .78) 48%, transparent 68%);
  transform: translateX(-110%);
  animation: pb1-skeleton 1.25s ease-in-out infinite;
}

.skeleton-thumb { height: 168px; border-radius: 0; }
.skeleton-pill { width: 82px; height: 22px; margin-bottom: 15px; }
.skeleton-title { width: 88%; height: 23px; margin-bottom: 13px; }
.skeleton-line { width: 100%; height: 12px; margin-bottom: 9px; }
.skeleton-line.short { width: 66%; }
.skeleton-button { width: 92px; height: 30px; }

body.thai-heritage-theme .media-card {
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .3s ease, box-shadow .3s ease;
}

body.thai-heritage-theme .media-card .thumb {
  overflow: hidden;
}

body.thai-heritage-theme .media-card .thumb img {
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .4s ease;
}

body.thai-heritage-theme .media-card:hover .thumb img {
  transform: scale(1.065);
  filter: saturate(1.08) contrast(1.02);
}

body.thai-heritage-theme .media-card .card-footer .btn::after {
  content: "›";
  display: inline-block;
  margin-left: 4px;
  transition: transform .2s ease;
}

body.thai-heritage-theme .media-card .card-footer .btn:hover::after {
  transform: translateX(4px);
}

.featured-badge,
.announcement-badge {
  position: relative;
  overflow: hidden;
}

.featured-badge::after,
.announcement-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .72) 48%, transparent 70%);
  transform: translateX(-130%);
  animation: pb1-badge-shine 2.3s .8s ease-in-out 3;
}

body.thai-heritage-theme .announcement-card {
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

body.thai-heritage-theme .announcement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(72, 47, 21, .13);
}

body.thai-heritage-theme .collection-card {
  perspective: 900px;
}

body.thai-heritage-theme .collection-card .thumb::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 8px auto 8px 8px;
  width: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(81, 38, 29, .42), rgba(255, 255, 255, .18));
  box-shadow: 2px 0 7px rgba(48, 30, 18, .14);
  transition: transform .34s ease;
}

body.thai-heritage-theme .collection-card:hover .thumb::before {
  transform: translateX(3px);
}

body.thai-heritage-theme .site-footer::before {
  background-size: 220% 100%;
  animation: pb1-footer-pattern 12s linear infinite;
}

body.thai-heritage-theme .site-footer a,
body.thai-heritage-theme .site-footer button {
  position: relative;
  width: fit-content;
}

body.thai-heritage-theme .site-footer a::after,
body.thai-heritage-theme .site-footer button::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: -2px;
  height: 1px;
  background: #e5c779;
  transition: left .22s ease, right .22s ease;
}

body.thai-heritage-theme .site-footer a:hover::after,
body.thai-heritage-theme .site-footer button:hover::after {
  left: 0;
  right: 0;
}

.back-to-top {
  position: fixed;
  z-index: 75;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d7b660;
  border-radius: 50%;
  color: #fff9e9;
  background: linear-gradient(145deg, #9a352b, #6f241e);
  box-shadow: 0 12px 28px rgba(61, 34, 20, .25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.82);
  transition: opacity .25s ease, visibility .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 16px 34px rgba(61, 34, 20, .32);
}

.back-to-top svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal.show .modal-card {
  animation: pb1-modal-enter .38s cubic-bezier(.2, .82, .2, 1) both;
}

.announcement-popup.show .announcement-popup-card {
  animation: pb1-notice-enter .52s cubic-bezier(.16, .86, .2, 1) both;
}

.announcement-popup.show .announcement-popup-orbit {
  animation: pb1-orbit-drift 9s linear infinite;
}

.announcement-popup.show .orbit-two {
  animation-direction: reverse;
  animation-duration: 13s;
}

.auth-formal .auth-story::after,
.auth-formal .auth-register-story::after {
  animation: pb1-auth-glow 8s ease-in-out infinite alternate;
}

.password-strength span {
  transition: width .36s cubic-bezier(.2, .8, .2, 1), background-color .25s ease, box-shadow .25s ease;
}

.password-strength span[data-level="strong"] {
  box-shadow: 0 0 14px rgba(24, 138, 85, .35);
}

.toast.show {
  animation: pb1-toast-enter .34s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes pb1-temple-light {
  0% { opacity: .28; transform: translateX(-13%) scale(.98); }
  100% { opacity: .62; transform: translateX(8%) scale(1.04); }
}

@keyframes pb1-hero-line {
  from { opacity: 0; transform: translateY(17px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pb1-card-glint {
  0%, 72% { transform: translateX(-125%); }
  88%, 100% { transform: translateX(125%); }
}

@keyframes pb1-subject-ripple {
  0% { opacity: .78; transform: translate(-50%, -50%) scale(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(18); }
}

@keyframes pb1-spin {
  to { transform: rotate(360deg); }
}

@keyframes pb1-chip-in {
  from { opacity: 0; transform: translateY(-7px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pb1-skeleton {
  to { transform: translateX(110%); }
}

@keyframes pb1-badge-shine {
  0%, 30% { transform: translateX(-130%); }
  68%, 100% { transform: translateX(130%); }
}

@keyframes pb1-footer-pattern {
  to { background-position: 220% 0; }
}

@keyframes pb1-modal-enter {
  from { opacity: 0; transform: translateY(22px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pb1-notice-enter {
  from { opacity: 0; transform: translateY(25px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pb1-orbit-drift {
  to { transform: rotate(360deg); }
}

@keyframes pb1-auth-glow {
  from { transform: translate3d(-2%, -2%, 0) scale(.98); opacity: .35; }
  to { transform: translate3d(3%, 2%, 0) scale(1.05); opacity: .7; }
}

@keyframes pb1-toast-enter {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  html.motion-ready .motion-bound:not(.media-skeleton) {
    transform: translate3d(0, 16px, 0) scale(.992);
    transition-delay: calc(var(--motion-order, 0) * 28ms);
  }

  html.motion-ready .motion-bound.is-visible {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .back-to-top {
    right: 13px;
    bottom: 13px;
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.motion-ready .motion-bound,
  html.motion-ready .motion-bound.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  body.thai-heritage-theme .hero-backdrop {
    transform: scale(1.04) !important;
    transition: none !important;
  }

  body.thai-heritage-theme .hero-backdrop::after,
  body.thai-heritage-theme .hero-copy.is-visible > *,
  body.thai-heritage-theme .hero-portal-card::after,
  body.thai-heritage-theme .stat-icon svg *,
  .subject-ripple,
  .skeleton-block::after,
  .featured-badge::after,
  .announcement-badge::after,
  body.thai-heritage-theme .site-footer::before,
  .modal.show .modal-card,
  .announcement-popup.show .announcement-popup-card,
  .announcement-popup.show .announcement-popup-orbit,
  .auth-formal .auth-story::after,
  .auth-formal .auth-register-story::after,
  .toast.show {
    animation: none !important;
    transition: none !important;
  }

  body.thai-heritage-theme .stat-icon svg * {
    stroke-dashoffset: 0 !important;
  }
}

/* Motion suite v2: navigation, uploads, dashboards and system feedback */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

.page-progress {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background: rgba(229, 199, 121, .18);
  transition: opacity .18s ease;
}

.page-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #7e2a23, #e5c779, #b24735);
  box-shadow: 0 0 14px rgba(229, 199, 121, .72);
  transform: translateX(-110%);
}

.page-progress.is-active {
  opacity: 1;
}

.page-progress.is-active span {
  animation: pb1-page-progress 1.15s cubic-bezier(.4, 0, .2, 1) infinite;
}

.page-progress.is-completing span {
  width: 100%;
  animation: pb1-page-complete .2s ease forwards;
}

html.page-is-leaving body {
  opacity: .2;
  transform: translateY(-5px);
  transition: opacity .19s ease, transform .19s ease;
}

.network-status {
  position: fixed;
  z-index: 950;
  left: 50%;
  top: 16px;
  max-width: min(92vw, 520px);
  padding: 10px 16px;
  border: 1px solid #add9be;
  border-radius: 999px;
  color: #155f3a;
  background: #f0fff5;
  box-shadow: 0 12px 32px rgba(22, 58, 39, .2);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -18px);
  transition: opacity .25s ease, visibility .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}

.network-status.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.network-status.is-offline {
  border-color: #efc08f;
  color: #7a321e;
  background: #fff7e9;
}

.btn,
.admin-nav-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.button-ripple {
  position: absolute;
  z-index: -1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  pointer-events: none;
  background: currentColor;
  opacity: .16;
  transform: translate(-50%, -50%) scale(0);
  animation: pb1-button-ripple .6s ease-out forwards;
}

.action-progress-button {
  min-width: 170px;
}

.action-progress-button.is-processing {
  cursor: wait;
}

.button-spinner {
  width: 15px;
  height: 15px;
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .42);
  border-right-color: currentColor;
  border-radius: 50%;
  animation: pb1-spin .7s linear infinite;
}

.file-drop-field {
  position: relative;
  min-height: 148px;
  padding: 14px;
  overflow: hidden;
  border: 1.5px dashed #c8b176;
  border-radius: 16px;
  background: linear-gradient(145deg, #fffdf7, #f8f1e2);
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.file-drop-field::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, .72), rgba(255, 255, 255, .72)),
    var(--drop-preview, none) center / cover no-repeat;
  opacity: 0;
  transition: opacity .35s ease;
}

.file-drop-field.has-file::after {
  opacity: .42;
}

.file-drop-field.is-dragging {
  border-color: #8f3027;
  background: #fff5d9;
  box-shadow: 0 0 0 5px rgba(202, 166, 83, .18), 0 14px 32px rgba(95, 57, 25, .14);
  transform: translateY(-3px) scale(1.008);
}

.file-drop-field > label,
.file-drop-field > input,
.file-drop-field > .dropzone-copy {
  position: relative;
  z-index: 1;
}

.file-drop-field > label {
  display: block;
  margin-bottom: 8px;
}

.dropzone-copy {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 8px 10px;
  text-align: center;
  pointer-events: none;
}

.dropzone-copy strong {
  color: #153c50;
  font-size: 14px;
}

.dropzone-copy small {
  color: #71808a;
  font-size: 11px;
}

.dropzone-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border: 1px solid #d9be76;
  border-radius: 50%;
  color: #7e2a23;
  background: #fff9e9;
  font-size: 22px;
  font-weight: 900;
  transition: transform .28s ease, color .28s ease, background-color .28s ease;
}

.file-drop-field.is-dragging .dropzone-icon {
  color: #fff;
  background: #8f3027;
  transform: translateY(-4px) scale(1.08);
  animation: pb1-upload-bob .65s ease-in-out infinite alternate;
}

.dropzone-file {
  max-width: 100%;
  margin-top: 5px;
  padding: 4px 8px;
  overflow: hidden;
  border-radius: 999px;
  color: #6b4a1f;
  background: rgba(229, 199, 121, .22);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-drop-field.has-file .dropzone-file {
  color: #135e3a;
  background: rgba(59, 154, 102, .13);
  animation: pb1-file-selected .4s cubic-bezier(.2, .8, .2, 1) both;
}

.file-drop-field input[type="file"] {
  width: 100%;
  padding: 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .86);
}

.upload-progress {
  display: grid;
  gap: 8px;
  max-height: 0;
  margin: 0;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: max-height .32s ease, margin .32s ease, padding .32s ease, opacity .25s ease, transform .32s ease, border-color .25s ease;
}

.upload-progress.show {
  max-height: 90px;
  margin: 8px 0;
  padding: 12px 14px;
  border-color: #d9c58d;
  opacity: 1;
  transform: translateY(0);
  background: #fffbef;
}

.upload-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #294a5d;
  font-size: 12px;
}

.upload-progress progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: #8f3027;
}

.upload-progress progress::-webkit-progress-bar {
  background: #eee4cf;
}

.upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #8f3027, #d9b855);
  transition: width .28s ease;
}

.upload-progress.is-complete {
  border-color: #9ccbae;
  background: #effbf3;
}

.detail-cover-zoom {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #eee4cf;
  cursor: zoom-in;
}

.detail-cover-zoom .detail-cover {
  display: block;
  width: 100%;
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

.detail-cover-zoom > span {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 38, 51, .72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  font-size: 24px;
  opacity: .86;
  transform: scale(.9);
  transition: transform .3s ease, opacity .3s ease;
}

.detail-cover-zoom:hover .detail-cover {
  transform: scale(1.035);
  filter: saturate(1.05);
}

.detail-cover-zoom:hover > span {
  opacity: 1;
  transform: scale(1.06);
}

.image-lightbox {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 42px;
  visibility: hidden;
  opacity: 0;
  background: rgba(4, 20, 29, .9);
  backdrop-filter: blur(10px);
  transition: opacity .24s ease, visibility .24s ease;
}

.image-lightbox.show {
  visibility: visible;
  opacity: 1;
}

.image-lightbox figure {
  max-width: min(1120px, 94vw);
  max-height: 88vh;
  margin: 0;
  color: #fff;
  text-align: center;
  transform: translateY(18px) scale(.96);
}

.image-lightbox.show figure {
  animation: pb1-lightbox-enter .42s cubic-bezier(.16, .85, .2, 1) forwards;
}

.image-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: auto;
  border: 1px solid rgba(229, 199, 121, .55);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .45);
}

.image-lightbox figcaption {
  margin-top: 12px;
  color: #fff8df;
  font-size: 14px;
}

.image-lightbox > button {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 22px;
  width: 45px;
  height: 45px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: 28px;
  cursor: pointer;
  transition: transform .22s ease, background-color .22s ease;
}

.image-lightbox > button:hover {
  background: #8f3027;
  transform: rotate(8deg) scale(1.06);
}

body.lightbox-open {
  overflow: hidden;
}

.favorite-button span {
  display: inline-block;
  color: #8f3027;
  font-size: 18px;
  transition: transform .25s ease;
}

.favorite-button.is-favorite {
  border-color: #c98982;
  color: #7e2a23;
  background: #fff1ef;
}

.favorite-button.is-celebrating span {
  animation: pb1-heart-pop .65s cubic-bezier(.2, .9, .2, 1);
}

.favorite-button.is-celebrating::after {
  content: "✦  ✧  ✦";
  position: absolute;
  left: 50%;
  top: -5px;
  color: #d9b855;
  font-size: 12px;
  pointer-events: none;
  animation: pb1-favorite-spark .7s ease-out forwards;
}

.ad-carousel {
  display: block;
}

.ad-carousel-viewport {
  overflow: hidden;
  border-radius: inherit;
}

.ad-carousel-track {
  display: grid;
}

.ad-carousel .ad-card {
  grid-area: 1 / 1;
  pointer-events: none;
  opacity: 0;
  transform: translateX(24px) scale(.985);
  transition: opacity .48s ease, transform .52s cubic-bezier(.2, .8, .2, 1);
}

.ad-carousel .ad-card.is-active {
  z-index: 1;
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0) scale(1);
}

.ad-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.ad-carousel-controls > button {
  width: 34px;
  height: 34px;
  border: 1px solid #d2ba7a;
  border-radius: 50%;
  color: #7e2a23;
  background: #fffaf0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, color .2s ease, background-color .2s ease;
}

.ad-carousel-controls > button:hover {
  color: #fff;
  background: #8f3027;
  transform: translateY(-2px);
}

.ad-carousel-dots {
  display: flex;
  gap: 6px;
}

.ad-carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c9b98f;
  cursor: pointer;
  transition: width .3s ease, background-color .3s ease;
}

.ad-carousel-dots button.is-active {
  width: 25px;
  background: #8f3027;
}

.member-activity,
.admin-chart-panel {
  overflow: hidden;
}

.activity-bars {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 24px 16px 0;
  border-left: 1px solid #e2d6ba;
  border-bottom: 1px solid #e2d6ba;
  background: repeating-linear-gradient(to top, transparent 0 44px, rgba(120, 96, 48, .08) 44px 45px);
}

.activity-bar {
  min-width: 0;
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 7px;
}

.activity-bar span {
  width: min(42px, 78%);
  height: var(--bar-height);
  min-height: 7px;
  border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, #d9b855, #8f3027);
  box-shadow: 0 8px 18px rgba(126, 42, 35, .18);
  transform-origin: bottom;
  transform: scaleY(0);
}

.member-activity.is-visible .activity-bar span {
  animation: pb1-bar-grow .8s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(var(--row-order, 0) * 75ms);
}

.activity-bar small {
  width: 100%;
  overflow: hidden;
  color: #5f6f76;
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chart-panel {
  position: relative;
  margin: 0 0 18px;
  padding: 22px;
  border: 1px solid #d9e3e8;
  border-radius: 16px;
  background:
    radial-gradient(circle at 95% 0, rgba(229, 199, 121, .18), transparent 28%),
    #fff;
}

.admin-chart-bars {
  display: grid;
  gap: 10px;
}

.admin-chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 240px) 1fr 54px;
  align-items: center;
  gap: 11px;
  font-size: 12px;
}

.admin-chart-row > span {
  overflow: hidden;
  color: #294a5d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chart-row > i {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf0;
}

.admin-chart-row > i > b {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d5165, #d9b855);
  transform-origin: left;
  transform: scaleX(0);
}

.admin-chart-panel.is-visible .admin-chart-row > i > b {
  animation: pb1-chart-grow .76s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(var(--row-order, 0) * 65ms);
}

.admin-chart-row > strong {
  color: #7e2a23;
  text-align: right;
}

.admin-stat {
  opacity: 0;
  transform: translateY(10px);
}

.admin-stats .admin-stat {
  animation: pb1-stat-card-in .42s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(var(--row-order, 0) * 55ms);
}

.motion-counter {
  font-variant-numeric: tabular-nums;
}

.motion-row {
  opacity: 0;
  transform: translateY(9px);
}

.rows-ready .motion-row,
.notification-item.motion-row {
  animation: pb1-row-in .38s ease forwards;
  animation-delay: calc(var(--row-order, 0) * 34ms);
}

.notification-count {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  border-radius: 999px;
  color: #fff;
  background: #a7362d;
  font-size: 11px;
  vertical-align: middle;
  animation: pb1-notification-pulse 2s ease-in-out 3;
}

.admin-tab {
  position: relative;
}

.admin-tab.tab-entering {
  animation: pb1-tab-enter .36s cubic-bezier(.2, .8, .2, 1) both;
}

.admin-panel-loader {
  position: absolute;
  z-index: 8;
  inset: 0;
  min-height: 160px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 11px;
  border-radius: 14px;
  color: #294a5d;
  background: rgba(247, 250, 251, .88);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.admin-tab.is-loading .admin-panel-loader {
  opacity: 1;
  visibility: visible;
}

.admin-panel-loader i {
  width: 32px;
  height: 32px;
  border: 3px solid #d8e2e6;
  border-top-color: #8f3027;
  border-radius: 50%;
  animation: pb1-spin .75s linear infinite;
}

.modal.is-closing {
  opacity: 0;
  transition: opacity .19s ease;
}

.modal.is-closing .modal-card {
  transform: translateY(12px) scale(.98);
  transition: transform .19s ease;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-icon {
  width: 26px;
  height: 26px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  font-weight: 900;
}

.toast.success .toast-icon {
  animation: pb1-toast-check .5s cubic-bezier(.2, .9, .2, 1) both;
}

.animated-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.animated-empty.compact {
  min-height: 110px;
}

.animated-empty strong {
  color: #294a5d;
  font-size: 14px;
}

.animated-empty small {
  color: #7d8a8f;
}

.obec-empty-state {
  max-width: 760px;
  min-height: 230px;
  margin-inline: auto;
  padding: 28px clamp(18px, 4vw, 46px);
  border: 1px solid rgba(176, 130, 46, .34);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 252, 243, .98), rgba(248, 239, 215, .86));
  box-shadow: 0 16px 36px rgba(23, 56, 73, .08);
}

.obec-empty-state strong {
  max-width: 620px;
  color: #163f54;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.65;
}

.obec-empty-state small {
  max-width: 620px;
  color: #5d6d73;
  font-size: .93rem;
  line-height: 1.75;
}

.obec-empty-state .btn {
  margin-top: 10px;
  text-decoration: none;
}

.empty-orbit {
  position: relative;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border: 1px solid #d8bd74;
  border-radius: 50%;
  color: #8f3027;
  background: #fff9e9;
  font-size: 25px;
}

.empty-orbit i {
  position: absolute;
  width: 9px;
  height: 9px;
  top: -4px;
  left: 27px;
  border-radius: 50%;
  background: #8f3027;
  transform-origin: 4px 35px;
  animation: pb1-empty-orbit 4.5s linear infinite;
}

.empty-orbit b {
  animation: pb1-empty-breathe 2.2s ease-in-out infinite;
}

input:not([type="checkbox"]):not([type="radio"]):user-invalid,
select:user-invalid,
textarea:user-invalid {
  border-color: #b33d35;
  box-shadow: 0 0 0 3px rgba(179, 61, 53, .1);
  animation: pb1-invalid-shake .32s ease;
}

body.media-page .detail-site-header,
body.media-page .breadcrumbs,
body.media-page .media-detail-card,
.legal-head,
.legal-card {
  animation: pb1-static-page-enter .55s cubic-bezier(.2, .8, .2, 1) both;
}

body.media-page .breadcrumbs {
  animation-delay: 80ms;
}

body.media-page .media-detail-card,
.legal-card {
  animation-delay: 140ms;
}

.media-cover-button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.media-cover-button .media-detail-cover {
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

.media-cover-button:hover .media-detail-cover {
  transform: scale(1.025);
  filter: saturate(1.06);
}

@keyframes pb1-page-progress {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(135%); }
  100% { transform: translateX(260%); }
}

@keyframes pb1-page-complete {
  to { transform: translateX(0); }
}

@keyframes pb1-button-ripple {
  to { opacity: 0; transform: translate(-50%, -50%) scale(18); }
}

@keyframes pb1-upload-bob {
  to { transform: translateY(2px) scale(1.08); }
}

@keyframes pb1-file-selected {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pb1-lightbox-enter {
  to { transform: translateY(0) scale(1); }
}

@keyframes pb1-heart-pop {
  0% { transform: scale(.7); }
  45% { transform: scale(1.55) rotate(-8deg); }
  100% { transform: scale(1); }
}

@keyframes pb1-favorite-spark {
  from { opacity: 1; transform: translate(-50%, 8px) scale(.7); }
  to { opacity: 0; transform: translate(-50%, -24px) scale(1.2); }
}

@keyframes pb1-bar-grow {
  to { transform: scaleY(1); }
}

@keyframes pb1-chart-grow {
  to { transform: scaleX(1); }
}

@keyframes pb1-stat-card-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pb1-row-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pb1-notification-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(167, 54, 45, 0); }
  50% { box-shadow: 0 0 0 7px rgba(167, 54, 45, .13); }
}

@keyframes pb1-tab-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pb1-toast-check {
  0% { transform: scale(.4) rotate(-20deg); }
  60% { transform: scale(1.18) rotate(4deg); }
  100% { transform: scale(1); }
}

@keyframes pb1-empty-orbit {
  to { transform: rotate(360deg); }
}

@keyframes pb1-empty-breathe {
  50% { transform: scale(1.14); color: #d0aa47; }
}

@keyframes pb1-invalid-shake {
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

@keyframes pb1-static-page-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
  .image-lightbox {
    padding: 54px 12px 20px;
  }

  .admin-chart-row {
    grid-template-columns: 92px 1fr 44px;
    gap: 7px;
  }

  .activity-bars {
    gap: 5px;
    padding-inline: 7px;
  }

  .file-drop-field {
    min-height: 138px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-progress span,
  .button-ripple,
  .button-spinner,
  .file-drop-field.is-dragging .dropzone-icon,
  .file-drop-field.has-file .dropzone-file,
  .image-lightbox.show figure,
  .favorite-button.is-celebrating span,
  .favorite-button.is-celebrating::after,
  .member-activity.is-visible .activity-bar span,
  .admin-chart-panel.is-visible .admin-chart-row > i > b,
  .admin-stats .admin-stat,
  .rows-ready .motion-row,
  .notification-item.motion-row,
  .notification-count,
  .admin-tab.tab-entering,
  .admin-panel-loader i,
  .toast.success .toast-icon,
  .empty-orbit i,
  .empty-orbit b,
  body.media-page .detail-site-header,
  body.media-page .breadcrumbs,
  body.media-page .media-detail-card,
  .legal-head,
  .legal-card {
    animation: none !important;
  }

  .activity-bar span,
  .admin-chart-row > i > b,
  .admin-stat,
  .motion-row {
    opacity: 1 !important;
    transform: none !important;
  }

  html.page-is-leaving body,
  .ad-carousel .ad-card,
  .network-status,
  .image-lightbox,
  .modal.is-closing,
  .modal.is-closing .modal-card {
    transition: none !important;
  }
}

/* Keep the home announcement clear of the Thai ornamental hero edge. */
body.thai-heritage-theme .public-content {
  padding-top: clamp(18px, 1.8vw, 26px);
}

body.thai-heritage-theme .notice-ticker,
body.thai-heritage-theme:not(.high-contrast) .notice-ticker {
  margin-top: 0;
}

@media (max-width: 760px) {
  body.thai-heritage-theme .public-content {
    padding-top: 14px;
  }
}

/* Keep media content clear of the ornamental media hero edge. */
body.media-detail-v2 .media-v2-main {
  margin-top: clamp(18px, 1.8vw, 26px);
}

@media (max-width: 760px) {
  body.media-detail-v2 .media-v2-main {
    margin-top: 14px;
  }
}

/* Official PB1 identity: use the supplied agency emblem consistently. */
.brand-logo.brand-logo-image,
body.thai-heritage-theme:not(.high-contrast) .brand-logo.brand-logo-image {
  overflow: hidden;
  padding: 2px;
  color: transparent;
  background: #fff;
  border-radius: 50%;
}

.brand-logo.brand-logo-image::after,
body.thai-heritage-theme:not(.high-contrast) .brand-logo.brand-logo-image::after {
  display: none;
}

.brand-logo-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: inherit;
}

body.thai-heritage-theme .brand:hover .brand-logo-image {
  transform: translateY(-2px) scale(1.035);
}

/* Verification belongs to the media information, not over the cover artwork. */
.media-v2-copy .media-v2-verified.media-v2-verified-inline {
  position: relative;
  inset: auto;
  width: fit-content;
  min-width: min(300px, 100%);
  max-width: 100%;
  margin: -4px 0 18px;
  box-shadow: 0 12px 26px rgba(1, 23, 33, .18);
}

/* Header actions are buttons visually, so link decoration must never appear. */
body.media-detail-v2 .media-v2-topbar .top-actions a.header-action,
body.media-detail-v2 .media-v2-topbar .top-actions a.header-action:hover,
body.media-detail-v2 .media-v2-topbar .top-actions a.header-action:focus,
body.media-detail-v2 .media-v2-topbar .top-actions a.header-action:visited {
  text-decoration: none !important;
}

@media (max-width: 520px) {
  .media-v2-copy .media-v2-verified.media-v2-verified-inline {
    width: 100%;
    min-width: 0;
    margin-top: 0;
  }
}

/* ==========================================================
   AI creator lesson pages
   ========================================================== */
body.lesson-page {
  color: #263a43;
  background:
    radial-gradient(circle at 8% 18%, rgba(202, 166, 83, .10), transparent 22%),
    linear-gradient(180deg, #f7f1e5, #fffdf8 40%, #f2eadc);
}

body.lesson-page .lesson-topbar .header-action,
body.lesson-page .lesson-topbar .header-action:hover,
body.lesson-page .lesson-topbar .header-action:focus,
body.lesson-page .lesson-topbar .header-action:visited {
  text-decoration: none !important;
}

.lesson-hero {
  position: relative;
  min-height: 610px;
  display: grid;
  overflow: hidden;
  color: #fff;
  background: #092f41;
}

.lesson-hero::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  height: 18px;
  background:
    linear-gradient(135deg, #fff9e8 25%, transparent 25%) 0 0 / 30px 30px,
    linear-gradient(225deg, #d1ae55 25%, transparent 25%) 15px 0 / 30px 30px,
    #7c2a22;
}

.lesson-hero-media {
  position: absolute;
  z-index: 0;
  inset: 0;
}

.lesson-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 37, 52, .98) 0%, rgba(8, 46, 63, .93) 43%, rgba(9, 47, 63, .66) 68%, rgba(9, 47, 63, .28)),
    linear-gradient(0deg, rgba(68, 27, 22, .42), transparent 56%);
}

.lesson-hero-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1.025);
}

.lesson-hero-inner {
  position: relative;
  z-index: 3;
  align-self: center;
  padding-block: 44px 68px;
}

.lesson-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 46px;
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
}

.lesson-breadcrumb a {
  color: #efd57f;
  text-decoration: none;
}

.lesson-badge {
  width: fit-content;
  display: block;
  margin-bottom: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(236, 210, 140, .52);
  border-radius: 999px;
  color: #fff6db;
  background: rgba(116, 39, 31, .76);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.lesson-hero h1 {
  max-width: 850px;
  margin: 0 0 20px;
  color: #fffdf7;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.14;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.lesson-hero-inner > p {
  max-width: 790px;
  margin: 0;
  color: rgba(255, 255, 255, .83);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.85;
}

.lesson-meta {
  max-width: 980px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 25px;
}

.lesson-meta span {
  display: inline-flex;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(232, 211, 157, .3);
  border-radius: 7px;
  color: rgba(255, 255, 255, .8);
  background: rgba(7, 32, 43, .45);
  font-size: 10px;
}

.lesson-meta b {
  color: #efd276;
}

.lesson-start {
  min-width: 180px;
  text-decoration: none;
}

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 26px;
  padding-block: 58px 82px;
}

.lesson-article {
  display: grid;
  gap: 20px;
}

.lesson-card,
.lesson-side-card {
  border: 1px solid #dfd2ba;
  color: #31464e;
  background: rgba(255, 253, 248, .97);
  box-shadow: 0 16px 38px rgba(73, 54, 28, .08);
}

.lesson-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 46px);
  border-radius: 6px 6px 22px 6px;
  scroll-margin-top: 100px;
}

.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: repeating-linear-gradient(135deg, #842d24 0 12px, #d3ae52 12px 24px, #173e50 24px 36px);
}

.lesson-card .section-kicker {
  color: #92352c;
}

.lesson-card h2 {
  margin: 8px 0 24px;
  color: #153d4f;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.3;
}

.lesson-card h3 {
  color: #173e50;
}

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

.lesson-objectives > div {
  min-height: 106px;
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: start;
  gap: 12px;
  padding: 17px;
  border: 1px solid #e3d8c2;
  border-radius: 6px 6px 15px 6px;
  background: #faf6ed;
}

.lesson-objectives span,
.lesson-steps > li > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff9e8;
  background: linear-gradient(145deg, #9a362c, #6f251f);
  font-weight: 900;
}

.lesson-objectives p {
  margin: 0;
  line-height: 1.75;
}

.lesson-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.lesson-tools span {
  padding: 9px 13px;
  border: 1px solid #d8c18b;
  border-radius: 999px;
  color: #173e50;
  background: #fff8e6;
  font-size: 12px;
  font-weight: 800;
}

.lesson-note {
  margin: 22px 0 0;
  padding: 16px 18px;
  border-left: 4px solid #c49c3f;
  color: #625b4f;
  background: #f7f0df;
  line-height: 1.75;
}

.lesson-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lesson-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 0 0 26px;
}

.lesson-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 4px;
  left: 18px;
  width: 1px;
  background: #d8c494;
}

.lesson-steps h3 {
  margin: 3px 0 7px;
  font-size: 18px;
}

.lesson-steps p {
  margin: 0;
  line-height: 1.8;
}

.lesson-prompt-card pre {
  margin: 0;
  padding: 22px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(225, 196, 119, .4);
  border-radius: 7px 7px 16px 7px;
  color: #f9f3e3;
  background: linear-gradient(145deg, #173f51, #092e40);
  font: 500 13px/1.85 "Noto Sans Thai", Tahoma, sans-serif;
}

.lesson-prompt-card > p {
  margin: 17px 0 0;
  color: #6c6d66;
  line-height: 1.75;
}

.lesson-assignment {
  margin-bottom: 26px;
  padding: 22px;
  border: 1px solid #d9be78;
  border-radius: 6px 6px 17px 6px;
  color: #56322b;
  background: linear-gradient(135deg, #fff7df, #f5ead0);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.85;
}

.lesson-rubric {
  overflow: hidden;
  border: 1px solid #ded3bd;
  border-radius: 8px;
}

.lesson-rubric > div {
  display: grid;
  grid-template-columns: 1fr 76px;
  gap: 12px;
  padding: 13px 16px;
}

.lesson-rubric > div:nth-child(odd) {
  background: #faf6ee;
}

.lesson-rubric strong {
  color: #8d3028;
  text-align: right;
}

.lesson-safety {
  color: #f5f1e7;
  background: linear-gradient(145deg, #173f51, #092e40);
}

.lesson-safety h2,
.lesson-safety .section-kicker {
  color: #f0d276;
}

.lesson-safety ul {
  display: grid;
  gap: 11px;
  margin: 0;
  padding-left: 22px;
}

.lesson-safety li {
  color: rgba(255, 255, 255, .82);
  line-height: 1.75;
}

.lesson-sidebar {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

.lesson-side-card {
  display: grid;
  padding: 23px;
  border-radius: 5px 5px 18px 5px;
}

.lesson-side-label {
  margin-bottom: 14px;
  color: #8d3028;
  font-size: 12px;
  font-weight: 900;
}

.lesson-side-card a {
  padding: 11px 0;
  border-top: 1px solid #e8decc;
  color: #234858;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.lesson-side-card a:hover {
  color: #8d3028;
}

.lesson-check-card {
  gap: 10px;
}

.lesson-check-card label {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  line-height: 1.55;
}

.lesson-check-card label span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #23805a;
}

.lesson-media-link {
  width: 100%;
  text-decoration: none;
}

@media (max-width: 980px) {
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-media-link {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .lesson-hero {
    min-height: 650px;
  }

  .lesson-hero-media img {
    object-position: 62% center;
  }

  .lesson-hero-media::after {
    background: linear-gradient(90deg, rgba(5, 37, 52, .96), rgba(8, 46, 63, .78));
  }

  .lesson-breadcrumb {
    margin-bottom: 30px;
  }

  .lesson-hero h1 {
    font-size: clamp(34px, 11vw, 50px);
  }

  .lesson-meta {
    display: grid;
  }

  .lesson-layout {
    padding-block: 34px 56px;
  }

  .lesson-objectives {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    grid-template-columns: 1fr;
  }

  .lesson-rubric > div {
    grid-template-columns: 1fr 58px;
  }
}

/* Accessible typography v34: readable for older adults without a floating toolbar */
:root {
  --pb1-readable-body: 18px;
  --pb1-readable-small: 15px;
  --pb1-readable-label: 16px;
  --pb1-readable-line: 1.72;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-size: var(--pb1-readable-body);
  line-height: var(--pb1-readable-line);
}

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

.agency-strip {
  font-size: 14px;
}

.brand-title {
  font-size: 18px;
  line-height: 1.45;
}

.brand-subtitle {
  font-size: 14px;
  line-height: 1.5;
}

.main-nav a {
  min-height: 48px;
  padding-inline: 13px;
  font-size: 16px;
  line-height: 1.45;
}

.btn,
.admin-nav .btn {
  min-height: 48px;
  padding: 10px 17px;
  font-size: 16px;
  line-height: 1.35;
}

.btn-small {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 15px;
}

body.thai-heritage-theme .btn,
body.thai-heritage-theme .admin-nav .btn {
  min-height: 48px;
  padding: 10px 17px;
  font-size: 16px;
  line-height: 1.35;
}

body.thai-heritage-theme .btn-small {
  min-height: 42px;
  padding: 8px 13px;
  font-size: 15px;
}

.eyebrow,
.section-kicker,
.portal-label,
.subject-number,
.stat-index,
.featured-badge,
.pill,
.announcement-badge,
.ad-label {
  font-size: 14px;
  line-height: 1.5;
}

.hero-copy > p,
.hero-portal-card > p,
.discovery-heading p,
.section-heading p,
.stats-intro p,
.about-section p {
  font-size: 18px;
  line-height: 1.8;
}

.hero-trust span {
  font-size: 15px;
  line-height: 1.55;
}

.notice-ticker,
.notice-ticker .announcement,
.notice-ticker > a {
  font-size: 17px;
  line-height: 1.65;
}

.notice-label {
  font-size: 15px;
}

.search-primary label,
.filters label,
.field label,
.auth-field label,
.auth-register-form .field label {
  font-size: 16px;
  line-height: 1.55;
}

.input,
.select,
.textarea {
  min-height: 50px;
  font-size: 17px;
  line-height: 1.55;
}

body.thai-heritage-theme .input,
body.thai-heritage-theme .select,
body.thai-heritage-theme .textarea {
  min-height: 50px;
  font-size: 17px;
  line-height: 1.55;
}

.subject-card strong {
  font-size: 18px;
  line-height: 1.45;
}

body.thai-heritage-theme .subject-card strong {
  font-size: 18px;
  line-height: 1.45;
}

.subject-card > span:last-child {
  font-size: 15px;
  line-height: 1.55;
}

.stat-label,
.stats-section .stat-label {
  font-size: 15px;
  line-height: 1.5;
}

.media-title {
  font-size: 19px;
  line-height: 1.5;
}

.media-desc {
  font-size: 17px;
  line-height: 1.75;
}

.media-owner,
.metrics {
  font-size: 15px;
  line-height: 1.6;
}

.announcement-card h3,
.ad-card h3,
.highlight-copy h3 {
  font-size: 20px;
  line-height: 1.45;
}

.announcement-card p,
.ad-card p,
.highlight-copy p,
.site-footer p {
  font-size: 16px;
  line-height: 1.75;
}

.announcement-card a,
.ad-card a,
.section-link,
.highlight-head > a,
.site-footer a,
.site-footer button,
.footer-bottom {
  font-size: 15px;
  line-height: 1.55;
}

.highlight-copy > span,
.highlight-thumb b {
  font-size: 14px;
}

/* Login, registration, member dashboard and administrator screens */
.auth-formal .auth-lead,
.auth-formal .auth-register-heading p,
.auth-formal .auth-story p {
  font-size: 17px;
  line-height: 1.75;
}

.auth-formal .auth-eyebrow,
.auth-formal .auth-story-kicker {
  font-size: 14px;
}

.auth-formal .auth-field label,
.auth-formal .auth-register-form .field label {
  font-size: 16px;
}

.auth-formal .auth-input-wrap .input,
.auth-formal .auth-register-form .input {
  min-height: 54px;
  font-size: 17px;
}

.auth-formal .auth-security-note,
.auth-formal .password-policy-note,
.auth-formal .auth-consent,
.auth-formal .auth-benefits span,
.auth-formal .auth-steps li,
.auth-formal .auth-switch,
.auth-formal .auth-text-button,
.auth-formal .auth-back-button {
  font-size: 15px;
  line-height: 1.65;
}

.member-course-card span,
.member-course-card small,
.password-policy-note,
.small {
  font-size: 15px;
  line-height: 1.6;
}

.member-course-card strong {
  font-size: 18px;
  line-height: 1.5;
}

#adminApp,
#adminApp .panel,
#adminApp p,
#adminApp label {
  font-size: 16px;
  line-height: 1.65;
}

#adminApp th,
#adminApp td {
  padding: 13px 14px;
  font-size: 15px;
  line-height: 1.6;
}

#adminApp .input,
#adminApp .select,
#adminApp .textarea {
  font-size: 16px;
}

/* Media detail page */
.media-v2-breadcrumb {
  min-height: 40px;
  font-size: 14px;
  line-height: 1.55;
}

.media-v2-kicker,
.media-detail-v2 .media-detail-tags span {
  font-size: 15px;
  line-height: 1.5;
}

.media-v2-owner small {
  font-size: 14px;
  line-height: 1.5;
}

.media-v2-owner strong {
  font-size: 17px;
  line-height: 1.5;
}

.media-v2-owner div span {
  font-size: 15px;
  line-height: 1.55;
}

.media-detail-v2 .media-detail-description {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.85;
}

.media-v2-actions .btn {
  min-height: 54px;
  padding-inline: 20px;
  font-size: 17px;
}

.media-v2-trust {
  gap: 16px;
}

.media-v2-trust span {
  font-size: 15px;
  line-height: 1.55;
}

.media-v2-verified strong {
  font-size: 16px;
  line-height: 1.45;
}

.media-v2-verified small {
  font-size: 14px;
  line-height: 1.5;
}

.media-v2-overview .section-heading p {
  font-size: 17px;
  line-height: 1.7;
}

.media-v2-facts dt {
  font-size: 15px;
  line-height: 1.5;
}

.media-v2-facts dd {
  font-size: 17px;
  line-height: 1.65;
}

.media-v2-keywords h3,
.media-v2-transcript summary strong {
  font-size: 17px;
  line-height: 1.5;
}

.media-v2-keywords span,
.media-v2-transcript summary small {
  font-size: 15px;
  line-height: 1.55;
}

.media-v2-transcript > div {
  font-size: 17px;
  line-height: 1.8;
}

.media-v2-guide li strong {
  font-size: 17px;
  line-height: 1.5;
}

.media-v2-guide li small {
  font-size: 15px;
  line-height: 1.65;
}

.media-v2-quality-head small,
.media-v2-quality p,
.media-v2-rights p {
  font-size: 15px;
  line-height: 1.7;
}

.media-v2-quality-head strong,
.media-v2-rights strong {
  font-size: 18px;
  line-height: 1.5;
}

.media-v2-related .section-heading > a {
  font-size: 15px;
}

.media-v2-related-body small,
.media-v2-related-body span {
  font-size: 14px;
  line-height: 1.5;
}

.media-v2-related-body strong {
  font-size: 17px;
  line-height: 1.5;
}

/* Five-topic course pages */
.course-breadcrumb {
  font-size: 15px;
  line-height: 1.55;
}

.course-label {
  min-height: 38px;
  font-size: 15px;
}

.course-hero-copy > p {
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.8;
}

.course-hero-meta span {
  min-height: 46px;
  font-size: 15px;
  line-height: 1.5;
}

.course-progress-label {
  font-size: 14px;
}

.course-progress-banner strong {
  font-size: 17px;
  line-height: 1.5;
}

.course-side-head span {
  font-size: 17px;
}

.course-side-head strong {
  font-size: 14px;
}

.course-topic-nav a {
  min-height: 96px;
}

.course-topic-number {
  font-size: 15px;
}

.course-topic-nav small {
  font-size: 14px;
  line-height: 1.5;
}

.course-topic-nav strong {
  font-size: 16px;
  line-height: 1.55;
}

.course-topic-nav i {
  font-size: 14px;
}

.course-side-note strong {
  font-size: 16px;
}

.course-side-note p {
  font-size: 15px;
  line-height: 1.7;
}

.course-topic-image > span,
.course-section-title small,
.course-complete-panel span,
.course-assignment-head > span,
.course-certificate-panel span {
  font-size: 14px;
  line-height: 1.5;
}

.course-topic-heading > p {
  font-size: 18px;
  line-height: 1.8;
}

.course-outcome {
  font-size: 17px;
  line-height: 1.7;
}

.course-section-title > span,
.course-concepts b,
.course-workflow li > span {
  font-size: 14px;
}

.course-concepts p,
.course-workflow p {
  font-size: 17px;
  line-height: 1.8;
}

.course-prompt-card pre {
  font-size: 17px;
  line-height: 1.8;
}

.course-copy-button {
  min-height: 48px;
  font-size: 16px;
}

.course-practice {
  font-size: 18px;
  line-height: 1.8;
}

.course-checklist span {
  padding: 9px 13px;
  font-size: 15px;
  line-height: 1.5;
}

.course-complete-panel h3 {
  font-size: 22px;
  line-height: 1.5;
}

.course-complete-panel p,
.course-assignment-lock p {
  font-size: 16px;
  line-height: 1.7;
}

.course-topic-pager a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 16px;
}

.course-assignment-head p {
  font-size: 17px;
  line-height: 1.8;
}

.course-assignment-lock strong {
  font-size: 20px;
  line-height: 1.5;
}

.course-assignment-form label {
  font-size: 16px;
  line-height: 1.6;
}

.course-assignment-form input,
.course-assignment-form textarea {
  min-height: 52px;
  font-size: 17px;
  line-height: 1.6;
}

.course-assignment-form label > small,
.course-assignment-form .course-consent {
  font-size: 15px;
  line-height: 1.7;
}

.course-certificate-panel h2 {
  font-size: 24px;
  line-height: 1.45;
}

.course-certificate-panel p,
.course-submission-result,
.course-toast {
  font-size: 16px;
  line-height: 1.65;
}

/* Informational and legacy lesson pages */
.legal-content,
.lesson-copy,
.lesson-safety li {
  font-size: 18px;
  line-height: 1.9;
}

.legal-meta,
.lesson-side-label,
.lesson-side-card a,
.lesson-check-card label {
  font-size: 15px;
  line-height: 1.65;
}

@media (prefers-contrast: more) {
  body {
    color: #071e30;
  }

  .media-card,
  .subject-card,
  .panel,
  .course-content-card,
  .media-v2-overview,
  .media-v2-guide {
    border-width: 2px;
  }

  .muted,
  .media-desc,
  .course-topic-heading > p,
  .media-v2-facts dt {
    color: #334b5b;
  }
}

@media (max-width: 760px) {
  :root {
    --pb1-readable-body: 17px;
  }

  .agency-strip {
    font-size: 13px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-subtitle {
    font-size: 13px;
  }

  .top-actions .btn {
    min-height: 46px;
    padding-inline: 13px;
    font-size: 15px;
  }

  body.thai-heritage-theme .top-actions .header-action,
  body.thai-heritage-theme .top-actions .mobile-menu-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    font-size: 14px;
  }

  body.thai-heritage-theme .brand-title {
    max-width: 205px;
    font-size: 16px;
    line-height: 1.4;
  }

  body.thai-heritage-theme .agency-strip-inner {
    font-size: 13px;
  }

  .media-v2-copy h1 {
    font-size: clamp(36px, 10vw, 48px);
    line-height: 1.25;
  }

  .media-detail-v2 .media-detail-description,
  .course-topic-heading > p,
  .course-concepts p,
  .course-workflow p,
  .course-prompt-card pre {
    font-size: 17px;
  }

  .media-v2-facts dt,
  .media-v2-guide li small,
  .media-v2-quality p,
  .media-v2-rights p {
    font-size: 15px;
  }

  .course-topic-nav {
    grid-template-columns: repeat(5, minmax(210px, 1fr));
  }

  .course-topic-nav a {
    min-height: 102px;
  }
}

/* Home hero without the innovation dashboard card (V46). */
body.thai-heritage-theme .hero-layout {
  grid-template-columns: minmax(0, 1fr);
}

body.thai-heritage-theme .hero-copy {
  width: min(790px, 100%);
}

/* Modern classroom hero scenery (V58). */
body.thai-heritage-theme:not(.high-contrast) .hero-backdrop {
  background:
    linear-gradient(180deg, rgba(9, 29, 32, .04), rgba(13, 30, 29, .18)),
    url("hero-modern-classroom-v1.png") center center / cover no-repeat;
}

@media (max-width: 720px) {
  body.thai-heritage-theme:not(.high-contrast) .hero-backdrop {
    background-position: 62% center;
  }
}

/* Learning hub dashboard and course leaderboard (V51). */
.learning-hub-panel,
.course-leaderboard-panel {
  display: grid;
  gap: 26px;
  margin: 20px 0 28px;
}

.learning-rank-banner,
.course-leaderboard-status {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 28px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 12%, rgba(255,255,255,.22), transparent 28%),
    linear-gradient(135deg, #235bb8, #1f4591 58%, #16336f);
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(19, 49, 100, .22);
}

.learning-rank-avatar,
.course-leaderboard-avatar {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  font-size: 38px;
  background: rgba(255,255,255,.18);
  border: 3px solid rgba(255,255,255,.4);
  border-radius: 999px;
  box-shadow: inset 0 0 0 8px rgba(255,255,255,.12);
}

.learning-rank-banner small,
.course-leaderboard-status small {
  display: block;
  margin-bottom: 4px;
  color: rgba(255,255,255,.82);
  font-size: 15px;
  font-weight: 800;
}

.learning-rank-banner strong,
.course-leaderboard-status strong {
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1.35;
}

.learning-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr);
  gap: 22px;
}

.learning-course-feature,
.learning-leaderboard-home,
.course-leaderboard-card,
.course-ebook-card,
.course-video-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(255,250,238,.92)),
    radial-gradient(circle at top right, rgba(218, 177, 80, .18), transparent 34%);
  border: 1px solid rgba(206, 173, 101, .5);
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(72, 49, 18, .11);
}

.learning-course-feature {
  padding: clamp(26px, 4vw, 42px);
}

.learning-course-feature h3 {
  margin: 8px 0 12px;
  color: #0d3150;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.16;
}

.learning-course-feature p {
  max-width: 680px;
  color: #53655d;
  font-size: 19px;
  line-height: 1.85;
}

.learning-course-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.learning-course-stats span {
  padding: 14px 12px;
  text-align: center;
  color: #823128;
  background: #fff7df;
  border: 1px solid #e7ca80;
  border-radius: 16px;
  font-weight: 900;
}

.learning-course-stats b {
  display: block;
  font-size: 26px;
}

.learning-leaderboard-home,
.course-leaderboard-card {
  padding: 24px;
}

.learning-leaderboard-title,
.course-leaderboard-head {
  text-align: center;
  color: #8b5600;
  font-size: 24px;
  font-weight: 1000;
}

.course-leaderboard-head small {
  display: block;
  margin-top: 6px;
  color: #66756f;
  font-size: 14px;
  font-weight: 700;
}

.learning-podium,
.course-leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  min-height: 245px;
  margin-top: 18px;
  padding: 12px 6px 0;
  border-bottom: 1px dashed #e0c78e;
}

.learning-podium-person,
.course-podium-slot {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 10px 20px;
  text-align: center;
  border-radius: 20px 20px 0 0;
}

.learning-podium-person.rank-1,
.course-podium-slot.rank-1 {
  min-height: 222px;
  background: linear-gradient(180deg, #ffe18a, #f5a80d);
  box-shadow: 0 12px 30px rgba(237, 169, 19, .35);
}

.learning-podium-person.rank-2,
.course-podium-slot.rank-2 {
  min-height: 170px;
  background: linear-gradient(180deg, #eef4fb, #b8c6d7);
}

.learning-podium-person.rank-3,
.course-podium-slot.rank-3 {
  min-height: 152px;
  background: linear-gradient(180deg, #f9cfaa, #cd7a37);
}

.learning-medal,
.course-podium-medal {
  color: #8f2d25;
  font-size: 26px;
  font-weight: 1000;
}

.learning-avatar,
.course-podium-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: #fff;
  background: linear-gradient(135deg, #0d4b64, #2f8c7d);
  border: 5px solid rgba(255,255,255,.72);
  border-radius: 999px;
  font-size: 28px;
  font-weight: 1000;
}

.learning-podium-person strong,
.course-podium-slot strong {
  color: #173850;
  font-size: 16px;
}

.learning-podium-person small,
.course-podium-slot small {
  color: rgba(23,56,80,.75);
  font-size: 12px;
}

.learning-podium-person b,
.course-podium-slot b {
  padding: 5px 12px;
  background: rgba(255,255,255,.65);
  border-radius: 999px;
}

.learning-rank-list,
.course-leaderboard-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.learning-rank-list article,
.course-leaderboard-list article {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,.72);
  border: 1px solid #ecd8aa;
  border-radius: 16px;
}

.learning-rank-list article > span,
.course-leaderboard-list article > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #9b3129;
  background: #fff3d2;
  border-radius: 999px;
  font-weight: 1000;
}

.learning-rank-list small,
.course-leaderboard-list small {
  display: block;
  color: #7b8883;
}

.learning-course-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.learning-course-strip a {
  display: grid;
  gap: 6px;
  min-height: 126px;
  padding: 18px;
  color: #123653;
  text-decoration: none;
  background: rgba(255,255,255,.86);
  border: 1px solid #e4c98f;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(72,49,18,.08);
  transition: transform .22s ease, box-shadow .22s ease;
}

.learning-course-strip a:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(72,49,18,.15);
}

.learning-course-strip span {
  color: #9a362e;
  font-weight: 1000;
}

.learning-course-strip strong {
  font-size: 18px;
}

.learning-course-strip small,
.learning-empty-note {
  color: #687972;
}

.learning-empty,
.course-leaderboard-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  padding: 28px;
  color: #7b5c22;
  text-align: center;
  background: #fff7df;
  border: 1px dashed #dcb767;
  border-radius: 18px;
}

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

.course-ebook-pages article {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  background: #fffaf0;
  border: 1px solid #ead3a0;
  border-radius: 18px;
}

.course-ebook-pages span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: #9e312a;
  border-radius: 999px;
  font-weight: 1000;
}

.course-video-player {
  padding: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.22), transparent 28%),
    linear-gradient(135deg, #061d30, #0d4a58 58%, #1e7c70);
  border-radius: 22px;
}

.course-video-screen {
  display: grid;
  place-items: center;
  min-height: 220px;
  gap: 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
}

.course-video-play {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #f4d46a, #ba8127);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0,0,0,.24);
}

.course-video-screen strong {
  font-size: clamp(22px, 3vw, 34px);
}

.course-video-screen small {
  color: rgba(255,255,255,.78);
}

.course-video-timeline {
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
  background: rgba(255,255,255,.2);
  border-radius: 999px;
}

.course-video-timeline i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f8d872, #fff2b5);
  border-radius: inherit;
}

.course-video-chapters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.course-video-chapters span {
  padding: 12px 14px;
  color: #173850;
  background: rgba(255,255,255,.78);
  border: 1px solid #e8d0a0;
  border-radius: 14px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .learning-dashboard-grid,
  .learning-course-strip,
  .course-ebook-pages,
  .course-video-chapters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .learning-rank-banner,
  .course-leaderboard-status {
    align-items: flex-start;
    padding: 18px;
  }

  .learning-podium,
  .course-leaderboard-podium {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .learning-podium-person.rank-1,
  .learning-podium-person.rank-2,
  .learning-podium-person.rank-3,
  .course-podium-slot.rank-1,
  .course-podium-slot.rank-2,
  .course-podium-slot.rank-3 {
    min-height: auto;
    border-radius: 18px;
  }
}

/* Education Prompt Library v52 */
body.prompt-library-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(222, 184, 85, .22), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(23, 77, 105, .18), transparent 32%),
    linear-gradient(180deg, #fffaf0 0%, #f6ead4 100%);
}

.prompt-topbar .main-nav a.active,
.prompt-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, #9e332b, #7c2423);
  box-shadow: inset 0 -4px 0 rgba(244, 212, 106, .8), 0 12px 24px rgba(124, 36, 35, .18);
}

.prompt-app {
  position: relative;
  overflow: hidden;
}

.prompt-hero {
  position: relative;
  min-height: clamp(520px, 66vw, 720px);
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(7, 39, 57, .94) 0%, rgba(7, 39, 57, .78) 48%, rgba(96, 49, 35, .62) 100%),
    url("hero-phakhun-ancient-v1.webp") center/cover no-repeat;
  border-bottom: 12px solid transparent;
}

.prompt-hero::before,
.prompt-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  background:
    linear-gradient(135deg, #7d2a22 0 18%, transparent 18% 28%, #e6bf55 28% 46%, transparent 46% 56%, #11384c 56% 74%, transparent 74% 84%, #fff9e6 84% 100%);
  background-size: 42px 14px;
  z-index: 1;
}

.prompt-hero::before {
  top: 0;
}

.prompt-hero::after {
  bottom: 0;
}

.prompt-blob {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  filter: blur(16px);
  opacity: .55;
  pointer-events: none;
  animation: promptFloat 8s ease-in-out infinite;
}

.prompt-blob-one {
  left: 8%;
  top: 14%;
  background: radial-gradient(circle, rgba(244, 212, 106, .38), transparent 66%);
}

.prompt-blob-two {
  right: 8%;
  bottom: 12%;
  background: radial-gradient(circle, rgba(0, 178, 178, .24), transparent 66%);
  animation-delay: -3s;
}

@keyframes promptFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  45% { transform: translate3d(18px, -22px, 0) scale(1.06); }
}

.prompt-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .72fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding-top: clamp(56px, 8vw, 100px);
  padding-bottom: clamp(56px, 8vw, 100px);
}

.prompt-hero-copy h1 {
  margin: 14px 0 18px;
  max-width: 820px;
  font-size: clamp(44px, 7vw, 92px);
  line-height: .96;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.prompt-hero-copy p {
  max-width: 760px;
  margin: 0;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.85;
  color: rgba(255,255,255,.88);
}

.prompt-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.prompt-hero-actions .btn {
  min-height: 54px;
  padding-inline: 24px;
  text-decoration: none;
}

.prompt-hero-card {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(244, 212, 106, .48);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 250, 238, .96), rgba(255, 244, 218, .9)),
    radial-gradient(circle at 100% 0%, rgba(222, 184, 85, .3), transparent 34%);
  color: #12344a;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .22);
}

.prompt-hero-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 22px;
  color: #f8d872;
  background: linear-gradient(135deg, #0b3a55, #082a40);
  border: 1px solid rgba(222, 184, 85, .62);
  border-radius: 28px;
  font-size: 34px;
  font-weight: 1000;
  box-shadow: 0 18px 44px rgba(8, 42, 64, .26);
}

.prompt-hero-card h2 {
  margin: 0 0 18px;
  font-size: clamp(26px, 3vw, 36px);
}

.prompt-hero-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.prompt-hero-card div {
  padding: 16px 12px;
  border: 1px solid #e6c980;
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  text-align: center;
}

.prompt-hero-card dt {
  color: #9d3027;
  font-size: 26px;
  font-weight: 1000;
}

.prompt-hero-card dd {
  margin: 2px 0 0;
  color: #54636b;
  font-weight: 800;
}

.prompt-toolbar {
  display: grid;
  grid-template-columns: minmax(230px, .72fr) minmax(320px, 1.1fr) auto;
  gap: 18px;
  align-items: end;
  margin-top: clamp(24px, 5vw, 54px);
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(198, 156, 64, .42);
  border-radius: 30px;
  background: rgba(255, 252, 244, .9);
  box-shadow: 0 20px 50px rgba(78, 50, 19, .1);
}

.prompt-toolbar h2 {
  margin: 8px 0 0;
  color: #12344a;
  font-size: clamp(28px, 3vw, 42px);
}

.prompt-search-wrap {
  display: grid;
  gap: 8px;
}

.prompt-search-wrap label {
  color: #193b52;
  font-weight: 900;
}

.prompt-search-wrap input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid #d8c398;
  border-radius: 18px;
  background: #fff;
  color: #15364d;
  font: inherit;
  font-weight: 800;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.03);
}

.prompt-search-wrap input:focus {
  border-color: #9e332b;
  box-shadow: 0 0 0 4px rgba(158, 51, 43, .12);
}

.prompt-view-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.prompt-view-controls span {
  padding: 10px 14px;
  color: #0d4356;
  background: #e4f2ef;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.prompt-view-controls button {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid #d8c398;
  border-radius: 14px;
  background: #fff;
  color: #173850;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.prompt-view-controls button.active {
  border-color: #9e332b;
  background: #9e332b;
  color: #fff;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: 24px;
  padding-bottom: clamp(44px, 8vw, 90px);
}

.prompt-grid[data-view="list"] {
  grid-template-columns: 1fr;
}

.prompt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 360px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(199, 161, 84, .48);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,248,233,.92)),
    radial-gradient(circle at 100% 0%, rgba(226, 188, 84, .22), transparent 34%);
  box-shadow: 0 18px 42px rgba(83, 55, 24, .12);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.prompt-card:hover {
  transform: translateY(-6px);
  border-color: rgba(158, 51, 43, .45);
  box-shadow: 0 28px 58px rgba(83, 55, 24, .18);
}

.prompt-card-ribbon {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, #0c3f55 0 24%, #dfbd57 24% 48%, #9e332b 48% 72%, #1b7b70 72% 100%);
}

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

.prompt-file-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: #fff;
  border-radius: 20px;
  font-weight: 1000;
  letter-spacing: .04em;
  box-shadow: 0 14px 28px rgba(0,0,0,.14);
}

.prompt-type-txt { background: linear-gradient(135deg, #164660, #0a3045); }
.prompt-type-pdf { background: linear-gradient(135deg, #9e332b, #c24a3d); }
.prompt-type-doc { background: linear-gradient(135deg, #1b6090, #0d3e68); }
.prompt-type-xls { background: linear-gradient(135deg, #1c806f, #0c584d); }
.prompt-type-ppt { background: linear-gradient(135deg, #bd7a2b, #9e3d22); }
.prompt-type-vid { background: linear-gradient(135deg, #8b3d74, #572c62); }
.prompt-type-img { background: linear-gradient(135deg, #7a5bb7, #3f5b9b); }

.prompt-card-head > div {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.prompt-date,
.prompt-clicks {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(13, 67, 86, .08);
  color: #173850;
  font-size: 13px;
  font-weight: 900;
}

.prompt-clicks {
  color: #8c2f28;
  background: rgba(158, 51, 43, .09);
}

.prompt-card h3 {
  margin: 0;
  min-height: 68px;
  color: #12344a;
  font-size: clamp(20px, 1.65vw, 25px);
  line-height: 1.45;
}

.prompt-card p {
  flex: 1;
  margin: 0;
  color: #51616a;
  font-size: 16px;
  line-height: 1.72;
}

.prompt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-meta span {
  padding: 7px 10px;
  color: #0e5d55;
  background: #dff1ed;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.prompt-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.prompt-card-actions .btn {
  justify-content: center;
  min-height: 48px;
  text-decoration: none;
}

.prompt-grid[data-view="list"] .prompt-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: auto;
}

.prompt-grid[data-view="list"] .prompt-card h3 {
  min-height: auto;
}

.prompt-grid[data-view="list"] .prompt-card p {
  grid-column: 2 / 3;
}

.prompt-grid[data-view="list"] .prompt-meta,
.prompt-grid[data-view="list"] .prompt-card-actions {
  grid-column: 3 / 4;
}

.prompt-empty {
  margin-top: 24px;
  padding: 44px 20px;
  border: 1px dashed #d3ba82;
  border-radius: 28px;
  color: #173850;
  background: rgba(255,255,255,.72);
  text-align: center;
}

.prompt-empty div {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border: 1px solid #dfbd57;
  border-radius: 999px;
  color: #9e332b;
  font-size: 34px;
}

.prompt-dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
}

.prompt-dialog::backdrop {
  background: rgba(7, 39, 57, .62);
  backdrop-filter: blur(5px);
}

.prompt-dialog-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid #d8bd76;
  border-radius: 30px;
  background: #fffaf0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
}

.prompt-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 1px solid #e5d0a6;
  border-radius: 999px;
  background: #fff;
  color: #12344a;
  font-size: 26px;
  cursor: pointer;
}

.prompt-dialog h2 {
  margin: 8px 46px 0 0;
  color: #12344a;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.25;
}

.prompt-dialog p {
  margin: 0;
  color: #65737a;
  font-weight: 800;
}

.prompt-dialog textarea {
  width: 100%;
  padding: 18px;
  border: 1px solid #d8c398;
  border-radius: 20px;
  background: #fff;
  color: #173850;
  font: inherit;
  font-size: 18px;
  line-height: 1.8;
  resize: vertical;
}

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

.prompt-dialog small {
  color: #7a6646;
  font-weight: 800;
}

.prompt-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  padding: 14px 18px;
  color: #fff;
  background: linear-gradient(135deg, #0d5c54, #0b3a55);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.22);
  font-weight: 900;
}

.prompt-footer a {
  color: #f6d36a;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .prompt-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .prompt-toolbar {
    grid-template-columns: 1fr;
  }

  .prompt-view-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .prompt-hero-inner {
    grid-template-columns: 1fr;
  }

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

  .prompt-grid[data-view="list"] .prompt-card {
    grid-template-columns: 1fr;
  }

  .prompt-grid[data-view="list"] .prompt-card p,
  .prompt-grid[data-view="list"] .prompt-meta,
  .prompt-grid[data-view="list"] .prompt-card-actions {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .prompt-hero-copy h1 {
    font-size: clamp(42px, 15vw, 64px);
  }

  .prompt-hero-card dl,
  .prompt-grid,
  .prompt-card-actions {
    grid-template-columns: 1fr;
  }

  .prompt-view-controls span {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .prompt-blob,
  .prompt-card {
    animation: none !important;
    transition: none !important;
  }
}

/* CourseHub-style lesson detail upgrade (V59). */
.coursehub-detail-overview {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(280px, .92fr) minmax(0, 1.08fr) minmax(260px, .62fr);
  gap: 18px;
  margin-top: -54px;
  margin-bottom: 26px;
  align-items: stretch;
}

.coursehub-preview-card,
.coursehub-overview-card,
.coursehub-enroll-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 189, 118, .72);
  border-radius: 30px;
  background: rgba(255, 251, 241, .94);
  box-shadow: 0 24px 70px rgba(20, 44, 55, .16);
}

.coursehub-preview-card {
  min-height: 320px;
  background: #092d40;
}

.coursehub-preview-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .5s ease, filter .5s ease;
}

.coursehub-preview-card:hover img {
  filter: saturate(1.08);
  transform: scale(1.07);
}

.coursehub-preview-overlay {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(11, 56, 78, .92), rgba(126, 48, 43, .86));
  backdrop-filter: blur(10px);
}

.coursehub-preview-overlay small,
.coursehub-preview-overlay strong {
  display: block;
}

.coursehub-preview-overlay small {
  color: rgba(255,255,255,.78);
  font-size: 13px;
  font-weight: 900;
}

.coursehub-preview-overlay strong {
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.35;
}

.coursehub-play-button {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 999px;
  color: #7e302b;
  background: linear-gradient(135deg, #ffe486, #d7a83d);
  box-shadow: 0 14px 28px rgba(0,0,0,.22);
}

.coursehub-overview-card {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 3vw, 34px);
}

.coursehub-overview-card::before,
.coursehub-enroll-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 9px;
  content: "";
  background: repeating-linear-gradient(135deg, #8f302a 0 12px, #f1cf61 12px 24px, #103a4e 24px 36px);
}

.coursehub-overview-card h2 {
  margin: 0;
  color: #123a50;
  font-size: clamp(31px, 3.4vw, 52px);
  line-height: 1.16;
}

.coursehub-overview-card p {
  margin: 0;
  color: #455b65;
  font-size: clamp(17px, 1.35vw, 21px);
  line-height: 1.75;
}

.coursehub-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.coursehub-stat-grid div {
  min-height: 84px;
  padding: 13px 10px;
  border: 1px solid #e4c885;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaf0, #fff2d7);
  text-align: center;
}

.coursehub-stat-grid span,
.coursehub-stat-grid small {
  display: block;
}

.coursehub-stat-grid span {
  color: #9c332b;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 1000;
}

.coursehub-stat-grid small {
  color: #51636a;
  font-size: 13px;
  font-weight: 900;
}

.coursehub-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coursehub-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #0f584f;
  background: #dff2ed;
  font-size: 14px;
  font-weight: 900;
}

.coursehub-enroll-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(22px, 3vw, 30px);
}

.coursehub-enroll-card > span {
  color: #9c332b;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: .04em;
}

.coursehub-enroll-card h3 {
  margin: 0;
  color: #123a50;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.25;
}

.coursehub-enroll-card p {
  margin: 0 0 6px;
  color: #51636a;
  font-size: 16px;
  line-height: 1.75;
}

.coursehub-enroll-card .btn {
  width: 100%;
  justify-content: center;
  text-decoration: none;
}

.course-page .course-progress-banner {
  margin-top: 0;
}

.course-page .course-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 30px;
}

.course-page .course-sidebar {
  top: 110px;
  border-radius: 28px;
  box-shadow: 0 18px 45px rgba(20, 44, 55, .1);
}

.course-page .course-topic-head {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1fr);
  align-items: stretch;
}

.course-page .course-topic-image {
  height: 100%;
  min-height: 420px;
  aspect-ratio: auto;
}

.course-page .course-topic-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.course-page .course-content-card {
  border-radius: 28px;
  background: rgba(255,255,255,.9);
}

.course-page .course-section-title {
  align-items: center;
}

.course-page .course-leaderboard-card {
  padding-top: 30px;
}

.course-page .course-leaderboard-head span {
  font-size: clamp(24px, 3vw, 34px);
}

.course-page .course-leaderboard-list {
  display: none;
}

@media (max-width: 1180px) {
  .coursehub-detail-overview,
  .course-page .course-topic-head {
    grid-template-columns: 1fr;
  }

  .coursehub-enroll-card {
    min-height: auto;
  }
}

@media (max-width: 900px) {
  .coursehub-detail-overview {
    margin-top: -28px;
    grid-template-columns: 1fr;
  }

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

  .course-page .course-sidebar {
    top: auto;
  }

  .course-page .course-topic-image {
    min-height: 280px;
  }
}

@media (max-width: 640px) {
  .coursehub-detail-overview {
    margin-right: 12px;
    margin-left: 12px;
  }

  .coursehub-preview-card,
  .coursehub-overview-card,
  .coursehub-enroll-card {
    border-radius: 24px;
  }

  .coursehub-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* Homepage hero photo without the navy color overlay (V68). */
body.thai-heritage-theme:not(.high-contrast) .hero {
  background-color: transparent;
}

body.thai-heritage-theme:not(.high-contrast) .hero::before {
  display: none;
  background: none;
}

body.thai-heritage-theme:not(.high-contrast) .hero-inner {
  background: transparent;
  box-shadow: none;
}

/* Compact homepage hero (V70). */
body.thai-heritage-theme.system-pastel-theme .hero-visual {
  display: none;
  min-height: 0;
  margin: 0;
}

body.thai-heritage-theme:not(.high-contrast) .hero,
body.thai-heritage-theme.system-pastel-theme .hero-inner {
  min-height: 560px;
}

body.thai-heritage-theme.system-pastel-theme .hero-inner {
  padding-block: 42px 72px;
}

@media (max-width: 820px) {
  body.thai-heritage-theme:not(.high-contrast) .hero,
  body.thai-heritage-theme.system-pastel-theme .hero-inner {
    min-height: auto;
  }

  body.thai-heritage-theme.system-pastel-theme .hero-inner {
    padding-block: 32px 58px;
  }

  body.thai-heritage-theme.system-pastel-theme .hero-layout {
    gap: 0;
  }

  body.thai-heritage-theme.system-pastel-theme .hero h1 {
    margin-block: 10px 12px;
    font-size: clamp(34px, 6.6vw, 46px);
  }

  body.thai-heritage-theme .hero-actions {
    margin-top: 20px;
  }

  body.thai-heritage-theme .hero-trust {
    margin-top: 18px;
  }
}

@media (min-width: 581px) and (max-width: 820px) {
  body.thai-heritage-theme .hero-actions {
    display: grid;
    width: min(100%, 650px);
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.thai-heritage-theme .hero-trust {
    display: flex;
    gap: 10px 18px;
  }
}

@media (max-width: 580px) {
  body.thai-heritage-theme.system-pastel-theme .hero-inner {
    padding-block: 26px 48px;
  }

  body.thai-heritage-theme .hero-actions {
    margin-top: 18px;
  }

  body.thai-heritage-theme .hero-trust {
    margin-top: 16px;
  }
}
