/* IVEACER Loy Krathong Online — Moonlit Agricultural Waterways Theme
 * Anchored in DESIGN.md tokens (--iveacer-*) with WCAG 2.1 AA contrast & motion safety. */

.lk-page {
  margin: 0;
  background-color: var(--iveacer-canvas, #f8fafc);
  color: var(--iveacer-text-main, #1e293b);
  font-family: 'Sarabun', 'Prompt', 'IVEACER Thai Fallback', sans-serif;
  line-height: 1.7;
  overflow-x: clip;
}

.lk-page *, .lk-page *::before, .lk-page *::after {
  box-sizing: border-box;
}

.lk-page [hidden] {
  display: none !important;
}

.lk-skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 18px;
  background: #022c22;
  color: #ffffff;
  border-radius: 6px;
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  text-decoration: none;
}
.lk-skip-link:focus {
  top: 12px;
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.lk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lk-container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) { .lk-container { padding: 0 24px; } }
@media (min-width: 1024px) { .lk-container { padding: 0 32px; } }

/* =========================================================================
 * Header Navigation
 * ========================================================================= */
.lk-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(2, 44, 34, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  color: #ffffff;
}

.lk-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.lk-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  min-height: 44px;
}
.lk-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.lk-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.lk-brand-title {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
}
.lk-brand-sub {
  font-family: 'Prompt', sans-serif;
  font-size: 0.78rem;
  color: #fde68a;
}

.lk-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lk-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms var(--iveacer-ease-out, ease-out), border-color 180ms, transform 180ms;
}
.lk-nav-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(253, 230, 138, 0.65);
}
.lk-nav-btn.is-active {
  background: #065f46;
  border-color: #a3e635;
  color: #fefce8;
}
.lk-nav-btn:active { transform: scale(0.97); }
.lk-nav-btn:focus-visible,
.lk-pier-chip:focus-visible,
.lk-option-card:focus-visible,
.lk-pill-opt:focus-visible,
.lk-preset-chip:focus-visible,
.lk-primary-btn:focus-visible,
.lk-secondary-btn:focus-visible,
.lk-float-item:focus-visible,
.lk-leader-row:focus-visible,
.lk-input:focus-visible,
.lk-select:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* =========================================================================
 * Hero Banner (Deep Moonlit Emerald Band)
 * ========================================================================= */
.lk-hero {
  background: radial-gradient(circle at 82% 18%, rgba(253, 224, 71, 0.16), transparent 42%),
              linear-gradient(155deg, #021a14 0%, #043227 52%, #064e3b 100%);
  color: #ffffff;
  padding: 36px 0 28px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.lk-hero-head {
  max-width: 780px;
}

.lk-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(253, 230, 138, 0.4);
  color: #fde68a;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.lk-hero-title {
  margin: 0 0 10px;
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-wrap: balance;
}

.lk-hero-desc {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #d4e5d8;
  max-width: 66ch;
}

/* Offline Honest Status Alert */
.lk-offline-alert {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(120, 53, 15, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fef3c7;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lk-offline-alert strong {
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  color: #fde68a;
}
.lk-offline-alert p {
  margin: 0;
  font-size: 0.92rem;
}

/* =========================================================================
 * Waterfront Switcher Bar (11 Piers + All Network)
 * ========================================================================= */
.lk-waterfront-strip {
  margin-top: 22px;
  max-width: 100%;
  min-width: 0;
}
.lk-waterfront-label {
  display: block;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fde68a;
  margin-bottom: 10px;
}
.lk-pier-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
@media (min-width: 1024px) {
  .lk-pier-bar { flex-wrap: wrap; overflow-x: visible; }
}

.lk-pier-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 180ms, border-color 180ms, color 180ms;
}
.lk-pier-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(163, 230, 53, 0.6);
}
.lk-pier-chip.is-selected {
  background: #a3e635;
  border-color: #a3e635;
  color: #022c22;
  font-weight: 700;
}
.lk-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 0.78rem;
  background: rgba(2, 44, 34, 0.35);
  color: inherit;
}
.lk-pier-chip.is-selected .lk-chip-count {
  background: rgba(2, 44, 34, 0.16);
}

/* =========================================================================
 * Main Workspace Grid: River Stage + Krathong Workshop
 * ========================================================================= */
.lk-workspace {
  padding: 28px 0 44px;
}

.lk-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.lk-workspace-grid > * {
  min-width: 0;
}
@media (min-width: 1024px) {
  .lk-workspace-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.9fr);
    gap: 28px;
  }
}

/* =========================================================================
 * Interactive Full-Moon River Stage
 * ========================================================================= */
.lk-stage-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: #021a14;
  box-shadow: 0 18px 42px rgba(2, 44, 34, 0.16);
}
@media (min-width: 1024px) {
  .lk-stage-card {
    position: sticky;
    top: 82px;
  }
}

.lk-stage-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 12px 16px;
  background: rgba(2, 26, 20, 0.94);
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  color: #ffffff;
}
.lk-stage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.lk-toy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(253, 230, 138, 0.36);
  background: rgba(253, 230, 138, 0.12);
  color: #fef9c3;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms, border-color 160ms, transform 140ms;
}
.lk-toy-btn:hover {
  background: rgba(253, 230, 138, 0.24);
  border-color: #fde047;
}
.lk-toy-btn:active { transform: scale(0.96); }
.lk-toy-btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

.lk-festoon-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.lk-festoon-bar svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lk-landmark-host,
.lk-horizon-svg {
  position: absolute;
  left: 0;
  right: 0;
  top: 20%;
  height: 24%;
  width: 100%;
  pointer-events: none;
  z-index: 2;
}
.lk-landmark-host svg {
  width: 100%;
  height: 100%;
  display: block;
}
.lk-stage-pier-info h2 {
  margin: 0;
  font-family: 'Prompt', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}
.lk-stage-pier-info p {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: #a3e635;
}

.lk-river-stage {
  --lk-sky-top: #021a14;
  --lk-sky-mid: #053227;
  --lk-water-top: #063d30;
  --lk-water-bot: #021712;
  position: relative;
  width: 100%;
  min-height: 450px;
  height: clamp(440px, 56vh, 560px);
  overflow: hidden;
  background: linear-gradient(180deg, var(--lk-sky-top) 0%, var(--lk-sky-mid) 40%, var(--lk-water-top) 42%, var(--lk-water-bot) 100%);
  user-select: none;
}

/* Sky stars & full moon */
.lk-sky-layer {
  position: absolute;
  inset: 0 0 58% 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 11% 24%, rgba(254, 249, 195, 0.85), transparent),
    radial-gradient(1.5px 1.5px at 24% 14%, rgba(254, 249, 195, 0.7), transparent),
    radial-gradient(2px 2px at 39% 30%, rgba(254, 249, 195, 0.75), transparent),
    radial-gradient(1.5px 1.5px at 56% 16%, rgba(254, 249, 195, 0.7), transparent),
    radial-gradient(2px 2px at 69% 28%, rgba(254, 249, 195, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 88% 18%, rgba(254, 249, 195, 0.75), transparent);
}

.lk-moon {
  position: absolute;
  top: 26px;
  right: 12%;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fffef0 0%, #fef08a 70%, #eab308 100%);
  box-shadow: 0 0 38px 12px rgba(254, 240, 138, 0.34), 0 0 90px 28px rgba(212, 175, 55, 0.16);
  pointer-events: none;
  z-index: 1;
  animation: lkMoonBreathe 6.5s ease-in-out infinite;
}

.lk-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Water reflection band */
.lk-water-layer {
  position: absolute;
  inset: 42% 0 0 0;
  background:
    radial-gradient(ellipse 26% 18% at 84% 8%, rgba(254, 240, 138, 0.18), transparent 72%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 20px);
  pointer-events: none;
  z-index: 1;
}

/* Floating Krathongs Layer */
.lk-river-krathongs {
  position: absolute;
  inset: 41% 0 14px 0;
  z-index: 4;
}

.lk-float-item {
  position: absolute;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
  min-height: 78px;
  padding: 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #ffffff;
  transform-origin: center bottom;
  will-change: left, transform;
  animation: lkRiverFlow var(--lk-drift-dur, 46s) linear var(--lk-drift-delay, 0s) infinite,
             lkGentleRock var(--lk-bob-dur, 4.4s) ease-in-out var(--lk-bob-delay, 0s) infinite;
  transition: transform 220ms var(--iveacer-ease-out, ease-out), filter 220ms;
}
.lk-float-item::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 24px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(254, 240, 138, 0.35);
  pointer-events: none;
  animation: lkWaterPulse 3.6s ease-out infinite;
}
.lk-float-item.lane-0 { width: 88px; opacity: 0.86; z-index: 2; }
.lk-float-item.lane-1 { width: 112px; opacity: 0.94; z-index: 4; }
.lk-float-item.lane-2 { width: 136px; opacity: 1; z-index: 6; }

.lk-float-item:hover,
.lk-float-item:focus-visible {
  animation-play-state: paused;
  z-index: 20;
  filter: brightness(1.08);
}

.lk-float-item.is-highlighted {
  z-index: 15;
}
.lk-float-item.is-highlighted .lk-float-svg {
  filter: drop-shadow(0 0 18px rgba(253, 224, 71, 0.95));
}
.lk-float-item.is-launching {
  left: 44% !important;
  z-index: 22;
  animation: lkLaunchGlide 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}
.lk-float-item.is-launching .lk-float-svg {
  filter: drop-shadow(0 0 22px rgba(253, 224, 71, 1));
}

.lk-ceremony-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 26;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  max-width: calc(100% - 24px);
  padding: 10px 16px;
  border-radius: 9999px;
  background: rgba(2, 26, 20, 0.92);
  border: 1px solid rgba(253, 230, 138, 0.55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: #fef9c3;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}
.lk-ceremony-skip {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 9999px;
  background: #a3e635;
  color: #022c22;
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.lk-ceremony-skip:hover { background: #bef264; }

.lk-float-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.lk-float-tag {
  margin-top: -8px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(2, 26, 20, 0.86);
  border: 1px solid rgba(253, 230, 138, 0.4);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: 150px;
  line-height: 1.25;
  text-align: center;
}
.lk-float-tag strong {
  font-family: 'Prompt', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 132px;
}
.lk-float-tag small {
  font-size: 0.68rem;
  color: #bef264;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 132px;
}

.lk-stage-status {
  position: absolute;
  left: 50%;
  top: 66%;
  transform: translate(-50%, -50%);
  max-width: 86%;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(2, 26, 20, 0.88);
  border: 1px solid rgba(253, 230, 138, 0.35);
  color: #fefce8;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  text-align: center;
  z-index: 10;
}

.lk-stage-footer {
  padding: 10px 18px;
  background: rgba(2, 26, 20, 0.94);
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  color: #d4e5d8;
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* =========================================================================
 * Krathong Workshop Form Card
 * ========================================================================= */
.lk-workshop-card {
  background: var(--iveacer-surface, #ffffff);
  border: 1px solid var(--iveacer-border, #dce6df);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--iveacer-shadow-sm, 0 2px 10px rgba(0, 0, 0, 0.04));
}

.lk-workshop-title {
  margin: 0 0 14px;
  font-family: 'Prompt', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--iveacer-heading, #14381e);
}

.lk-preview-stage {
  background: radial-gradient(circle at 50% 35%, #074636 0%, #021d16 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 18px;
}
.lk-preview-svg {
  width: 196px;
  height: 164px;
  margin: 0 auto;
  animation: lkGentleRock 5.2s ease-in-out infinite;
}
.lk-preview-svg.is-swapping {
  animation: lkPreviewSwap 380ms cubic-bezier(0.23, 1, 0.32, 1);
}
.lk-preview-svg svg {
  width: 100%;
  height: 100%;
}
.lk-preview-eco {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: #d4e5d8;
  line-height: 1.5;
}

.lk-field-group {
  margin-bottom: 16px;
}
.lk-field-label {
  display: block;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--iveacer-heading, #14381e);
  margin-bottom: 8px;
}

.lk-base-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.lk-option-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 58px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface-soft, #f1f8f4);
  color: var(--iveacer-text-main, #1e293b);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms, background-color 160ms, transform 160ms;
}
.lk-option-card:hover {
  border-color: var(--iveacer-brand-green, #1e4d2b);
}
.lk-option-card.is-selected {
  background: var(--iveacer-brand-green, #1e4d2b);
  border-color: var(--iveacer-brand-green, #1e4d2b);
  color: #ffffff;
}
.lk-swatch {
  width: 24px;
  height: 6px;
  border-radius: 9999px;
  margin-bottom: 3px;
}
.lk-option-title {
  font-family: 'Prompt', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
}
.lk-option-sub {
  font-size: 0.76rem;
  opacity: 0.86;
  line-height: 1.3;
}

.lk-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lk-pill-opt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface-soft, #f1f8f4);
  color: var(--iveacer-text-main, #1e293b);
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}
.lk-pill-opt.is-selected {
  background: #064e3b;
  border-color: #064e3b;
  color: #ffffff;
  font-weight: 600;
}
.lk-swatch-sm {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.lk-input,
.lk-select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface, #ffffff);
  color: var(--iveacer-text-main, #1e293b);
  font-family: 'Sarabun', 'Prompt', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}
textarea.lk-input {
  min-height: 92px;
  resize: vertical;
}
.lk-input[aria-invalid="true"] {
  border-color: var(--iveacer-danger-text, #a13928);
  background: var(--iveacer-danger-surface, #fff1ec);
}

.lk-wish-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.lk-wish-head .lk-field-label { margin-bottom: 0; }
.lk-counter {
  font-family: 'Prompt', sans-serif;
  font-size: 0.8rem;
  color: var(--iveacer-text-muted, #53665b);
}

.lk-preset-wrap {
  margin-top: 8px;
}
.lk-preset-label {
  display: block;
  font-size: 0.82rem;
  color: var(--iveacer-text-muted, #53665b);
  margin-bottom: 6px;
}
.lk-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lk-preset-chip {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface-soft, #f1f8f4);
  color: var(--iveacer-brand-green, #1e4d2b);
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.lk-preset-chip:hover {
  background: var(--iveacer-surface-subtle, #e8f5e9);
}

.lk-error-box {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--iveacer-danger-surface, #fff1ec);
  color: var(--iveacer-danger-text, #a13928);
  border: 1px solid currentColor;
  font-size: 0.92rem;
  font-weight: 600;
}

.lk-form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lk-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 9999px;
  background: #065f46;
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 180ms, transform 160ms;
}
.lk-primary-btn:hover:not(:disabled) { background: #064e3b; }
.lk-primary-btn:active:not(:disabled) { transform: scale(0.98); }
.lk-primary-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.lk-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 9999px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface, #ffffff);
  color: var(--iveacer-heading, #14381e);
  font-family: 'Prompt', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.lk-secondary-btn:hover { background: var(--iveacer-surface-soft, #f1f8f4); }
.lk-secondary-btn.is-selected {
  background: var(--iveacer-brand-green, #1e4d2b);
  border-color: var(--iveacer-brand-green, #1e4d2b);
  color: #ffffff;
}

/* =========================================================================
 * Stats, 11-Campus Leaderboard & Eco-Agri Knowledge
 * ========================================================================= */
.lk-section {
  padding: 40px 0;
  border-top: 1px solid var(--iveacer-border, #dce6df);
}

.lk-section-title {
  margin: 0 0 6px;
  font-family: 'Prompt', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--iveacer-heading, #14381e);
  line-height: 1.4;
}
.lk-section-sub {
  margin: 0 0 22px;
  color: var(--iveacer-text-muted, #53665b);
  font-size: 0.96rem;
}

.lk-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.lk-stat-card {
  background: var(--iveacer-surface, #ffffff);
  border: 1px solid var(--iveacer-border, #dce6df);
  border-radius: 14px;
  padding: 20px;
}
.lk-stat-label {
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--iveacer-text-muted, #53665b);
  margin-bottom: 6px;
}
.lk-stat-value {
  font-family: 'Prompt', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--iveacer-heading, #14381e);
  line-height: 1.25;
}
.lk-stat-foot {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--iveacer-gold-text, #7c5e08);
}

.lk-leaderboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 768px) {
  .lk-leaderboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.lk-leader-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface, #ffffff);
  color: var(--iveacer-text-main, #1e293b);
  text-align: left;
  cursor: pointer;
}
.lk-leader-row:hover { border-color: var(--iveacer-brand-green, #1e4d2b); }
.lk-leader-row.is-active {
  background: var(--iveacer-surface-soft, #f1f8f4);
  border-color: var(--iveacer-brand-green, #1e4d2b);
}
.lk-leader-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.lk-leader-name {
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
.lk-leader-count {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--iveacer-gold-text, #7c5e08);
}
.lk-leader-river {
  font-size: 0.82rem;
  color: var(--iveacer-text-muted, #53665b);
}
.lk-leader-track {
  height: 7px;
  border-radius: 9999px;
  background: var(--iveacer-surface-subtle, #e8f5e9);
  overflow: hidden;
  margin-top: 2px;
}
.lk-leader-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #1e4d2b 0%, #2e7d32 65%, #84cc16 100%);
  transition: width 300ms var(--iveacer-ease-out, ease-out);
}

/* Eco Knowledge Cards */
.lk-eco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.lk-eco-card {
  background: var(--iveacer-surface, #ffffff);
  border: 1px solid var(--iveacer-border, #dce6df);
  border-radius: 14px;
  padding: 20px;
}
.lk-eco-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: var(--iveacer-surface-subtle, #e8f5e9);
  color: var(--iveacer-brand-green, #1e4d2b);
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.lk-eco-card h3 {
  margin: 0 0 8px;
  font-family: 'Prompt', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--iveacer-heading, #14381e);
}
.lk-eco-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--iveacer-text-muted, #53665b);
}

/* =========================================================================
 * Native <dialog> Modals (E-Card Studio & Wish Detail)
 * ========================================================================= */
.lk-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--iveacer-border, #dce6df);
  border-radius: 18px;
  padding: 0;
  background: var(--iveacer-surface, #ffffff);
  color: var(--iveacer-text-main, #1e293b);
  box-shadow: 0 24px 60px rgba(2, 44, 34, 0.35);
}
.lk-dialog::backdrop {
  background: rgba(2, 20, 15, 0.76);
  backdrop-filter: blur(4px);
}
.lk-dialog-inner {
  padding: 22px;
  overflow-y: auto;
  max-height: calc(100vh - 36px);
}
.lk-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.lk-dialog-head h2 {
  margin: 0;
  font-family: 'Prompt', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--iveacer-heading, #14381e);
}
.lk-close-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 9999px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface-soft, #f1f8f4);
  color: var(--iveacer-text-main, #1e293b);
  font-size: 1.25rem;
  cursor: pointer;
}

.lk-success-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--iveacer-success-surface, #e8f5e9);
  color: var(--iveacer-success-text, #166534);
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.lk-share-box {
  background: var(--iveacer-surface-soft, #f1f8f4);
  border: 1px solid var(--iveacer-border, #dce6df);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
.lk-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.lk-share-row .lk-input {
  flex: 1 1 220px;
}

.lk-ecard-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.lk-ecard-canvas-wrap {
  background: #021a14;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
#ecardCanvas {
  max-width: 100%;
  max-height: 420px;
  height: auto;
  width: auto;
  border-radius: 8px;
  display: block;
}

.lk-detail-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.lk-detail-svg {
  width: 210px;
  height: 175px;
  background: radial-gradient(circle at 50% 45%, #074636 0%, #021d16 100%);
  border-radius: 16px;
  padding: 10px;
}
.lk-detail-quote {
  margin: 6px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--iveacer-heading, #14381e);
  max-width: 52ch;
}

/* =========================================================================
 * Admin Console (#admin)
 * ========================================================================= */
.lk-admin-section {
  background: var(--iveacer-surface-soft, #f1f8f4);
}
.lk-admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.lk-admin-controls .lk-input,
.lk-admin-controls .lk-select {
  width: auto;
  min-width: 190px;
}
.lk-table-wrap {
  overflow-x: auto;
  background: var(--iveacer-surface, #ffffff);
  border: 1px solid var(--iveacer-border, #dce6df);
  border-radius: 12px;
}
.lk-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.lk-admin-table th,
.lk-admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--iveacer-border, #dce6df);
  text-align: left;
  vertical-align: top;
}
.lk-admin-table th {
  font-family: 'Prompt', sans-serif;
  background: var(--iveacer-surface-soft, #f1f8f4);
  color: var(--iveacer-heading, #14381e);
}
.lk-admin-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.lk-btn-sm {
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface, #ffffff);
  color: var(--iveacer-heading, #14381e);
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.lk-btn-sm.is-danger {
  color: var(--iveacer-danger-text, #a13928);
  border-color: currentColor;
}

/* =========================================================================
 * Footer
 * ========================================================================= */
.lk-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface, #ffffff);
  color: var(--iveacer-text-muted, #53665b);
  font-size: 0.9rem;
}
.lk-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lk-footer a {
  color: var(--iveacer-link, #226438);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* =========================================================================
 * Animations & Interactive Motion Controls
 * ========================================================================= */
@keyframes lkRiverFlow {
  0% { left: -14%; }
  100% { left: 106%; }
}
@keyframes lkGentleRock {
  0%, 100% { transform: translateY(0px) rotate(-1.4deg); }
  50% { transform: translateY(-6px) rotate(1.4deg); }
}
@keyframes lkWaterPulse {
  0% { transform: scale(0.85); opacity: 0.52; }
  100% { transform: scale(1.38); opacity: 0; }
}
@keyframes lkMoonBreathe {
  0%, 100% { box-shadow: 0 0 38px 12px rgba(254, 240, 138, 0.34), 0 0 90px 28px rgba(212, 175, 55, 0.16); }
  50% { box-shadow: 0 0 48px 18px rgba(254, 240, 138, 0.48), 0 0 112px 34px rgba(212, 175, 55, 0.24); }
}
@keyframes lkLaunchGlide {
  0% { transform: translateY(115px) scale(0.76); opacity: 0; }
  25% { opacity: 1; }
  70% { transform: translateY(-6px) scale(1.1); opacity: 1; }
  100% { transform: translateY(0) scale(1.04); opacity: 1; }
}
@keyframes lkPreviewSwap {
  0% { transform: translateY(6px) scale(0.94); filter: drop-shadow(0 0 0 rgba(253, 224, 71, 0)); }
  45% { transform: translateY(-5px) scale(1.04); filter: drop-shadow(0 0 18px rgba(253, 224, 71, 0.72)); }
  100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 rgba(253, 224, 71, 0)); }
}
@keyframes lkFlame {
  0%, 100% { transform: scaleY(1) skewX(0deg); }
  50% { transform: scaleY(1.08) skewX(2.4deg); }
}
.lk-flame-anim {
  transform-origin: 120px 66px;
  animation: lkFlame 1.7s ease-in-out infinite;
}
.lk-aura-anim {
  animation: lkFlame 2.5s ease-in-out infinite;
  transform-origin: 120px 54px;
}

/* Explicit pause via 'พักสายน้ำ' button or user's explicit Accessibility toggle */
.lk-river-stage.is-paused .lk-float-item,
.lk-river-stage.is-paused .lk-float-item::after,
.lk-river-stage.is-paused .lk-moon,
.lk-river-stage.is-paused .lk-flame-anim,
.lk-river-stage.is-paused .lk-aura-anim {
  animation-play-state: paused !important;
}
.lk-page.lk-motion-off .lk-preview-svg,
.lk-page.lk-motion-off .lk-flame-anim,
.lk-page.lk-motion-off .lk-aura-anim {
  animation: none !important;
}

/* =========================================================================
 * Phase 3: Tabbed Workshop, Mini SVG Thumbnails, 4-Theme E-Card & Mobile App Dock
 * ========================================================================= */
.lk-workshop-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: var(--iveacer-surface-soft, #f1f8f4);
  border: 1px solid var(--iveacer-border, #dce6df);
}
.lk-tab-btn {
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--iveacer-text-muted, #53665b);
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms, color 160ms;
  text-align: center;
  line-height: 1.25;
}
.lk-tab-btn.is-active {
  background: var(--iveacer-brand-green, #1e4d2b);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(20, 56, 30, 0.2);
}
.lk-tab-btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

.lk-step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--iveacer-border, #dce6df);
}

/* Rich Mini SVG Thumbnail Cards */
.lk-thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
#baseOptions .lk-option-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
@media (min-width: 480px) {
  .lk-thumb-grid.is-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.lk-option-card.has-thumb {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  padding: 7px 10px;
}
.lk-option-card.is-compact-thumb {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  min-height: 82px;
  padding: 8px 6px;
}
.lk-option-thumb {
  width: 48px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 42%, #074636 0%, #021d16 100%);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212, 175, 55, 0.35);
}
.lk-option-thumb svg {
  width: 100%;
  height: 100%;
  display: block;
}
.lk-option-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* E-Card 4-Theme Selector */
.lk-theme-section {
  margin-bottom: 12px;
}
.lk-theme-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.lk-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 13px;
  border-radius: 9999px;
  border: 1px solid var(--iveacer-border, #dce6df);
  background: var(--iveacer-surface-soft, #f1f8f4);
  color: var(--iveacer-text-main, #1e293b);
  font-family: 'Prompt', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}
.lk-theme-pill.is-selected {
  background: #064e3b;
  border-color: #064e3b;
  color: #ffffff;
}
.lk-theme-pill:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

/* Sticky Mobile Bottom Thumb Dock (< 1024px) */
.lk-mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(2, 26, 20, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(212, 175, 55, 0.42);
  box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.32);
}
@media (min-width: 1024px) {
  .lk-mobile-dock { display: none; }
}
.lk-dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 50px;
  padding: 5px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d4e5d8;
  font-family: 'Prompt', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms, color 160ms;
}
.lk-dock-btn.is-active {
  background: rgba(163, 230, 53, 0.18);
  color: #fde68a;
}
.lk-dock-btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: 1px; }
.lk-dock-ico {
  font-size: 1.15rem;
  line-height: 1;
}

/* Mobile-First Compact Layout (< 1024px & < 640px) */
.lk-page .iveacer-a11y-open {
  z-index: 1045;
}
@media (max-width: 1023px) {
  .lk-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .lk-page .iveacer-a11y-open,
  .lk-page .iveacer-cookie-fab,
  .lk-page .iveacer-cookie-banner {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .lk-preview-stage {
    position: sticky;
    top: 58px;
    z-index: 18;
    padding: 10px 12px;
    box-shadow: 0 8px 20px rgba(2, 26, 20, 0.22);
  }
  .lk-preview-svg {
    width: 148px;
    height: 122px;
  }
}

@media (max-width: 639px) {
  .lk-header-inner {
    flex-wrap: nowrap;
    padding: 6px 0;
    gap: 8px;
  }
  .lk-brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }
  .lk-brand img {
    width: 32px;
    height: 32px;
  }
  .lk-brand-title {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lk-brand-sub {
    display: none;
  }
  .lk-nav-desktop-only {
    display: none !important;
  }
  .lk-header-actions {
    flex-wrap: nowrap;
    gap: 6px;
    flex-shrink: 0;
  }
  .lk-nav-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .lk-nav-btn .lk-sound-label-long {
    display: none;
  }

  .lk-hero {
    padding: 14px 0 12px;
  }
  .lk-eyebrow {
    font-size: 0.76rem;
    padding: 4px 10px;
    margin-bottom: 8px;
  }
  .lk-hero-title {
    font-size: clamp(1.32rem, 5.4vw, 1.8rem);
    margin-bottom: 6px;
  }
  .lk-hero-desc {
    font-size: 0.86rem;
    line-height: 1.5;
  }
  .lk-float-tag {
    max-width: 112px;
    padding: 2px 7px;
  }
  .lk-float-tag strong {
    font-size: 0.68rem;
    max-width: 98px;
  }
  .lk-float-tag small {
    font-size: 0.62rem;
    max-width: 98px;
  }
  .lk-waterfront-strip {
    margin-top: 12px;
  }
  .lk-pier-chip {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .lk-workspace {
    padding: 14px 0 30px;
  }
  .lk-river-stage {
    min-height: 360px;
    height: clamp(360px, 49vh, 450px);
  }
  .lk-moon {
    width: 58px;
    height: 58px;
    top: 22px;
  }
  .lk-float-item.lane-0 { width: 70px; }
  .lk-float-item.lane-1 { width: 88px; }
  .lk-float-item.lane-2 { width: 108px; }
  .lk-workshop-card {
    padding: 14px;
  }
  .lk-toy-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
}

/* Dark Mode & High Contrast Refinements */
html[data-theme="dark"] .lk-stat-foot,
html[data-theme="dark"] .lk-leader-count {
  color: #fde68a;
}

html[data-contrast="high"] .lk-stage-card,
html[data-contrast="high"] .lk-workshop-card,
html[data-contrast="high"] .lk-stat-card,
html[data-contrast="high"] .lk-eco-card,
html[data-contrast="high"] .lk-leader-row,
html[data-contrast="high"] .lk-dialog {
  box-shadow: none !important;
  border-width: 2px;
}
