:root {
  --bg-page: #0f172a;
  --bg-light: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --sub: #4b5563;
  --muted: #6b7280;
  --border: #e5e7eb;
  --red: #e11d48;
  --red-bg: #fff1f2;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --green: #059669;
  --green-bg: #ecfdf5;
  --kakao: #fee500;
  --kakao-text: #191919;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--bg-light);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Operator Studio Header (hidden in ?view=clean customer mode) */
body.clean-mode .studio-header,
body.clean-mode .xray-sidebar,
body.clean-mode .studio-banner {
  display: none !important;
}

body.clean-mode .bridge-layout {
  grid-template-columns: 1fr !important;
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
}

body.clean-mode .phone-shell {
  border-radius: 0;
  border: none;
  box-shadow: none;
  min-height: 100vh;
}

.studio-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(12px);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.studio-header-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sh-badge {
  background: linear-gradient(135deg, #ff4d4d, #f97316);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 8px;
}

.sh-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.sh-sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: #9ca3af;
}

.sh-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 11px;
  gap: 4px;
}

.sh-tab {
  border: none;
  background: transparent;
  color: #d1d5db;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sh-tab.active {
  background: #ffffff;
  color: #111827;
}

.sh-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.s-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.s-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.s-btn-kakao {
  background: var(--kakao);
  color: var(--kakao-text);
  border-color: var(--kakao);
  font-weight: 800;
}

.s-btn-kakao:hover {
  background: #f5dc00;
}

/* Panels */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* Mode 1: Customer Live Bridge Simulator + X-Ray Layout */
.bridge-layout {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px 18px 80px;
  display: grid;
  grid-template-columns: 470px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.phone-shell {
  background: #f8fafc;
  border-radius: 28px;
  border: 6px solid #1e293b;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  overflow: hidden;
  position: relative;
}

/* Inside Customer Bridge Hub */
.live-ticker {
  background: #111827;
  color: #f9fafb;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.6s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* #0 Top Kakao Hero Card */
.hero-kakao-card {
  background: linear-gradient(160deg, #18181b 0%, #27272a 100%);
  color: #ffffff;
  padding: 20px 18px 18px;
  border-bottom: 1px solid #3f3f46;
}

.hk-eyebrow {
  display: inline-block;
  background: rgba(254, 229, 0, 0.16);
  color: #fde047;
  border: 1px solid rgba(254, 229, 0, 0.35);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hk-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: -0.02em;
  white-space: pre-line;
}

.hk-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: #d4d4d8;
  line-height: 1.48;
}

.hk-proof-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hk-chip {
  background: rgba(255, 255, 255, 0.09);
  color: #f4f4f5;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.kakao-mega-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--kakao);
  color: var(--kakao-text);
  font-size: 15.5px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(254, 229, 0, 0.32);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.kakao-mega-cta:hover {
  transform: translateY(-2px);
}

.hk-micro-note {
  margin-top: 9px;
  text-align: center;
  font-size: 11.5px;
  color: #a1a1aa;
  font-weight: 600;
}

/* Instant Code/Keyword Filter inside Phone */
.hub-search-wrap {
  background: #ffffff;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hub-search-input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 11px;
  border: 2px solid #111827;
  font-size: 13.5px;
  font-weight: 700;
  outline: none;
  background: #f9fafb;
}

.hub-search-input:focus {
  border-color: var(--red);
  background: #fff;
}

.quick-code-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-top: 8px;
  padding-bottom: 2px;
}

.q-pill {
  border: 1px solid var(--border);
  background: #fff;
  color: #374151;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.q-pill.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* Live Deal Cards Stack */
.hub-deals-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hub-section-label {
  font-size: 13px;
  font-weight: 900;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}

.deal-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1.5px solid #e5e7eb;
  padding: 15px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.05);
  transition: all 0.2s ease;
}

.deal-card.spotlight {
  border: 2.5px solid var(--red);
  box-shadow: 0 0 0 5px rgba(225, 29, 72, 0.16);
  animation: popCard 0.35s ease;
}

@keyframes popCard {
  0% { transform: scale(0.97); }
  60% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.dc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dc-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dc-code {
  background: #111827;
  color: #fff;
  font-size: 11.5px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
}

.dc-mall {
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
}

.dc-verified {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

.dc-shock {
  background: var(--red-bg);
  color: #be123c;
  font-size: 13px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.dc-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 8px;
  line-height: 1.38;
}

.dc-price-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.dc-disc {
  font-size: 24px;
  font-weight: 900;
  color: var(--red);
}

.dc-sale {
  font-size: 24px;
  font-weight: 900;
  color: #111827;
}

.dc-avg {
  font-size: 12.5px;
  color: #9ca3af;
  text-decoration: line-through;
}

.dc-unit {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 10px;
}

/* Depletion Progress Bar */
.depletion-wrap {
  margin-bottom: 12px;
}

.dep-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: #be123c;
  margin-bottom: 4px;
}

.dep-track {
  height: 7px;
  border-radius: 999px;
  background: #fee2e2;
  overflow: hidden;
}

.dep-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f97316, #e11d48);
}

.dc-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.dc-cta:hover {
  background: var(--red);
  transform: translateY(-1px);
}

/* Regret Sold-Out FOMO Zone */
.soldout-zone {
  margin: 4px 14px 18px;
  background: #f1f5f9;
  border: 1.5px dashed #94a3b8;
  border-radius: 18px;
  padding: 15px;
}

.sz-head {
  font-size: 13px;
  font-weight: 900;
  color: #334155;
  margin-bottom: 10px;
}

.sz-item {
  background: #ffffff;
  opacity: 0.78;
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
}

.sz-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  text-decoration: line-through;
}

.sz-meta {
  font-size: 11.5px;
  font-weight: 800;
  color: #dc2626;
  margin-top: 2px;
}

.sz-trap-cta {
  margin-top: 10px;
  display: block;
  text-align: center;
  background: var(--kakao);
  color: var(--kakao-text);
  font-size: 13.5px;
  font-weight: 900;
  padding: 12px;
  border-radius: 11px;
  text-decoration: none;
}

.hub-footer {
  padding: 14px 16px 22px;
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

/* Right X-Ray Explanation Sidebar */
.xray-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
}

.xray-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px 22px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.xray-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 900;
}

.xray-step {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.xray-step:last-child {
  margin-bottom: 0;
}

.xs-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.xs-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.xs-body span {
  font-size: 13px;
  color: var(--sub);
}

/* Mode 2: 10 Magnet Threads Posts */
.posts-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

.posts-intro {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.m-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.mc-head {
  background: #f8fafc;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.mc-id {
  background: #111827;
  color: #fff;
  font-size: 11.5px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
}

.mc-trigger {
  font-size: 12px;
  font-weight: 800;
  color: var(--red);
}

.mc-power {
  font-size: 11.5px;
  font-weight: 800;
  background: var(--blue-bg);
  color: var(--blue);
  padding: 3px 8px;
  border-radius: 999px;
}

.mc-threads {
  padding: 16px;
  flex: 1;
}

.mc-row {
  display: flex;
  gap: 11px;
}

.mc-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 34px;
  flex-shrink: 0;
}

.mc-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-ava.sm {
  width: 24px;
  height: 24px;
  font-size: 10.5px;
}

.mc-line {
  width: 2px;
  flex: 1;
  background: #e5e7eb;
  margin: 5px 0;
  min-height: 18px;
}

.mc-main {
  flex: 1;
  padding-bottom: 10px;
}

.mc-handle {
  font-size: 13.5px;
  font-weight: 800;
  margin-bottom: 4px;
}

.mc-body {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.56;
  white-space: pre-line;
  color: #111827;
  margin-bottom: 9px;
}

.mc-vis-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
  padding: 4px 10px;
  border-radius: 8px;
}

.mc-reply {
  font-size: 13.5px;
  line-height: 1.52;
  white-space: pre-line;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 11px;
  padding: 10px 12px;
}

.mc-psych {
  padding: 10px 16px;
  background: #fffbeb;
  border-top: 1px solid #fef3c7;
  font-size: 12px;
  color: #92400e;
  font-weight: 600;
}

.mc-foot {
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.act-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
}

.act-btn:hover {
  background: #f3f4f6;
}

.act-btn-sim {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.act-btn-sim:hover {
  background: #be123c;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 200;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .bridge-layout {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
  .xray-sidebar {
    position: static;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
}
