:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-sub: #4b5563;
  --text-muted: #6b7280;
  --accent: #111827;
  --brand: #ff5a36;
  --brand-soft: #fff1ed;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --red: #e11d48;
  --red-soft: #fff1f2;
  --kakao-bg: #b2c7d9;
  --kakao-yellow: #fee500;
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #111827 0%, #ff5a36 100%);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

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

.btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.btn-primary {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.btn-primary:hover {
  background: #1f2937;
}

.btn-kakao {
  background: var(--kakao-yellow);
  color: #191919;
  border-color: #ebd300;
}

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

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 64px;
}

/* KPI Strip */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-val {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.kpi-val.bad { color: var(--red); }
.kpi-val.good { color: var(--green); }
.kpi-val.accent { color: var(--blue); }

.kpi-sub {
  font-size: 12px;
  color: var(--text-sub);
}

/* View Switcher Tabs */
.main-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mode-tabs {
  display: inline-flex;
  background: #e5e7eb;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.mode-tab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}

.mode-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.search-box {
  position: relative;
  min-width: 250px;
  flex: 0 1 320px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13.5px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Filter Pills */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
}

.filter-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.filter-count {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  background: rgba(107, 114, 128, 0.15);
}

.filter-pill.active .filter-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Sample Cards Grid */
.samples-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.sample-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sample-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.sample-card.highlight-focus {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 90, 54, 0.14);
}

.card-meta-header {
  padding: 14px 18px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sample-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

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

.cat-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
}

.cat-badge.pin { background: #fef3c7; color: #b45309; }
.cat-badge.flash { background: var(--red-soft); color: var(--red); }
.cat-badge.story { background: var(--green-soft); color: var(--green); }
.cat-badge.fomo { background: #f3e8ff; color: #7e22ce; }
.cat-badge.reach { background: #ffedd5; color: #c2410c; }

.sample-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.slot-chip {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Realistic Threads Post Simulation */
.threads-sim {
  padding: 18px 18px 14px;
  background: #ffffff;
  flex: 1;
}

.pin-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 48px;
  margin-bottom: 6px;
}

.th-row {
  display: flex;
  gap: 12px;
  position: relative;
}

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

.th-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.th-avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.th-line {
  width: 2px;
  flex: 1;
  background: #e5e7eb;
  margin: 6px 0;
  min-height: 24px;
}

.th-main {
  flex: 1;
  min-width: 0;
  padding-bottom: 12px;
}

.th-handle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.th-handle {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}

.th-time {
  font-size: 12px;
  color: #9ca3af;
}

.th-body {
  font-size: 14.5px;
  line-height: 1.58;
  color: #111827;
  white-space: pre-line;
  word-break: keep-all;
  margin-bottom: 12px;
}

/* Visual Mockups Replacing Dark Banner Cards */
.visual-box {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

/* 1) Light-mode Real Shopping App Capture Mockup */
.shop-capture {
  background: #ffffff;
  padding: 14px 15px;
}

.shop-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #6b7280;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 10px;
}

.shop-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  color: #fff;
  margin-bottom: 6px;
}

.shop-prod-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.shop-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-disc {
  font-size: 22px;
  font-weight: 900;
  color: #e11d48;
}

.shop-sale {
  font-size: 22px;
  font-weight: 900;
  color: #111827;
}

.shop-origin {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: line-through;
}

.shop-unit-bar {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff1f2;
  color: #be123c;
  font-size: 12.5px;
  font-weight: 800;
}

/* 2) KakaoTalk OpenChat Room Capture Mockup */
.kakao-capture {
  background: var(--kakao-bg);
  padding: 12px 13px;
}

.kakao-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 9px;
}

.kakao-bubble {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.kakao-bubble:last-child {
  margin-bottom: 0;
}

.kb-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  background: #fee500;
  color: #191919;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.kb-title {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.kb-price {
  font-size: 14px;
  font-weight: 900;
  color: #e11d48;
  margin-top: 2px;
}

.kb-unit {
  font-size: 12px;
  color: #374151;
  margin-top: 2px;
}

.kb-react {
  margin-top: 6px;
  display: inline-block;
  font-size: 11px;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 999px;
  color: #374151;
  font-weight: 700;
}

/* 3) Zero-Image Strategy Callout */
.zero-img-badge {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.zi-head {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 3px;
}

.zi-desc {
  font-size: 12px;
  color: #475569;
}

/* 4) Schedule / Clean Rule Card */
.clean-card {
  background: #f8fafc;
  padding: 12px 14px;
}

.clean-item {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 5px;
}

.clean-proof {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-size: 11.5px;
  color: #059669;
  font-weight: 800;
}

.th-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: #6b7280;
  font-weight: 600;
}

.th-reply-body {
  font-size: 13.8px;
  line-height: 1.55;
  color: #1f2937;
  white-space: pre-line;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  padding: 10px 12px;
  border-radius: 12px;
}

.th-reply-body.no-reply-note {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  font-size: 12.5px;
}

/* Expandable Diagnosis / Before-After Section */
.diag-drawer {
  border-top: 1px solid var(--border);
  background: #fcfcfd;
  padding: 12px 18px;
}

.diag-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.bench-ref {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

.diag-content {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.diag-content.open {
  display: block;
}

.before-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.before-head {
  font-size: 12px;
  font-weight: 800;
  color: #be123c;
  margin-bottom: 4px;
}

.before-text {
  font-size: 12.5px;
  color: #881337;
  white-space: pre-line;
}

.why-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #374151;
}

.why-list li {
  margin-bottom: 4px;
}

/* Card Footer Copy Actions */
.card-actions {
  padding: 12px 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.copy-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

/* Strategy & Schedule View */
.strategy-panel {
  display: none;
}

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

.samples-panel {
  display: none;
}

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

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

.strat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.strat-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}

.bio-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.bio-box {
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  white-space: pre-line;
}

.bio-box.old {
  background: #f3f4f6;
  color: #6b7280;
}

.bio-box.new {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-weight: 700;
}

.sched-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.sched-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

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

.sched-table th {
  background: var(--surface-soft);
  font-weight: 800;
  color: var(--text-sub);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Toast */
.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: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
}

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

@media (max-width: 960px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .samples-grid,
  .strat-grid {
    grid-template-columns: 1fr;
  }
  .bio-compare {
    grid-template-columns: 1fr;
  }
}

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