/* ═══════════════════════════════════════════════════════
   App-Workflow — Premium Dark Theme v5
   Design system: Linear-inspired sidebar + glass surfaces
   ═══════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg: #0b0d11;
  --bg2: #0f1117;
  --bg3: #151720;
  --surface: rgba(21, 23, 32, 0.80);
  --surface-hover: rgba(26, 29, 42, 0.90);
  --border: rgba(255,255,255,0.05);
  --border2: rgba(255,255,255,0.08);
  --border3: rgba(255,255,255,0.14);

  /* Text */
  --text: #edf0f7;
  --text2: #8b92a5;
  --text3: #5c6378;
  --text4: #3d4255;

  /* Accents */
  --blue: #4f7df9;
  --blue-light: #6b93ff;
  --blue-dim: rgba(79,125,249,0.10);
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.10);
  --yellow: #f5a623;
  --yellow-dim: rgba(245,166,35,0.10);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.10);
  --purple: #8b6cef;
  --purple-dim: rgba(139,108,239,0.10);
  --cyan: #0ec4cb;
  --cyan-dim: rgba(14,196,203,0.10);

  /* Gradients */
  --gradient1: linear-gradient(135deg, #4f7df9 0%, #8b6cef 100%);
  --gradient2: linear-gradient(135deg, #22c55e 0%, #0ec4cb 100%);
  --gradient3: linear-gradient(135deg, #8b6cef 0%, #ec4899 100%);

  /* Radius */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);

  /* Layout */
  --sidebar-width: 256px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Monaco, Consolas, monospace;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ═══════════════════════════════════════════════════════
   Login Page
   ═══════════════════════════════════════════════════════ */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg); position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(79,125,249,0.06) 0%, transparent 60%);
  top: -200px; right: -100px; pointer-events: none;
}
.login-page::after {
  content: ''; position: absolute; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,108,239,0.05) 0%, transparent 60%);
  bottom: -100px; left: -50px; pointer-events: none;
}
.login-card {
  background: var(--surface); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border2); border-radius: 20px;
  padding: 48px; width: 400px; position: relative; z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 20px;
  background: var(--gradient1); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.5px;
  box-shadow: 0 8px 24px rgba(79,125,249,0.25);
}
.login-header h1 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.5px;
  background: var(--gradient1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-header p { font-size: 13px; color: var(--text3); margin-top: 6px; letter-spacing: 0.5px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text2);
  margin-bottom: 7px; letter-spacing: 0.3px;
}
.form-group input, .form-group select {
  width: 100%; padding: 11px 14px; background: rgba(15,17,23,0.6);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-family: var(--font-sans);
  outline: none; transition: border-color 150ms, box-shadow 150ms;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim);
}
.form-group input::placeholder { color: var(--text4); }
.form-group select { cursor: pointer; appearance: auto; }

.btn-login {
  width: 100%; padding: 12px; background: var(--gradient1); color: #fff;
  border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  font-family: var(--font-sans); cursor: pointer; transition: all 200ms; margin-top: 8px;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(79,125,249,0.3); }
.login-error { color: var(--red); font-size: 12px; text-align: center; margin-top: 12px; min-height: 18px; }

/* ═══════════════════════════════════════════════════════
   App Layout — Sidebar + Main
   ═══════════════════════════════════════════════════════ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-header { padding: 20px 20px 16px; }
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--gradient1); display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.brand-tag { font-size: 10px; color: var(--text4); letter-spacing: 0.3px; margin-top: 1px; }

.sidebar-divider {
  height: 1px; background: var(--border); margin: 8px 20px;
}

.sidebar-section { padding: 8px 12px; }

.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-xs);
  color: var(--text2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 120ms; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font-sans);
}
.sidebar-link svg { flex-shrink: 0; opacity: 0.6; }
.sidebar-link:hover {
  background: rgba(255,255,255,0.03); color: var(--text);
}
.sidebar-link:hover svg { opacity: 0.8; }

.sidebar-label {
  font-size: 10px; font-weight: 600; color: var(--text4);
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 0 12px; margin-bottom: 4px;
}

.sidebar-pipeline-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 6px 12px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: var(--radius-xs);
  color: var(--text3); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 120ms;
  text-decoration: none; position: relative;
}
.nav-item svg { flex-shrink: 0; width: 16px; height: 16px; opacity: 0.5; }
.nav-item:hover {
  background: rgba(255,255,255,0.03); color: var(--text2);
}
.nav-item:hover svg { opacity: 0.7; }
.nav-item.active {
  background: var(--blue-dim); color: var(--blue-light);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 2px; border-radius: 2px; background: var(--blue);
}
.nav-item.active svg { opacity: 1; color: var(--blue); }

/* ── Sidebar Footer / User ── */
.sidebar-footer {
  margin-top: auto; padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: var(--blue);
}
.user-details { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 10px; color: var(--text4); }

.btn-icon-sm {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: none; border: none; color: var(--text4);
  cursor: pointer; transition: all 120ms;
}
.btn-icon-sm:hover { background: rgba(255,255,255,0.05); color: var(--text2); }

/* ═══════════════════════════════════════════════════════
   Main Content Area
   ═══════════════════════════════════════════════════════ */
.main-area {
  background: var(--bg2);
  padding: 32px;
  min-height: 100vh;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════
   Stat Cards
   ═══════════════════════════════════════════════════════ */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--surface); backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: all 200ms; position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.stat-card:hover {
  border-color: var(--border3); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04);
}
.stat-card .label {
  font-size: 11px; color: var(--text3); margin-bottom: 8px;
  letter-spacing: 0.6px; text-transform: uppercase; font-weight: 600;
}
.stat-card .value {
  font-size: 28px; font-weight: 800; letter-spacing: -0.8px; line-height: 1;
}
.stat-card .sub { font-size: 11px; color: var(--text3); margin-top: 6px; }
.stat-card .icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; position: absolute; top: 18px; right: 18px;
}

/* ── Progress Bar ── */
.progress-bar {
  height: 5px; background: rgba(255,255,255,0.04); border-radius: 3px;
  overflow: hidden; margin-top: 10px;
}
.progress-fill {
  height: 100%; border-radius: 3px; background: var(--gradient2);
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ═══════════════════════════════════════════════════════
   Deliverable Cards
   ═══════════════════════════════════════════════════════ */
.deliverables {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-top: 20px;
}
.deliverable-card {
  background: var(--surface); backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all 200ms; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.deliverable-card:hover {
  border-color: rgba(79,125,249,0.2); transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
}
.deliverable-card .card-header {
  padding: 18px 18px 0; display: flex; align-items: flex-start; gap: 12px;
}
.deliverable-card .badge-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.deliverable-card .card-header .info { flex: 1; min-width: 0; }
.deliverable-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 3px; line-height: 1.3; }
.deliverable-card .desc { font-size: 11px; color: var(--text3); line-height: 1.5; }
.deliverable-card .card-body { padding: 0 18px 14px; }
.deliverable-card .meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text3);
}
.deliverable-card .meta-row .size {
  font-weight: 500; font-family: var(--font-mono); font-size: 10px;
}

/* ── Status Tags ── */
.status-tag {
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.2px; display: inline-flex; align-items: center; gap: 4px;
}
.status-tag.done { background: var(--green-dim); color: var(--green); }
.status-tag.pending { background: rgba(255,255,255,0.03); color: var(--text4); }
.status-tag.running { background: var(--blue-dim); color: var(--blue); animation: pulse 2s infinite; }
.status-tag.warn { background: var(--yellow-dim); color: var(--yellow); }

/* ── Preview Thumbs ── */
.preview-thumbs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.preview-thumbs a.thumb {
  display: block; width: 56px; height: 56px;
  border-radius: var(--radius-xs); border: 1px solid var(--border);
  overflow: hidden; transition: all 150ms; flex-shrink: 0;
}
.preview-thumbs a.thumb:hover { border-color: var(--blue); transform: scale(1.08); }
.preview-thumbs a.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════════════════════════════════════
   Flow Diagram
   ═══════════════════════════════════════════════════════ */
.flow-section {
  background: var(--surface); backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.flow-section h2 {
  font-size: 14px; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.2px;
}
.flow-svg { width: 100%; max-width: 720px; }
.node-rect { rx: 10; ry: 10; cursor: pointer; transition: all 200ms; }
.node-rect:hover { filter: brightness(1.2) drop-shadow(0 0 10px rgba(79,125,249,0.2)); }
.node-rect.done { fill: rgba(34,197,94,0.06); stroke: var(--green); stroke-width: 1.5; }
.node-rect.running { fill: rgba(79,125,249,0.06); stroke: var(--blue); stroke-width: 2; animation: pulse 2s infinite; }
.node-rect.warn { fill: rgba(245,166,35,0.06); stroke: var(--yellow); stroke-width: 1.5; }
.node-rect.pending { fill: rgba(21,23,32,0.3); stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.edge-line {
  stroke: rgba(255,255,255,0.06); stroke-width: 1.5; fill: none;
  stroke-dasharray: 6 4; animation: edgeFlow 1.5s linear infinite;
}

/* ═══════════════════════════════════════════════════════
   Stage Table
   ═══════════════════════════════════════════════════════ */
.stage-table { display: flex; flex-direction: column; }
.stage-table-header, .stage-table-row {
  display: grid;
  grid-template-columns: 32px 1.2fr 96px 72px 1fr 1fr;
  align-items: center; gap: 10px; padding: 10px 14px;
}
.stage-table-header {
  font-size: 10px; color: var(--text4); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.stage-table-row {
  border-bottom: 1px solid var(--border); transition: background 120ms;
}
.stage-table-row:last-child { border-bottom: none; }
.stage-table-row:hover { background: rgba(255,255,255,0.015); }
.stage-table-row .stg-icon { font-size: 14px; text-align: center; }
.stage-table-row .stg-name { font-size: 13px; font-weight: 600; }
.stage-table-row .stg-duration { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.stage-table-row .stg-executor { font-size: 11px; color: var(--text3); }
.stage-table-row.done .stg-name { color: var(--text); }
.stage-table-row.pending .stg-name { color: var(--text3); }
.stage-table-row.warn .stg-name { color: var(--yellow); }

/* ═══════════════════════════════════════════════════════
   Artifact Links
   ═══════════════════════════════════════════════════════ */
.card-file-list { padding: 8px 18px 4px; display: flex; flex-wrap: wrap; gap: 5px; }
.artifact-link {
  font-size: 10px; color: var(--blue-light); background: var(--blue-dim);
  padding: 2px 8px; border-radius: 10px; text-decoration: none;
  transition: all 120ms; display: inline-flex; align-items: center; gap: 3px;
}
a.artifact-link:hover { background: rgba(79,125,249,0.2); color: #93b5f7; text-decoration: none; }
span.artifact-link { color: var(--text4); background: rgba(255,255,255,0.02); }

/* ═══════════════════════════════════════════════════════
   Section Title
   ═══════════════════════════════════════════════════════ */
.section-title {
  font-size: 14px; font-weight: 700; margin: 24px 0 14px;
  display: flex; align-items: center; gap: 8px; letter-spacing: -0.2px;
}
.section-title .dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
}

/* ═══════════════════════════════════════════════════════
   Score Compare (Side-by-side)
   ═══════════════════════════════════════════════════════ */
.score-card {
  background: var(--surface); backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.score-card h2 {
  font-size: 14px; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.score-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.score-row .name { font-size: 12px; color: var(--text2); min-width: 56px; font-weight: 500; }
.score-row .bar { flex: 1; height: 6px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; }
.score-row .bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.score-row .val { font-size: 16px; font-weight: 800; min-width: 32px; text-align: right; }

.score-compare { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.score-compare-col {
  background: rgba(15,17,23,0.4); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px; transition: all 150ms;
}
.score-compare-col:hover { border-color: var(--border2); }
.score-best { border-color: rgba(34,197,94,0.2); box-shadow: inset 0 0 0 1px rgba(34,197,94,0.08); }
.score-model-header { padding-bottom: 14px; margin-bottom: 14px; }
.score-model-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  font-size: 12px; font-weight: 800;
}
.score-winner {
  background: var(--green-dim); color: var(--green);
  padding: 2px 7px; border-radius: 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px; margin-left: 6px;
}
.score-comment {
  font-size: 11px; color: var(--text3); line-height: 1.7;
  margin-top: 14px; padding: 10px 14px;
  background: rgba(255,255,255,0.02); border-radius: var(--radius-xs);
  border-left: 2px solid var(--border3);
}

/* ═══════════════════════════════════════════════════════
   Code List
   ═══════════════════════════════════════════════════════ */
.code-list {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.code-list a.code-row { text-decoration: none; color: inherit; display: block; }
.code-list .code-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background 120ms;
}
.code-list .code-row:last-child { border-bottom: none; }
.code-list .code-row:hover { background: rgba(255,255,255,0.015); }
.code-list .code-row .name { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.code-list .code-row .name .ext {
  font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 3px;
  background: var(--blue-dim); color: var(--blue-light); font-family: var(--font-mono);
}
.code-list .code-row .size { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════
   Preview Grid
   ═══════════════════════════════════════════════════════ */
.preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; margin-top: 14px;
}
.preview-grid a { display: block; }
.preview-grid a:hover .preview-img { border-color: var(--blue); }
.preview-img {
  width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border);
  cursor: pointer; transition: all 150ms; aspect-ratio: 9/16; object-fit: cover;
}
.preview-img:hover { transform: scale(1.02); }

/* ═══════════════════════════════════════════════════════
   Pipeline List
   ═══════════════════════════════════════════════════════ */
.pipeline-list { display: grid; gap: 8px; }
.pipeline-row {
  background: var(--surface); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; cursor: pointer; transition: all 150ms;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.pipeline-row:hover {
  border-color: rgba(79,125,249,0.2); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04);
}
.pipeline-row .info .name { font-size: 14px; font-weight: 700; }
.pipeline-row .info .meta {
  font-size: 11px; color: var(--text3); margin-top: 3px; font-family: var(--font-mono);
}
.pipeline-row .actions-col { display: flex; align-items: center; gap: 8px; }
.pipeline-row .btn-delete {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; border: none;
  background: none; color: var(--text4); cursor: pointer; transition: all 120ms;
}
.pipeline-row .btn-delete:hover { background: var(--red-dim); color: var(--red); }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.15; }
.empty-state p { color: var(--text3); font-size: 14px; }
.empty-state button { margin-top: 20px; }

/* ═══════════════════════════════════════════════════════
   Market Analysis Page
   ═══════════════════════════════════════════════════════ */
.market-hero {
  background: var(--surface); backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.market-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(14,196,203,0.05) 0%, rgba(79,125,249,0.03) 40%, rgba(139,108,239,0.04) 100%);
  pointer-events: none;
}
.market-hero-content {
  position: relative; z-index: 1;
  display: flex; gap: 24px; align-items: center; padding: 32px 28px;
}
.market-app-icon {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 16px;
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border: 1px solid var(--border2);
}
.market-hero-info { flex: 1; min-width: 0; }
.market-app-name {
  font-size: 22px; font-weight: 800; letter-spacing: -0.4px;
  margin-bottom: 6px; line-height: 1.2;
}
.market-meta-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; margin-bottom: 6px; }
.market-badge {
  background: var(--cyan-dim); color: var(--cyan);
  padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600;
}
.market-dot { color: var(--text4); }
.market-intro { font-size: 12px; color: var(--text2); line-height: 1.6; margin-top: 3px; }

.market-desc-card {
  background: rgba(15,17,23,0.5); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px 22px;
}
.market-screenshot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.market-screenshot-item {
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  overflow: hidden; cursor: pointer; transition: all 150ms; aspect-ratio: 9/16;
}
.market-screenshot-item:hover {
  border-color: var(--blue); transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.market-screenshot-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.market-screenshot-item a { display: block; width: 100%; height: 100%; }

.market-meta-table {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0;
}
.meta-row-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background 120ms;
}
.meta-row-item:hover { background: rgba(255,255,255,0.015); }
.meta-row-item .meta-key { font-size: 11px; color: var(--text3); font-weight: 500; min-width: 72px; }
.meta-row-item .meta-val {
  font-size: 12px; color: var(--text); font-weight: 500;
  text-align: right; word-break: break-all; max-width: 70%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--gradient1); color: #fff; border: none;
  padding: 9px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; transition: all 150ms;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,125,249,0.25); }
.btn-ghost {
  background: none; border: 1px solid var(--border2); color: var(--text2);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; font-family: var(--font-sans);
  cursor: pointer; transition: all 120ms;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border3); background: rgba(255,255,255,0.02); }
.btn-ghost-sm {
  background: none; border: 1px solid var(--border); color: var(--text3);
  padding: 5px 10px; border-radius: var(--radius-xs);
  font-size: 11px; font-weight: 500; font-family: var(--font-sans);
  cursor: pointer; transition: all 120ms; white-space: nowrap;
}
.btn-ghost-sm:hover { color: var(--text2); border-color: var(--border2); }
.btn-text {
  background: none; border: none; color: var(--blue);
  padding: 6px 0; font-size: 12px; font-weight: 500; font-family: var(--font-sans);
  cursor: pointer; transition: color 120ms;
}
.btn-text:hover { color: var(--blue-light); }
.btn-danger {
  background: var(--red); color: #fff; border: none;
  padding: 9px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; transition: all 150ms;
}
.btn-danger:hover { box-shadow: 0 4px 16px rgba(239,68,68,0.3); transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════
   Modal
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.60); backdrop-filter: blur(4px);
}
.modal-card {
  position: relative; z-index: 1;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 20px; width: 480px; max-width: 90vw;
  box-shadow: 0 32px 64px rgba(0,0,0,0.5);
  animation: modalIn 200ms ease-out;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 28px 0;
}
.modal-header h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.modal-body { padding: 20px 28px; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 16px 28px 24px;
}
.modal-error { color: var(--red); font-size: 11px; text-align: center; padding: 0 28px 16px; min-height: 16px; }

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }

.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); }

.url-row { margin-bottom: 12px; }

/* ── Store Shortcuts ── */
.store-shortcuts {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.store-label {
  font-size: 11px; color: var(--text3); font-weight: 500; margin-right: 2px;
}
.store-tag {
  padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border2);
  background: rgba(255,255,255,0.02); color: var(--text2);
  font-size: 11px; font-weight: 500; cursor: pointer;
  transition: all 120ms; font-family: var(--font-sans);
}
.store-tag:hover {
  background: var(--blue-dim); border-color: rgba(79,125,249,0.2); color: var(--blue-light);
}
.store-tag.active {
  background: var(--blue-dim); border-color: var(--blue); color: var(--blue-light);
  box-shadow: 0 0 0 1px rgba(79,125,249,0.15);
}

/* ═══════════════════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════════════════ */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes edgeFlow {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}
@keyframes nodeGlow {
  0%,100% { filter: drop-shadow(0 0 3px rgba(34,197,94,0.15)); }
  50% { filter: drop-shadow(0 0 10px rgba(34,197,94,0.3)); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.anim-card {
  animation: fadeInUp 0.4s ease-out both;
  animation-delay: calc(var(--delay, 0) * 60ms);
}
.anim-stagger > .deliverable-card,
.anim-stagger > .stat-card {
  animation: fadeInUp 0.35s ease-out both;
}
.anim-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.anim-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.anim-stagger > *:nth-child(3) { animation-delay: 0.12s; }
.anim-stagger > *:nth-child(4) { animation-delay: 0.16s; }
.anim-stagger > *:nth-child(5) { animation-delay: 0.20s; }
.anim-stagger > *:nth-child(6) { animation-delay: 0.24s; }

.flow-node-done { animation: nodeGlow 3s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .deliverables { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .deliverables { grid-template-columns: 1fr; }
  .main-area { padding: 16px; }
  .score-compare { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .score-compare { grid-template-columns: 1fr; }
  .market-hero-content { flex-direction: column; text-align: center; }
  .market-meta-line { justify-content: center; }
}
