:root {
  --bg-deep: #060913;
  --bg-panel: #0e1424;
  --bg-card: #141c32;
  --bg-card-hover: #1b2642;
  --border: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(244, 114, 182, 0.55);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-pink: #ec4899;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-glow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: radial-gradient(circle at 15% 0%, #171332 0%, var(--bg-deep) 52%);
  color: var(--text-main);
  font-family: "Noto Sans Thai", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

/* Top Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(6, 9, 19, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-cyan));
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.35);
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  line-height: 1.1;
}

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

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
  padding: 6px 13px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.wallet-pill:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-pink), #8b5cf6);
  color: #fff;
  box-shadow: 0 10px 26px rgba(236, 72, 153, 0.32);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #be123c);
  color: #fff;
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.35);
}

/* Studio Workspace Grid */
.studio-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 16px 56px;
  display: grid;
  grid-template-columns: minmax(320px, 430px) 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 960px) {
  .studio-shell {
    grid-template-columns: 1fr;
    padding: 12px 12px 48px;
  }
}

/* 9:16 Live Stage Card */
.stage-column {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 960px) {
  .stage-column {
    position: static;
  }
}

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 76vh;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(160deg, #131a2e, #090d19);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-stage.aspect-landscape {
  aspect-ratio: 16 / 9;
  max-height: none;
}

.stage-bg-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.36;
  transition: background 0.35s ease;
}

.stage-video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-video.mirrored {
  transform: scaleX(-1);
}

.stage-placeholder {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  background: radial-gradient(circle at 50% 35%, rgba(236, 72, 153, 0.15), rgba(6, 9, 19, 0.88));
}

.stage-placeholder.hidden {
  display: none;
}

.stage-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.hud-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.76);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 700;
}

.hud-badge.live {
  background: rgba(225, 29, 72, 0.88);
  border-color: #fda4af;
  color: #fff;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
}

.hud-badge.live .pulse-dot {
  background: #fff;
  animation: pulseLive 1.1s infinite;
}

@keyframes pulseLive {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.stage-hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.icon-pill {
  background: rgba(8, 12, 24, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-pill:hover {
  background: rgba(236, 72, 153, 0.35);
}

/* Clean Fullscreen Mode for Mobile Screen Capture / TikTok App */
body.clean-fullscreen {
  background: #000;
  overflow: hidden;
}
body.clean-fullscreen .topbar,
body.clean-fullscreen .controls-column,
body.clean-fullscreen .seo-section,
body.clean-fullscreen .stage-actions-bar,
body.clean-fullscreen .stage-hud-top,
body.clean-fullscreen .stage-hud-bottom {
  display: none !important;
}
body.clean-fullscreen .studio-shell {
  max-width: none;
  padding: 0;
  margin: 0;
  display: block;
}
body.clean-fullscreen .video-stage {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
}

.stage-actions-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.btn-go-live {
  width: 100%;
  padding: 15px 20px;
  border-radius: 16px;
  font-size: 1.03rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 50%, #f97316 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(244, 63, 94, 0.4);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.btn-go-live:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-go-live.is-live {
  background: linear-gradient(135deg, #dc2626, #991b1b);
}

/* Right Column: Studio Controls */
.controls-column {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rate-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.14), rgba(6, 182, 212, 0.12));
  border: 1px solid rgba(236, 72, 153, 0.32);
}

.rate-price-tag {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fbcfe8;
}

.tabs-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(6, 9, 19, 0.65);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

@media (max-width: 600px) {
  .tabs-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: var(--bg-card-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-pane.active {
  display: flex;
}

.mode-switch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 560px) {
  .mode-switch-grid {
    grid-template-columns: 1fr;
  }
}

.mode-card {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-card.selected {
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.12);
}

.mode-card h4 {
  font-size: 0.94rem;
  margin-bottom: 4px;
}

.mode-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}

.preset-card {
  position: relative;
  border-radius: 16px;
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.preset-card:hover {
  transform: translateY(-2px);
}

.preset-card.selected {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.28);
}

.preset-thumb {
  height: 92px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 2.3rem;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

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

.preset-title {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.3;
}

.preset-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.upload-box {
  border: 1.5 dashed rgba(236, 72, 153, 0.45);
  border-style: dashed;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  background: rgba(236, 72, 153, 0.05);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f9a8d4;
}

.upload-box:hover {
  background: rgba(236, 72, 153, 0.11);
}

/* Toggle & Inputs */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #cbd5e1;
}

.input-text {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: #090d19;
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.92rem;
}

.input-text:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.rvc-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
}

.rvc-toggle-card.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-sw {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  border-radius: 999px;
  transition: 0.2s;
}
.slider-sw:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider-sw {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
}
.switch input:checked + .slider-sw:before {
  transform: translateX(24px);
}

/* SEO & Comparison Section */
.seo-section {
  max-width: 1160px;
  margin: 12px auto 72px;
  padding: 0 16px;
  display: grid;
  gap: 28px;
}

.seo-card {
  background: rgba(14, 20, 36, 0.85);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
}

.seo-card h2 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 0.92rem;
}

.compare-table th, .compare-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.compare-table th {
  color: #f9a8d4;
  font-weight: 700;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.faq-item h3 {
  font-size: 0.96rem;
  margin-bottom: 6px;
  color: #67e8f9;
}

.faq-item p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal-panel {
  width: 100%;
  max-width: 480px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 92vh;
  overflow-y: auto;
}

.pkg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pkg-card {
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  cursor: pointer;
  text-align: left;
}

.pkg-card.popular {
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.1);
}

.toast-bar {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #0f172a;
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  display: none;
}
.toast-bar.show {
  display: block;
}
