/* Meta lead-gen workspace (static/lead-workspace.js). Uses the theme.css tokens and the
   shared tb-* table/segment styles; everything else is its own lw-* class, so neither this
   nor the call workspace (cw-*) can restyle the other. */

.lw-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lw-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 6px; }
.lw-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, #60a5fa, #2f6fed 60%, #7c3aed);
  box-shadow: 0 0 10px rgba(96, 165, 250, .7); }

/* Layout primitives */
.lw-controls { gap: 10px; }
.lw-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .lw-grid-2 { grid-template-columns: 1fr; } }
.lw-grid-2 > .results-card { margin-bottom: 16px; }
.lw-section-title { font-size: 16px; margin: 18px 0 8px; }
.tb-table td.lw-label { min-width: 170px; }

/* Cards and stats */
.lw-headline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1200px) { .lw-headline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .lw-headline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lw-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 12px; min-width: 0; }
.lw-card .tb-kpi-label { font-size: 12px; font-weight: 600; }
.lw-card-value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.lw-card .tb-kpi-sub { font-size: 13px; min-height: 18px; }
.lw-spark { display: block; width: 100%; height: 34px; margin-top: 8px; }
.lw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.lw-stat-value { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.lw-stats-tight { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef1f5; }
.lw-stats-tight .lw-stat-value { font-size: 16px; }

.lw-stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .lw-stats-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lw-note { margin: 14px 0 0; font-size: 13px; }
.lw-warn { color: var(--warn); }
.lw-truth-table td:first-child { font-weight: 600; }
.tb-table td.lw-truth { background: var(--primary-soft); color: var(--primary-press); font-weight: 700; }

/* Funnel */
.lw-funnel-row { display: grid; grid-template-columns: 100px minmax(60px, 1fr) 70px; gap: 2px 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.lw-funnel-label { font-weight: 600; color: var(--ink-2); }
.lw-funnel-bar { height: 10px; background: #f1f3f7; border-radius: 5px; overflow: hidden; }
.lw-funnel-bar span { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.lw-funnel-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.lw-funnel-note { grid-column: 2 / -1; font-size: 12px; }

/* Loading: five card shapes where the headline will land */
.lw-skeleton { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.lw-skeleton span { height: 128px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, #f1f4f9 0%, #f8fafc 40%, #f1f4f9 80%) 0 0 / 300% 100%; animation: lw-shimmer 1.3s linear infinite; }
@keyframes lw-shimmer { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) { .lw-skeleton span { animation: none; } }

/* Headline cards */
.lw-headline .lw-card { position: relative; overflow: hidden; box-shadow: var(--shadow-1); transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.lw-headline .lw-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #2f6fed, #7c3aed); opacity: .85; }
.lw-headline .lw-card:first-child::before { background: linear-gradient(90deg, #15803d, #22c55e); }
.lw-headline .lw-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.lw-headline .lw-card-value { font-size: 30px; letter-spacing: -.02em; }

.lw-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lw-card-head h2 { margin: 0; }
.lw-table-wrap { overflow-x: auto; }

/* Revenue mix: one stacked bar, 2px surface gaps, rounded ends */
.lw-stack { display: flex; gap: 2px; height: 16px; margin: 6px 0 18px; }
.lw-stack span { min-width: 4px; border-radius: 4px; cursor: default; transition: filter .15s var(--ease); }
.lw-stack span:hover { filter: brightness(1.08); }
.lw-streams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lw-stream { font-size: 13px; }
.lw-stream-name { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); }
.lw-stream-name i { width: 10px; height: 10px; border-radius: 3px; }
.lw-stream-rev { font-size: 20px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.lw-stream-rev .tb-muted { font-size: 13px; font-weight: 500; }

/* Line charts */
.lw-chart { display: block; width: 100%; height: auto; touch-action: none; }
.lw-grid { stroke: #eef1f5; }
.lw-zero { stroke: #cbd5e1; }
.lw-axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.lw-cross { stroke: #94a3b8; stroke-width: 1; }
.lw-hit { cursor: crosshair; }

/* Floating tooltip (one for the page) */
.lw-tip { position: fixed; top: 0; left: 0; z-index: 1000; display: none; pointer-events: none; min-width: 150px;
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 9px 12px; font-size: 12px; box-shadow: 0 12px 28px rgba(15, 23, 42, .28); }
.lw-tip-title { font-weight: 700; color: #fff; margin-bottom: 5px; }
.lw-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.lw-tip-row i { width: 12px; border-top: 2px solid; }
.lw-tip-row strong { color: #fff; font-variant-numeric: tabular-nums; }
.lw-tip-row span { color: #94a3b8; }

/* Niche leaderboard */
.lw-board { overflow-x: auto; }
.lw-board-row { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(200px, 2fr) repeat(4, minmax(78px, .7fr)) 118px;
  gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #f1f2f4; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 860px; }
.lw-board-row:last-child { border-bottom: 0; }
.lw-board-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 0; }
.lw-board-head .tb-muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.lw-board-name { display: flex; flex-direction: column; font-weight: 600; }
.lw-board-name .tb-muted { font-size: 12px; font-weight: 400; }
.lw-roas { display: flex; align-items: center; gap: 10px; }
.lw-roas strong { min-width: 44px; text-align: right; }
.lw-roas-track { position: relative; flex: 1; height: 10px; background: #f1f3f7; border-radius: 5px; }
.lw-roas-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.lw-roas-bar.lw-up { background: var(--good); }
.lw-roas-bar.lw-down { background: var(--bad); }
.lw-roas-be { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }

/* Verdict pills: always an icon and a word, never color alone */
.lw-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.lw-pill span { font-size: 10px; }
.lw-pill-scale { background: var(--good-soft); color: var(--good); }
.lw-pill-hold { background: var(--warn-soft); color: var(--warn); }
.lw-pill-cut { background: var(--bad-soft); color: var(--bad); }
.lw-pill-early { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.lw-verdicts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .lw-verdicts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lw-verdict-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-1);
  display: grid; gap: 6px; font-size: 13px; }
.lw-verdict-n { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }

.tb-table tr.lw-click { cursor: pointer; transition: background .12s var(--ease); }
.tb-table tr.lw-click:hover { background: var(--primary-soft); }
.tb-table tr.lw-open { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }

/* Connections */
.lw-conn { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.lw-conn-on { background: var(--good-soft); color: var(--good); }
.lw-conn-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.lw-conn-next { background: var(--primary-soft); color: var(--primary); }

/* Ads: save-as-winner */
.lw-star { font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; padding: 5px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); text-decoration: none; transition: all .15s var(--ease); }
.lw-star:hover { border-color: #f59e0b; color: #b45309; background: #fffbeb; }
.lw-star-on { border-color: #fcd34d; background: #fffbeb; color: #b45309; }

/* Placements */
.lw-site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }

/* Spy + Studio */
.lw-spy { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.lw-spy p { margin: 6px 0 0; max-width: 680px; }
@media (max-width: 800px) { .lw-spy { flex-direction: column; align-items: flex-start; } }
.lw-studio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .lw-studio { grid-template-columns: 1fr; } }
.lw-studio .results-card { margin-bottom: 0; display: flex; flex-direction: column; align-items: flex-start; }
.lw-studio .results-card p { flex: 1; }

/* Launch */
.lw-steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; }
.lw-id-parts { display: grid; grid-template-columns: 1fr 1fr 2fr 80px; gap: 10px; }
.lw-files { display: grid; gap: 6px; margin: -6px 0 16px; font-size: 13px; }
.lw-files div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; }
.lw-files code { word-break: break-all; }
.lw-id-2 { grid-template-columns: 2fr 1fr; }
.lw-launch-form .field { margin-bottom: 12px; }
.lw-launch-form .field input, .lw-launch-form .field textarea { width: 100%; box-sizing: border-box; }
.lw-id-preview { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 16px; padding: 12px 14px; border-radius: 10px;
  background: var(--primary-soft); border: 1px solid #c7d7fb; }
.lw-id-preview strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; color: var(--primary-press); word-break: break-all; }
.lw-manifest { margin: 0; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }

@media (max-width: 700px) {
  .lw-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lw-streams { grid-template-columns: 1fr; }
  .lw-id-parts { grid-template-columns: 1fr 1fr; }
}
