:root {
  --bg: #f7f1e4;
  --surface: rgba(255, 250, 242, 0.82);
  --surface-strong: rgba(255, 250, 242, 0.94);
  --ink: #1d2430;
  --muted: #5e655f;
  --line: rgba(26, 35, 46, 0.1);
  --gold: #b58846;
  --gold-deep: #8f6426;
  --sage: #7d9884;
  --clay: #bc7a5c;
  --blue: #5f7da4;
  --shadow: 0 24px 80px rgba(28, 29, 31, 0.08);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Sans Thai", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(181, 136, 70, 0.16), transparent 25%),
    radial-gradient(circle at right 10% top 20%, rgba(95, 125, 164, 0.18), transparent 24%),
    linear-gradient(180deg, #faf4ea 0%, #f4ecdd 48%, #f6efe3 100%);
}

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

img {
  max-width: 100%;
  display: block;
}

.site-shell,
.admin-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.topbar,
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(29, 36, 48, 0.08);
  overflow: hidden;
}

.brand-mark img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.brand-copy strong,
.section-header h1,
.section-header h2,
.hero h1,
.hero-card h2,
.hall-card h3,
.panel-card h2,
.donation-card h3 {
  font-family: "Noto Serif Thai", serif;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand-title-image {
  display: block;
  width: min(46vw, 390px);
  height: 48px;
  object-fit: cover;
  object-position: center;
}

.brand-copy small,
.eyebrow,
.section-header span,
.hero-card-kicker {
  color: var(--gold-deep);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
}

.brand-copy small {
  line-height: 1;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.nav a,
.admin-link,
.footer-links a {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav a:hover,
.admin-link:hover,
.footer-links a:hover {
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 28px;
  padding: 34px 0 22px;
  align-items: stretch;
}

.hero-banner-section {
  margin: 14px 0 20px;
  padding: 16px;
  border-radius: 38px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-banner-section img {
  width: 100%;
  border-radius: 28px;
  object-fit: cover;
  background: rgba(255, 248, 240, 0.65);
}

.hero-copy,
.hero-card,
.hero-sidecard,
.story-panel,
.hall-card,
.gallery-card,
.event-card,
.support-copy,
.benefits-card,
.donation-card,
.donation-overview,
.donation-channel,
.bank-copy-card,
.donation-qr-card,
.footer,
.panel-card,
.admin-login {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 42px;
  border-radius: 42px;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: auto -10% -45% 25%;
  height: 320px;
  background:
    radial-gradient(circle at center, rgba(181, 136, 70, 0.28), transparent 55%),
    radial-gradient(circle at center, rgba(125, 152, 132, 0.22), transparent 70%);
  pointer-events: none;
}

.hero h1 {
  margin: 10px 0 16px;
  font-size: clamp(2.5rem, 5vw, 4.7rem);
  line-height: 1.08;
  max-width: 14ch;
}

.hero-subtitle,
.section-intro,
.story-panel p,
.hall-copy p,
.hall-card li,
.event-card p,
.donation-card p,
.footer p,
.panel-card,
.admin-form label {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.toolbar-actions,
.repeatable-header,
.save-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.viewport-toggle {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.viewport-toggle-button {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.viewport-toggle-button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 22px rgba(72, 57, 41, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.button-primary {
  background: linear-gradient(135deg, #b48540, #8f6426);
  color: #fff9ef;
  box-shadow: 0 10px 30px rgba(143, 100, 38, 0.2);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line);
  color: var(--ink);
}

.hero-card {
  padding: 28px;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(17, 22, 28, 0.72), rgba(17, 22, 28, 0.88)),
    linear-gradient(150deg, rgba(245, 222, 179, 0.28), rgba(125, 152, 132, 0.22));
  color: #fffaf2;
}

.hero-sidecard {
  min-height: 560px;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.82), rgba(255, 250, 242, 0.42)),
    rgba(255, 251, 246, 0.7);
}

.slideshow-heading {
  position: relative;
  z-index: 2;
  margin-bottom: 14px;
}

.slideshow-heading img {
  width: 100%;
  border-radius: 24px;
}

.hero-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: var(--managed-slideshow-ratio, var(--hero-slideshow-ratio, 16 / 9));
  border-radius: 28px;
  overflow: hidden;
  background: rgba(19, 24, 31, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slides,
.hero-slide,
.quote-slides,
.quote-slide,
.story-slides,
.story-slide {
  width: 100%;
  height: 100%;
}

.hero-slides,
.story-slides {
  position: relative;
}

.hero-slides {
  position: absolute;
  inset: clamp(34px, 5vw, 72px) clamp(72px, 8vw, 128px);
  width: auto;
  height: auto;
  margin: 0;
  display: grid;
  place-items: center;
}

.hero-slide,
.quote-slide,
.story-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hero-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slide.is-active,
.quote-slide.is-active,
.story-slide.is-active {
  opacity: 1;
}

.hero-slide img,
.quote-slide img,
.story-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255, 251, 246, 0.75);
}

.hero-slide img {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: auto;
  object-fit: contain;
  object-position: center center;
  display: block;
  padding: 14px;
  border-radius: 26px;
  border: 1px solid rgba(83, 61, 28, 0.18);
  background: rgba(255, 252, 247, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 18px 48px rgba(33, 27, 18, 0.14);
}

.hero-slide figcaption,
.quote-slide figcaption,
.story-slide figcaption {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(17, 22, 28, 0.55);
  color: #fffaf2;
  font-size: 0.95rem;
}

.section {
  padding: 24px 0;
}

.section-header {
  margin-bottom: 18px;
}

.section-header h1,
.section-header h2 {
  margin: 8px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.2;
}

.story-grid,
.hall,
.support-top,
.donation-channels,
.stats-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.story-panel,
.hall-card,
.support-copy,
.benefits-card,
.donation-overview,
.donation-channel,
.panel-card {
  padding: 28px;
  border-radius: var(--radius-lg);
}

.story-panel.muted {
  background: var(--surface-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.metrics,
.event-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.metric-card,
.event-card,
.stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 247, 0.78);
  border: 1px solid var(--line);
}

.metric-value,
.stat-value {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-deep);
}

.quote-band {
  margin: 10px 0 20px;
  padding: 32px;
  border-radius: 38px;
  color: #fefaf2;
  background:
    linear-gradient(120deg, rgba(23, 31, 40, 0.94), rgba(79, 55, 28, 0.88)),
    radial-gradient(circle at left center, rgba(181, 136, 70, 0.35), transparent 30%);
}

.quote-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: var(--managed-slideshow-ratio, 16 / 9);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 251, 246, 0.08);
}

.quote-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.story-slideshow {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  align-self: center;
  aspect-ratio: var(--managed-slideshow-ratio, 16 / 9);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 251, 246, 0.08);
}

.story-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.story-slideshow-title {
  margin: 18px auto 0;
  max-width: 720px;
  width: 100%;
  align-self: center;
  text-align: center;
  font-family: "Noto Serif Thai", serif;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.35;
  color: var(--ink);
}

.admin-story-slideshow {
  margin-bottom: 16px;
}

.admin-quote-slideshow {
  aspect-ratio: var(--managed-slideshow-ratio, 16 / 9);
}

.hall-card ul,
.support ol {
  margin: 0;
  padding-left: 1.2rem;
}

.hall-slideshow-block {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
}

.hall-slideshow-block .hero-slideshow,
.hall-slideshow-block .panel-card,
.hero-slideshow-caption {
  width: min(100%, 1120px);
  margin-left: auto;
  margin-right: auto;
}

.hall-slideshow-block .hero-slideshow {
  max-height: min(72vh, 820px);
}

.hall-slideshow-block .hero-slides {
  inset: clamp(18px, 3vw, 34px) clamp(22px, 4vw, 52px);
  padding: clamp(10px, 2vw, 20px);
}

.hall-slideshow-block .hero-slide img {
  padding: 8px;
  border-radius: 22px;
}

.hero-slideshow-caption {
  text-align: center;
  color: var(--gold-deep);
  font-family: "Noto Serif Thai", serif;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.35;
}

.hall-slideshow-block .panel-card {
  margin-top: 0;
}

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

.gallery-card {
  position: relative;
  min-height: 300px;
  padding: 22px;
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(180deg, rgba(18, 24, 29, 0.06), rgba(18, 24, 29, 0.54)),
    linear-gradient(150deg, rgba(255, 243, 214, 0.88), rgba(181, 136, 70, 0.68));
}

.gallery-card[data-accent="sage"] {
  background:
    linear-gradient(180deg, rgba(18, 24, 29, 0.06), rgba(18, 24, 29, 0.54)),
    linear-gradient(150deg, rgba(223, 238, 227, 0.92), rgba(125, 152, 132, 0.68));
}

.gallery-card[data-accent="clay"] {
  background:
    linear-gradient(180deg, rgba(18, 24, 29, 0.06), rgba(18, 24, 29, 0.54)),
    linear-gradient(150deg, rgba(249, 225, 214, 0.92), rgba(188, 122, 92, 0.72));
}

.gallery-card[data-accent="blue"] {
  background:
    linear-gradient(180deg, rgba(18, 24, 29, 0.06), rgba(18, 24, 29, 0.54)),
    linear-gradient(150deg, rgba(221, 231, 245, 0.92), rgba(95, 125, 164, 0.72));
}

.gallery-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--gallery-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}

.gallery-card article {
  position: relative;
  z-index: 1;
  color: #fffdf9;
}

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

.event-card {
  background: rgba(255, 251, 246, 0.82);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.event-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(180, 133, 64, 0.16), rgba(125, 152, 132, 0.16)),
    rgba(255, 252, 247, 0.8);
  border: 1px solid rgba(123, 92, 50, 0.14);
}

.event-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-event-media {
  display: grid;
  place-items: center;
  color: var(--gold-deep);
  font-weight: 600;
  border-style: dashed;
}

.event-image-tools {
  margin-bottom: 4px;
}

.event-card h3,
.gallery-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.support {
  display: grid;
  gap: 28px;
  align-items: start;
}

.support-copy,
.benefits-card,
.donation-overview,
.donation-channel {
  background: rgba(255, 251, 246, 0.78);
}

.support-copy {
  min-height: 100%;
}

.benefits-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.benefits-card h3 {
  margin-top: 0;
}

.benefits-card ol {
  display: grid;
  gap: 0.2rem;
}

.benefits-card li {
  line-height: 1.7;
}

.benefits-card li > div {
  display: inline-block;
  width: 100%;
}

.donation-overview {
  background:
    radial-gradient(circle at top right, rgba(181, 136, 70, 0.25), transparent 35%),
    rgba(255, 252, 247, 0.86);
}

.donation-overview-header {
  max-width: 900px;
  margin-bottom: 22px;
}

.donation-overview-header h3,
.donation-channel h3 {
  margin-top: 0;
}

.donation-channel {
  display: grid;
  gap: 16px;
  align-content: start;
  background: rgba(255, 255, 255, 0.68);
}

.bank-copy-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.88);
}

.bank-copy-card div,
.bank-copy-card label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.bank-copy-card span,
.bank-copy-card label {
  color: var(--muted);
  font-size: 0.95rem;
}

.bank-copy-card strong {
  color: var(--ink);
  font-size: 1.06rem;
}

.copy-account-button {
  justify-self: start;
  margin-top: 4px;
}

.copy-status {
  min-height: 22px;
  margin: 0;
  color: var(--gold-deep);
  font-weight: 600;
}

.donation-qr,
.donation-qr-card {
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
}

.donation-qr img,
.donation-qr-card img {
  width: 100%;
  display: block;
  border-radius: 22px;
  border: 1px solid rgba(20, 27, 32, 0.1);
}

.donation-qr-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
}

.donation-qr.is-empty,
.donation-qr-card.is-empty img {
  display: none;
}

.copy-email-button {
  justify-self: start;
}

.admin-empty-media {
  display: grid;
  min-height: 180px;
  place-items: center;
  border-radius: 22px;
  border: 1px dashed rgba(29, 36, 48, 0.22);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
}

.donation-qr-card strong,
.donation-qr-card p {
  margin: 0;
}

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

.donation-card {
  border-radius: 34px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.donation-card-inner,
.donation-qr {
  padding: 28px;
}

.donation-chip {
  display: inline-flex;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(181, 136, 70, 0.12);
  color: var(--gold-deep);
  font-weight: 600;
}

.footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 26px 0 48px;
  padding: 32px;
  border-radius: 30px;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 28px;
  align-items: start;
}

.footer-links {
  display: grid;
  gap: 14px;
  align-items: start;
  justify-items: start;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.line-official-card {
  display: grid;
  gap: 10px;
  align-items: start;
  justify-items: start;
  width: min(100%, 260px);
}

.line-official-card img {
  width: min(100%, 220px);
  border-radius: 18px;
  border: 1px solid rgba(29, 36, 48, 0.1);
  background: rgba(255, 255, 255, 0.82);
}

.footer-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.footer-button-row .button {
  min-width: 120px;
}

.line-official-card .button {
  justify-self: start;
}

.admin-line-official-card {
  width: min(100%, 260px);
}

.admin-line-official-card input {
  width: 100%;
}

.admin-footer-button-row {
  align-items: end;
}

.admin-footer-button-row .inline-link-stack {
  display: grid;
  gap: 6px;
  min-width: 170px;
}

.admin-footer-button-row input {
  width: 100%;
}

.footer-note {
  max-width: 70ch;
}

.translator-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
  align-items: stretch;
  padding: 34px 0 24px;
}

.translator-copy,
.translator-panel,
.translation-result-card {
  padding: 30px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.translator-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.translator-copy h1 {
  margin: 10px 0 16px;
  font-family: "Noto Serif Thai", serif;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.14;
}

.translator-copy p,
.translator-panel label,
.muted-text,
.recent-translation-item small {
  color: var(--muted);
  line-height: 1.7;
}

.translator-panel {
  display: grid;
  gap: 14px;
}

.translator-panel textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid rgba(29, 36, 48, 0.12);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  line-height: 1.65;
}

.translator-actions,
.translation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.translation-result-card {
  min-height: 240px;
}

.translated-output {
  min-height: 110px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.8;
  white-space: pre-wrap;
}

.translation-meta {
  margin-top: 14px;
}

.translation-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(181, 136, 70, 0.12);
  color: var(--gold-deep);
  font-size: 0.92rem;
  font-weight: 600;
}

.translator-stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.translator-history {
  margin-top: 22px;
}

.daily-bars,
.recent-translations {
  display: grid;
  gap: 12px;
}

.daily-bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
}

.daily-bar-row span,
.daily-bar-row strong {
  font-size: 0.9rem;
}

.daily-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 36, 48, 0.1);
}

.daily-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--sage));
}

.recent-translation-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
}

.recent-translation-item p,
.recent-translation-item strong,
.recent-translation-item small {
  margin: 0;
}

.recent-translation-item p {
  color: var(--muted);
}

.recent-translation-item strong {
  color: var(--ink);
  line-height: 1.6;
}

.admin-body {
  min-height: 100vh;
}

.admin-shell {
  width: min(calc(100% - 24px), 1520px);
}

.admin-editor-shell {
  max-width: 1120px;
}

.admin-inline-shell {
  max-width: 1240px;
}

.admin-inline-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 18px;
  padding-bottom: 18px;
  backdrop-filter: blur(14px);
  background: rgba(250, 244, 234, 0.88);
}

.compact-stats {
  margin: 34px 0 20px;
}

.admin-bottom-stats {
  padding-top: 24px;
  border-top: 1px solid rgba(151, 117, 64, 0.18);
}

.stats-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.stats-panel-heading h2 {
  margin: 4px 0 0;
  font-size: 1.45rem;
}

.stats-panel-heading .eyebrow {
  margin: 0;
}

.sticky-message {
  position: sticky;
  top: 96px;
  z-index: 19;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 251, 246, 0.88);
  box-shadow: var(--shadow);
}

.text-toolbar {
  position: fixed;
  z-index: 30;
  width: min(360px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 251, 246, 0.96);
  border: 1px solid rgba(29, 36, 48, 0.12);
  box-shadow: 0 16px 50px rgba(28, 29, 31, 0.18);
  backdrop-filter: blur(14px);
  right: 16px;
  top: 110px;
  display: block;
}

.text-toolbar.is-visible {
  display: block;
}

.text-toolbar-handle {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  cursor: move;
  user-select: none;
}

.text-toolbar-handle strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
}

.text-toolbar-status {
  margin-top: 4px;
  color: var(--gold-deep);
  font-size: 0.92rem;
  font-weight: 600;
}

.toolbar-reset-button {
  flex: 0 0 auto;
}

.text-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-toolbar-row + .text-toolbar-row {
  margin-top: 8px;
}

.text-toolbar select,
.text-toolbar input[type="color"],
.text-toolbar button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
}

.text-toolbar input[type="color"] {
  padding: 4px;
  width: 52px;
}

.admin-live-site {
  padding-bottom: 56px;
}

.admin-only-controls {
  margin-bottom: 18px;
}

.is-mobile-editing #editorRoot {
  overflow-x: auto;
  padding: 18px 0 28px;
}

.is-mobile-editing .admin-only-controls {
  width: 390px;
  max-width: 390px;
  margin: 0 auto 18px;
}

.is-mobile-editing .admin-live-site {
  width: 390px;
  max-width: 390px;
  min-height: 820px;
  padding: 0 10px 48px;
  border: 1px solid rgba(29, 36, 48, 0.14);
  border-radius: 34px;
  background: rgba(250, 244, 234, 0.52);
  box-shadow: 0 22px 70px rgba(72, 57, 41, 0.18);
}

.is-mobile-editing .hero,
.is-mobile-editing .story-grid,
.is-mobile-editing .hall,
.is-mobile-editing .support-top,
.is-mobile-editing .donation-channels,
.is-mobile-editing .us-donation-grid,
.is-mobile-editing .footer-main,
.is-mobile-editing .footer,
.is-mobile-editing .stats-columns,
.is-mobile-editing .metrics,
.is-mobile-editing .event-grid,
.is-mobile-editing .gallery-grid,
.is-mobile-editing .stats-grid,
.is-mobile-editing .translator-hero,
.is-mobile-editing .translator-stats-grid {
  grid-template-columns: 1fr;
}

.is-mobile-editing .topbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.is-mobile-editing .brand {
  grid-column: 1 / -1;
  align-items: center;
}

.is-mobile-editing .nav {
  display: contents;
}

.is-mobile-editing .nav a,
.is-mobile-editing .topbar > .admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 6px;
  text-align: center;
}

.is-mobile-editing .brand-title-image {
  width: min(100%, 300px);
  height: 38px;
}

.is-mobile-editing .brand-mark {
  width: 64px;
  height: 64px;
}

.is-mobile-editing .brand-mark img {
  width: 58px;
  height: 58px;
}

.is-mobile-editing .hero-copy,
.is-mobile-editing .hero-card,
.is-mobile-editing .story-panel,
.is-mobile-editing .hall-card,
.is-mobile-editing .panel-card,
.is-mobile-editing .translator-copy,
.is-mobile-editing .translator-panel,
.is-mobile-editing .translation-result-card,
.is-mobile-editing .support-copy,
.is-mobile-editing .benefits-card,
.is-mobile-editing .donation-overview,
.is-mobile-editing .donation-channel,
.is-mobile-editing .footer,
.is-mobile-editing .donation-card-inner,
.is-mobile-editing .donation-qr {
  padding: 22px;
}

.is-mobile-editing .quote-band {
  padding: 36px 20px;
}

.is-mobile-editing .hero-sidecard {
  min-height: 380px;
}

.is-mobile-editing .slideshow-settings {
  grid-template-columns: 1fr;
}

.admin-live-card {
  position: relative;
}

.inline-edit {
  border-radius: 12px;
  transition: background-color 0.2s ease, outline 0.2s ease;
}

.inline-edit:hover,
.inline-edit:focus {
  outline: 2px dashed rgba(181, 136, 70, 0.5);
  outline-offset: 3px;
  background: rgba(255, 255, 255, 0.38);
}

.inline-edit[contenteditable="true"]:empty::before {
  content: "คลิกเพื่อแก้ไข";
  color: rgba(93, 101, 95, 0.7);
}

.inline-nav-link {
  display: inline-block;
  min-width: 48px;
}

.rich-inline {
  min-height: 44px;
}

.inline-card-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--gold-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

.inline-card-action-stack,
.section-corner-add,
.hidden-section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-corner-tools {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.section-move-tools {
  display: flex;
  gap: 8px;
}

.section-delete-button {
  background: rgba(163, 54, 41, 0.08);
}

.hidden-sections-panel {
  margin-bottom: 18px;
}

.inline-card-tools button,
.inline-add-actions button,
.inline-media-tools button,
.add-card button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font: inherit;
}

.inline-media-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.editable-text-list {
  margin: 0;
  padding-left: 1.2rem;
}

.editable-text-list-row {
  position: relative;
  padding-right: 72px;
}

.editable-text-list-value {
  min-height: 1.7em;
  line-height: 1.7;
}

.list-row-button {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  background: rgba(255, 251, 247, 0.92);
  color: #76332c;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.editable-text-list-row:hover .list-row-button,
.editable-text-list-row:focus-within .list-row-button {
  opacity: 1;
}

.editable-list-admin-actions {
  margin-top: 16px;
}

.list-add-button {
  justify-self: start;
}

.inline-media-tools input,
.hero-actions input,
.footer-links input {
  flex: 1 1 220px;
}

.inline-link-stack {
  display: grid;
  gap: 6px;
  width: 100%;
}

.inline-textarea {
  min-height: 140px;
}

.inline-add-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px dashed rgba(181, 136, 70, 0.5);
  background: rgba(255, 251, 246, 0.76);
}

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

.inline-slides-grid {
  display: grid;
  gap: 16px;
}

.inline-slide-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(29, 36, 48, 0.08);
}

.inline-slide-preview {
  width: 100%;
  aspect-ratio: var(--slide-ratio, 16 / 9);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(250, 244, 234, 0.88);
}

.inline-slide-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

.add-card {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed rgba(181, 136, 70, 0.5);
}

.admin-login {
  max-width: 560px;
  margin: 80px auto;
  padding: 32px;
  border-radius: 28px;
}

.admin-form,
.editor-grid {
  display: grid;
  gap: 16px;
}

.editor-grid {
  padding-bottom: 48px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(460px, 0.95fr) minmax(520px, 1.05fr);
  gap: 22px;
  align-items: start;
}

.admin-preview-pane,
.admin-editor-pane {
  min-width: 0;
}

.admin-preview-pane {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding-bottom: 24px;
}

.preview-card {
  padding: 18px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.preview-header h2 {
  margin: 6px 0 0;
}

.preview-frame-shell {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  background: #f0eadc;
  min-height: 760px;
}

.preview-frame-shell iframe {
  width: 100%;
  height: 760px;
  border: 0;
  background: white;
}

.editor-tips {
  background:
    radial-gradient(circle at top right, rgba(181, 136, 70, 0.18), transparent 38%),
    rgba(255, 252, 247, 0.86);
}

.section-add-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-form label,
.panel-card label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(29, 36, 48, 0.14);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.stats-panel {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

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

.stat-label {
  color: var(--muted);
}

.repeatable-list {
  display: grid;
  gap: 14px;
}

.rich-field {
  display: grid;
  gap: 10px;
}

.rich-editor {
  display: grid;
  gap: 10px;
}

.rich-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  color: var(--ink);
  font-size: 0.95rem;
}

.rich-editor-head small {
  color: var(--muted);
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rich-toolbar button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(29, 36, 48, 0.12);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  font: inherit;
}

.rich-surface {
  min-height: 160px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(29, 36, 48, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  line-height: 1.7;
}

.rich-surface:focus {
  outline: 2px solid rgba(181, 136, 70, 0.45);
  outline-offset: 2px;
}

.rich-surface h2,
.rich-surface h3,
.rich-surface blockquote,
.rich-surface p,
.rich-surface ul,
.rich-surface ol {
  margin-top: 0;
}

.repeatable-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(29, 36, 48, 0.08);
}

.repeatable-item-actions {
  display: flex;
  justify-content: flex-end;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--gold-deep);
  font-weight: 500;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-type-badge {
  margin: 0;
  color: var(--gold-deep);
  font-weight: 600;
}

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

.toggle-field {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.toggle-field input {
  width: auto;
}

.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 22, 28, 0.58);
  color: #fffaf2;
  font-size: 1.8rem;
  cursor: pointer;
}

.slide-arrow-left {
  left: 14px;
}

.slide-arrow-right {
  right: 14px;
}

.slide-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.slide-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
}

.slide-dot.is-active {
  background: #fffaf2;
}

.custom-sections {
  display: grid;
  gap: 18px;
}

.custom-section-card {
  padding: 30px;
  border-radius: 30px;
  background: rgba(255, 251, 246, 0.84);
  border: 1px solid rgba(29, 36, 48, 0.1);
  box-shadow: var(--shadow);
}

.custom-section-card h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-family: "Noto Serif Thai", serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.custom-section-card img {
  width: 100%;
  border-radius: 24px;
}

.custom-text,
.custom-caption {
  color: var(--muted);
  line-height: 1.75;
}

.video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(17, 22, 28, 0.08);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.save-bar {
  position: sticky;
  bottom: 12px;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 22px;
  background: rgba(28, 36, 47, 0.92);
  color: #fefaf2;
  box-shadow: var(--shadow);
}

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

.simple-list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(29, 36, 48, 0.08);
}

.simple-list-row strong {
  color: var(--ink);
}

.mini-chart {
  display: grid;
  gap: 10px;
}

.mini-chart-row {
  display: grid;
  grid-template-columns: 96px 1fr 48px;
  align-items: center;
  gap: 10px;
}

.mini-chart-bar {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(181, 136, 70, 0.3), rgba(181, 136, 70, 0.95));
}

.admin-hero-banner-card {
  margin-bottom: 18px;
}

.hero-banner-tools {
  margin-top: 14px;
}

@media (max-width: 767px) {
  .hero,
  .story-grid,
  .hall,
  .support-top,
  .donation-channels,
  .us-donation-grid,
  .footer-main,
  .footer,
  .stats-columns,
  .metrics,
  .event-grid,
  .gallery-grid,
  .stats-grid,
  .translator-hero,
  .translator-stats-grid,
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .topbar,
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
  }

  .topbar .brand {
    grid-column: 1 / -1;
  }

  .topbar .nav {
    display: contents;
  }

  .topbar .nav a,
  .topbar > .admin-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 6px;
    text-align: center;
  }

  .admin-preview-pane {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .site-shell,
  .admin-shell {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .brand-title-image {
    width: min(100%, 300px);
    height: 38px;
  }

  .brand-mark {
    width: 64px;
    height: 64px;
  }

  .brand-mark img {
    width: 58px;
    height: 58px;
  }

  .hero-copy,
  .hero-card,
  .story-panel,
  .hall-card,
  .panel-card,
  .translator-copy,
  .translator-panel,
  .translation-result-card,
  .support-copy,
  .benefits-card,
  .donation-overview,
  .donation-channel,
  .admin-login,
  .footer,
  .donation-card-inner,
  .donation-qr {
    padding: 22px;
  }

  .quote-band {
    padding: 36px 20px;
  }

  .hero-sidecard {
    min-height: 380px;
  }

  .hall-slideshow-block .hero-slideshow {
    width: 100%;
    max-height: none;
  }

  .hall-slideshow-block .hero-slides {
    inset: 14px 16px 46px;
    padding: 8px;
  }

  .hall-slideshow-block .hero-slide img {
    padding: 6px;
    border-radius: 18px;
  }

  .hall-slideshow-block .slide-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.55rem;
  }

  .hall-slideshow-block .slide-arrow-left {
    left: 10px;
  }

  .hall-slideshow-block .slide-arrow-right {
    right: 10px;
  }

  .hall-slideshow-block .slide-dots {
    bottom: 16px;
    gap: 6px;
  }

  .hall-slideshow-block .slide-dot {
    width: 10px;
    height: 10px;
  }

  .slideshow-settings {
    grid-template-columns: 1fr;
  }

  .stats-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-add-controls {
    width: 100%;
  }

  .text-toolbar {
    right: 10px;
    left: 10px;
    width: auto;
  }

  .daily-bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
