:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #697386;
  --line: #d9dee8;
  --panel: #ffffff;
  --bg: #f5f7fb;
  --brand: #176b87;
  --brand-strong: #0e4c61;
  --accent: #c65f3a;
  --good: #1f8a5b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

button.ghost {
  color: var(--ink);
  background: #e8edf4;
}

button.danger-ghost {
  color: #8f2f23;
  background: #fde8e4;
}

button.danger-ghost:hover,
button.danger-button {
  color: #fff;
  background: #b33a2d;
}

button.danger-button:hover {
  background: #8f2f23;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  line-height: 1;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 24px;
  color: #f8fbff;
  background: #17202c;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 800;
}

.brand small,
.snippet span {
  display: block;
  color: #aab5c7;
}

nav {
  display: grid;
  gap: 8px;
}

nav a,
.back-link {
  color: inherit;
  text-decoration: none;
}

nav a {
  padding: 11px 12px;
  border-radius: 6px;
  color: #dce5f2;
}

nav a.active,
nav a:hover {
  background: #233246;
}

.snippet {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.snippet code {
  display: block;
  white-space: normal;
  padding: 12px;
  border-radius: 6px;
  color: #dce5f2;
  background: #101722;
  font-size: 12px;
}

.sidebar-projects {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.sidebar-label {
  color: #aab5c7;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-project-list {
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
}

.sidebar-project-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  color: #dce5f2;
  background: transparent;
  text-align: left;
}

.sidebar-project-row:hover,
.sidebar-project-row.active {
  color: #fff;
  background: #233246;
}

.sidebar-project-row strong,
.sidebar-project-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-project-row small {
  grid-column: 2;
  color: #aab5c7;
}

.project-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #697386;
}

.project-status-dot.active {
  background: #35c27a;
  box-shadow: 0 0 0 4px rgba(53, 194, 122, 0.16);
}

.app {
  margin-left: 260px;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 30px;
}

h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

p,
td,
th,
small {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
}

.create-project-card {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.create-project-card p {
  margin-bottom: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.workspace.single {
  display: block;
}

.projects-panel,
.project-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.projects-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.compact {
  margin-bottom: 0;
}

.projects-list,
.new-project-form,
.recordings-list,
.suggestions-list {
  display: grid;
  gap: 10px;
}

.project-row,
.recording-row {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fbfcfd;
  text-align: left;
}

.project-row:hover,
.project-row.active,
.recording-row:hover,
.recording-row.active {
  border-color: rgba(23, 107, 135, 0.45);
  color: var(--ink);
  background: #edf7fa;
}

.project-row strong,
.project-row span,
.recording-row strong,
.recording-row span,
.recording-row small {
  display: block;
}

.project-row span,
.recording-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.recording-row small {
  margin-top: 5px;
  color: var(--brand);
  line-height: 1.35;
}

.new-project-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fbfcfd;
}

.project-detail {
  padding: 18px;
  min-width: 0;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.detail-head > div:last-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.detail-head h2 {
  margin: 4px 0 2px;
  font-size: 26px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.active {
  color: #0d5a36;
  background: #dff7e9;
}

.status-badge.idle {
  color: #704523;
  background: #fff0df;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.mini-metrics article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.mini-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.mini-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  white-space: nowrap;
  color: var(--ink);
  background: #e8edf4;
}

.icon-text-button span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
}

.install-panel {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.install-panel.collapsed {
  display: none;
}

.activity-line {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
}

.activity-line span {
  color: var(--muted);
  font-size: 13px;
}

.install-codes {
  display: grid;
  gap: 10px;
}

.copy-button {
  justify-self: start;
}

.install-codes textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fbfcfd;
}

.install-codes label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.install-codes textarea {
  min-height: 74px;
  resize: vertical;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs button {
  border-radius: 6px 6px 0 0;
  color: var(--muted);
  background: transparent;
}

.tabs button:hover,
.tabs button.active {
  color: var(--brand-strong);
  background: #edf7fa;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  min-width: 0;
}

.suggestions-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.suggestion-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.suggestion-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.suggestion-card h3 {
  margin: 8px 0;
  font-size: 18px;
}

.suggestion-card p {
  margin-bottom: 0;
  line-height: 1.5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metrics article {
  padding: 18px;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  gap: 14px;
}

.grid.lower {
  margin-top: 14px;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head p {
  margin-bottom: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.heatmap-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.heatmap-tools select {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.heatmap {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 520px;
  max-height: 680px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(rgba(23, 107, 135, 0.1), rgba(23, 107, 135, 0.1)),
    repeating-linear-gradient(0deg, transparent, transparent 47px, rgba(105, 115, 134, 0.16) 48px),
    repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(105, 115, 134, 0.16) 48px),
    #f9fbfd;
}

.heatmap-surface {
  position: relative;
  min-height: 520px;
  width: 100%;
  max-width: 100%;
  background: #fff;
}

.heatmap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  pointer-events: none;
  transform-origin: top left;
}

.heatmap::after {
  content: "";
  position: sticky;
  display: block;
  inset: 0;
  z-index: 1;
  height: 0;
  pointer-events: none;
}

.heatmap-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.heatmap-empty,
.empty-line {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
}

.heatmap-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(249, 251, 253, 0.88);
}

.heat-point {
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 95, 58, 0.9) 0 18%, rgba(198, 95, 58, 0.28) 42%, rgba(198, 95, 58, 0) 72%);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.funnel {
  display: grid;
  gap: 10px;
}

.funnel div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 6px;
  background: #f2f6f9;
}

.funnel strong {
  font-size: 24px;
}

.events-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.event-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.event-item strong {
  color: var(--brand-strong);
}

.event-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.replay-panel {
  min-height: 520px;
  min-width: 0;
}

.replay-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.replay-screen {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.86)),
    repeating-linear-gradient(0deg, transparent, transparent 53px, rgba(105, 115, 134, 0.14) 54px),
    repeating-linear-gradient(90deg, transparent, transparent 53px, rgba(105, 115, 134, 0.14) 54px),
    #eaf0f6;
}

.fullscreen-target {
  position: relative;
}

.fullscreen-target:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.fullscreen-target:fullscreen .heatmap,
.fullscreen-target:fullscreen .replay-screen {
  min-height: calc(100vh - 118px);
  height: calc(100vh - 118px);
}

.fullscreen-target:fullscreen .heatmap {
  max-height: calc(100vh - 118px);
}

.fullscreen-target:fullscreen .video-output {
  max-height: calc(100vh - 118px);
  overflow: auto;
}

.fullscreen-target:fullscreen .video-output video {
  max-height: calc(100vh - 230px);
  min-height: 420px;
}

.fullscreen-target:fullscreen.replay-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.fullscreen-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  background: #101722;
}

.fullscreen-target:fullscreen.show-fullscreen-close .fullscreen-close {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.replay-cursor {
  position: absolute;
  z-index: 2;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 8px rgba(198, 95, 58, 0.16);
  transition: left 0.25s ease, top 0.25s ease;
}

.replay-events {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100% - 28px));
}

.replay-event {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 13px;
}

.video-output {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.video-output video {
  width: 100%;
  max-width: 100%;
  min-height: 220px;
  border-radius: 6px;
  background: #101722;
}

.video-output a {
  justify-self: start;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.funnel-list,
.traffic-list,
.forms-list {
  display: grid;
  gap: 10px;
}

.funnel-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.funnel-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.funnel-step small {
  min-width: 90px;
  text-align: right;
}

.traffic-list div {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.traffic-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-badge {
  align-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: #edf7fa;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.form-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.form-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.form-card-head h3 {
  margin: 0 0 6px;
}

.form-card-head p {
  margin-bottom: 0;
}

.form-card-head strong {
  color: var(--brand-strong);
  font-size: 28px;
}

.chat-panel {
  display: grid;
  gap: 14px;
}

.chat-messages {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
}

.chat-message {
  max-width: 78%;
  padding: 11px 12px;
  border-radius: 8px;
  line-height: 1.45;
}

.chat-message.assistant {
  justify-self: start;
  border: 1px solid var(--line);
  background: #fff;
}

.chat-message.user {
  justify-self: end;
  color: #fff;
  background: var(--brand);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #fbfcfd;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 23, 34, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.confirm-modal {
  width: min(460px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 23, 34, 0.28);
}

.confirm-modal p {
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.demo-page {
  background: #fbfcfd;
}

.demo-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.back-link {
  color: var(--brand);
  font-weight: 700;
}

.demo-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 28px 80px;
}

.demo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 44px;
  align-items: center;
  min-height: 520px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.demo-hero h1 {
  max-width: 680px;
  margin: 14px 0;
  font-size: 54px;
  line-height: 1.02;
}

.demo-hero p {
  max-width: 580px;
  font-size: 18px;
  line-height: 1.6;
}

.demo-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.demo-actions a {
  color: var(--brand);
  font-weight: 700;
}

.product-preview {
  min-height: 310px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17202c;
  color: #fff;
  display: grid;
  align-content: center;
  gap: 16px;
}

.product-preview span {
  color: #aab5c7;
}

.product-preview strong {
  font-size: 38px;
}

.bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 10px;
  height: 140px;
}

.bars i {
  display: block;
  border-radius: 6px 6px 0 0;
  background: var(--accent);
}

.bars i:nth-child(1) { height: 44%; }
.bars i:nth-child(2) { height: 62%; background: #d88b42; }
.bars i:nth-child(3) { height: 78%; background: #2d9c72; }
.bars i:nth-child(4) { height: 92%; background: #54b2c8; }

.demo-band,
.pricing-zone {
  display: grid;
  gap: 16px;
}

.demo-band {
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0 42px;
}

.demo-band article,
.pricing-zone,
.lead-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.demo-band article {
  padding: 20px;
}

.pricing-zone {
  grid-template-columns: minmax(0, 1fr) 380px;
  padding: 28px;
}

.pricing-zone ul {
  padding-left: 20px;
  color: var(--muted);
}

.lead-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.lead-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.lead-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
}

@media (max-width: 1180px) {
  .recording-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .app {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .demo-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-head > div:last-child {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .metrics,
  .install-panel,
  .create-project-card,
  .workspace,
  .grid,
  .grid.lower,
  .detail-head,
  .mini-metrics,
  .suggestions-list,
  .recording-layout,
  .demo-hero,
  .demo-band,
  .pricing-zone {
    grid-template-columns: 1fr;
  }

  .demo-hero h1 {
    font-size: 38px;
  }

  .event-item {
    grid-template-columns: 1fr;
  }

  .funnel-step,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-message {
    max-width: 100%;
  }
}

/* Metrica-inspired application shell */
:root {
  --ink: #202738;
  --muted: #748097;
  --line: #e2e7f0;
  --panel: #ffffff;
  --bg: #eef2f8;
  --brand: #4c4ce5;
  --brand-strong: #3737c7;
  --accent: #7457eb;
  --good: #28a46b;
}

body {
  background: var(--bg);
}

button {
  border-radius: 10px;
}

.sidebar {
  width: 224px;
  padding: 18px 12px 16px;
  gap: 20px;
  color: var(--ink);
  background: #f7f9fc;
  border-right: 1px solid var(--line);
}

.brand {
  padding: 0 8px;
}

.brand strong {
  font-size: 19px;
  letter-spacing: -0.5px;
}

.brand small,
.snippet span {
  color: var(--muted);
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 2px;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
}

.brand-mark i {
  display: block;
  width: 10px;
}

.brand-mark i:nth-child(1) { background: #175cff; }
.brand-mark i:nth-child(2) { background: #ffdc2e; }
.brand-mark i:nth-child(3) { background: #fa3c61; }

.module-nav,
.sidebar-section {
  display: grid;
  gap: 4px;
}

.module-nav button,
.sidebar-section button,
.sidebar-section a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  color: #657188;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}

.module-nav button span,
.sidebar-section button span,
.sidebar-section a span {
  color: #8893a7;
  font-size: 15px;
  text-align: center;
}

.module-nav button:hover,
.module-nav button.active,
.sidebar-section button:hover,
.sidebar-section a:hover {
  color: #30394c;
  background: #e7ebf4;
}

.module-nav button.active span {
  color: var(--brand);
}

.sidebar-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-label {
  padding: 0 10px 6px;
  color: #9aa4b5;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.snippet {
  padding: 0 8px;
}

.snippet code {
  padding: 9px 10px;
  color: #697386;
  background: #edf1f7;
}

.app {
  margin-left: 224px;
  padding: 0 22px 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 64px;
  margin: 0 -22px 18px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 242, 248, 0.92);
  backdrop-filter: blur(16px);
}

.project-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(620px, 70vw);
}

.project-switcher select {
  max-width: 270px;
  min-width: 170px;
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-weight: 750;
}

.switcher-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #aab3c2;
}

.switcher-status.active {
  background: #2bb673;
  box-shadow: 0 0 0 4px rgba(43, 182, 115, 0.13);
}

.switcher-domain {
  overflow: hidden;
  padding-left: 8px;
  border-left: 1px solid #d5dbe6;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions button {
  min-height: 38px;
}

.create-project-card {
  margin: 0 0 18px;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(27, 36, 54, 0.04);
}

.create-project-card.collapsed {
  display: none;
}

.project-detail {
  padding: 0;
  border: 0;
  background: transparent;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 2px 4px;
}

.page-heading h1 {
  margin: 3px 0 4px;
  font-size: 28px;
  letter-spacing: -0.8px;
}

.page-heading p {
  margin: 0;
  font-size: 13px;
}

.page-kicker {
  color: var(--brand);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-head {
  align-items: center;
  margin-bottom: 16px;
  padding: 17px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(27, 36, 54, 0.04);
}

.detail-head h2 {
  font-size: 20px;
}

.detail-head > div:first-child {
  min-width: 180px;
}

.mini-metrics {
  flex: 1;
}

.mini-metrics article {
  padding: 11px 12px;
  border-color: #edf0f5;
  background: #fafbfe;
}

.mini-metrics strong {
  font-size: 18px;
}

.install-panel,
.panel,
.suggestion-card,
.form-card {
  border-color: transparent;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(27, 36, 54, 0.04);
}

.install-panel {
  margin-bottom: 16px;
}

.suggestions-list,
.grid.lower {
  gap: 16px;
}

.suggestion-card {
  position: relative;
  overflow: hidden;
}

.suggestion-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(#5757e8, #8b62ee);
}

.suggestions-panel {
  margin-bottom: 16px;
}

.suggestions-head {
  align-items: center;
}

.suggestion-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.suggestion-filters button {
  min-width: max-content;
  padding: 8px 11px;
  color: #667188;
  background: #f0f3f8;
  font-size: 12px;
  font-weight: 750;
}

.suggestion-filters button:hover,
.suggestion-filters button.active {
  color: #fff;
  background: var(--brand);
}

.suggestions-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.suggestions-table-wrap {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.suggestions-table {
  table-layout: fixed;
}

.suggestions-table th:first-child {
  width: 47%;
}

.suggestions-table th:nth-child(2) {
  width: 15%;
}

.suggestions-table th:nth-child(3),
.suggestions-table th:nth-child(4) {
  width: 13%;
}

.suggestions-table th:nth-child(5) {
  width: 12%;
}

.suggestions-table #suggestionsList {
  display: table-row-group;
}

.suggestions-table th {
  padding: 11px 12px;
  color: #8b95a7;
  background: #f7f9fc;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.suggestions-table td {
  padding: 13px 12px;
  vertical-align: middle;
}

.suggestions-table tbody tr {
  cursor: pointer;
  transition: background 0.16s ease;
}

.suggestions-table tbody tr:hover,
.suggestions-table tbody tr.active {
  background: #f2f3ff;
}

.suggestions-table td:first-child {
  min-width: 0;
}

.suggestions-table td strong,
.suggestions-table td small {
  display: block;
}

.suggestions-table td small {
  max-width: 520px;
  margin-top: 5px;
  line-height: 1.4;
}

.suggestions-table td {
  overflow-wrap: anywhere;
}

.category-pill,
.impact-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.category-pill {
  color: #5543b7;
  background: #eeeafe;
}

.impact-pill {
  color: #695d43;
  background: #f3efe5;
}

.impact-pill.mare {
  color: #a13d31;
  background: #fde9e5;
}

.impact-pill.medie {
  color: #80611c;
  background: #fff3cc;
}

.impact-pill.mica {
  color: #276d50;
  background: #e2f5eb;
}

.suggestion-preview {
  position: sticky;
  top: 82px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
}

.suggestion-preview-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 360px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.suggestion-preview-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.suggestion-preview-head span {
  color: var(--brand);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.suggestion-preview-head strong {
  display: block;
  margin-top: 6px;
}

.suggestion-preview-head p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.suggestion-visual {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 440px;
  min-height: 300px;
  background: #e9edf4;
}

.suggestion-canvas {
  position: relative;
  min-height: 360px;
}

.suggestion-canvas img {
  display: block;
  width: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: top center;
  background: linear-gradient(110deg, #e5eaf2 30%, #f4f6fa 50%, #e5eaf2 70%);
}

.suggestion-highlight {
  position: absolute;
  z-index: 3;
  border: 3px solid #f04455;
  border-radius: 8px;
  background: rgba(240, 68, 85, 0.12);
  box-shadow: 0 0 0 9999px rgba(28, 35, 49, 0.18), 0 7px 24px rgba(38, 44, 62, 0.24);
}

.suggestion-highlight b {
  position: absolute;
  left: -3px;
  bottom: calc(100% + 6px);
  padding: 5px 7px;
  border-radius: 6px;
  color: #fff;
  background: #f04455;
  font-size: 10px;
  white-space: nowrap;
}

.suggestion-visual-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 7px 9px;
  border-radius: 8px;
  color: #fff;
  background: rgba(31, 38, 53, 0.82);
  font-size: 11px;
  font-weight: 750;
}

.conversion-panel {
  min-height: 560px;
}

.conversion-head {
  align-items: flex-start;
}

.period-filters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 3px;
  border-radius: 10px;
  background: #f0f3f8;
}

.period-filters button {
  min-width: max-content;
  padding: 8px 11px;
  color: #68748a;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.period-filters button:hover,
.period-filters button.active {
  color: #fff;
  background: var(--brand);
}

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

.metric-chart-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.metric-chart-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 18px 18px 4px;
}

.metric-chart-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.metric-chart-card header span,
.metric-chart-card footer span,
.metric-chart-card footer small {
  color: var(--muted);
  font-size: 11px;
}

.metric-chart-card header > strong {
  font-size: 25px;
}

.conversion-chart {
  display: grid;
  place-items: center;
  min-height: 380px;
  padding: 10px 14px 4px;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.conversion-chart svg {
  display: block;
  width: 100%;
  min-width: 0;
}

.chart-bands rect {
  fill: #f0f3f8;
}

.chart-grid line {
  stroke: #dce2ec;
  stroke-width: 1;
}

.chart-grid text,
.chart-labels text {
  fill: #7c879b;
  font-size: 8px;
}

.chart-line {
  fill: none;
  stroke: #8057f5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.chart-dots circle {
  fill: #8057f5;
  stroke: #fff;
  stroke-width: 1.5;
}

.chart-empty {
  color: var(--muted);
  text-align: center;
}

.metric-chart-card footer {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}

.metric-chart-card footer i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8057f5;
}

.metric-chart-card footer strong {
  font-size: 12px;
}

.metric-chart-card footer small {
  margin-left: auto;
}

.panel {
  padding: 20px;
}

.status-badge {
  padding: 4px 7px;
  font-size: 10px;
}

.icon-text-button {
  color: #424b60;
  background: #edf1f7;
}

.icon-text-button:hover,
button.ghost:hover {
  color: #30394c;
  background: #e2e7f0;
}

@media (max-width: 1180px) {
  .detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-metrics {
    width: 100%;
  }

  .suggestions-workspace {
    grid-template-columns: 1fr;
  }

  .suggestion-preview {
    position: static;
  }
}

@media (max-width: 720px) {
  .suggestions-table-wrap {
    overflow-x: auto;
  }

  .suggestions-table {
    min-width: 760px;
    table-layout: auto;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .module-nav {
    display: flex;
    overflow-x: auto;
  }

  .module-nav button {
    min-width: max-content;
  }

  .sidebar-section,
  .snippet {
    display: none;
  }

  .app {
    margin-left: 0;
    padding: 0 14px 28px;
  }

  .topbar {
    margin: 0 -14px 16px;
    padding: 10px 14px;
  }

  .project-switcher {
    max-width: 100%;
    width: 100%;
  }

  .project-switcher select {
    flex: 1;
    min-width: 0;
  }

  .switcher-domain {
    display: none;
  }

  .mini-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .conversion-head {
    display: grid;
  }

  .conversion-charts {
    grid-template-columns: 1fr;
  }
}
