    /* ── Goals Page ── */
    .goals-page { max-width: 1200px; margin: 0 auto; padding: 40px 24px 60px; }
    .goals-header { text-align: center; margin-bottom: 32px; }
    .goals-header h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 800; margin-bottom: 8px;
      background: linear-gradient(135deg, #fff 0%, #ccc 100%);
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
    .goals-header p { color: var(--text-dim); font-size: 15px; }

    .goals-create-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 32px; }
    .goals-create-form h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
    .goals-form-row { display: flex; gap: 12px; margin-bottom: 12px; }
    .goals-form-row input, .goals-form-row textarea {
      flex: 1; padding: 10px 16px; background: var(--bg); border: 1px solid var(--border);
      border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
      transition: border-color .2s; font-family: inherit;
    }
    .goals-form-row input:focus, .goals-form-row textarea:focus { border-color: var(--orange); }
    .goals-form-row textarea { min-height: 60px; resize: vertical; }
    .goals-form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
    .goals-form-actions .btn-primary { padding: 10px 24px; font-size: 14px; border-radius: 10px; }
    .goals-preset-label { color: var(--text-dim); font-size: 13px; margin-left: 8px; }
    .goals-preset-btn {
      padding: 6px 14px; background: rgba(244,114,43,.08); border: 1px solid rgba(244,114,43,.2);
      color: var(--orange); border-radius: 8px; font-size: 12px; cursor: pointer; transition: all .2s;
    }
    .goals-preset-btn:hover { background: rgba(244,114,43,.18); border-color: var(--orange); }

    .goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
    .goal-card {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
      padding: 24px; cursor: pointer; transition: all .25s; display: flex; flex-direction: column;
    }
    .goal-card:hover { border-color: rgba(244,114,43,.3); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
    .goal-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
    .goal-card-title { font-size: 16px; font-weight: 600; flex: 1; margin-right: 12px; }
    .goal-status {
      padding: 4px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap;
    }
    .goal-status.pending { background: rgba(138,138,148,.15); color: var(--text-dim); }
    .goal-status.decomposing { background: rgba(59,130,246,.15); color: var(--blue); }
    .goal-status.matched { background: rgba(251,191,36,.15); color: var(--gold); }
    .goal-status.in_progress { background: rgba(244,114,43,.15); color: var(--orange); }
    .goal-status.completed { background: rgba(16,185,129,.15); color: var(--green); }
    .goal-status.failed { background: rgba(239,68,68,.15); color: #EF4444; }
    .goal-card-desc { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin-bottom: 12px; flex: 1; }
    .goal-card-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); }
    .goal-card-meta span { display: flex; align-items: center; gap: 4px; }
    .goal-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-top: 12px; overflow: hidden; }
    .goal-progress-fill { height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); border-radius: 2px; transition: width .5s; }

    /* Goal Detail Page */
    .goal-detail { max-width: 1000px; margin: 0 auto; padding: 40px 24px 60px; }
    .goal-detail-back { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; display: inline-block; }
    .goal-detail-back:hover { color: var(--orange); opacity: 1; }
    .goal-detail-header { margin-bottom: 32px; }
    .goal-detail-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
    .goal-detail-header p { color: var(--text-dim); font-size: 14px; line-height: 1.6; }
    .goal-detail-stats { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
    .goal-detail-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 20px; text-align: center; }
    .goal-detail-stat .val { font-size: 22px; font-weight: 700; color: var(--orange); }
    .goal-detail-stat .lbl { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-top: 2px; }

    /* Sub-goal flow */
    .subgoal-flow { display: flex; gap: 0; overflow-x: auto; padding: 24px 0; margin-bottom: 32px; align-items: stretch; }
    .subgoal-node {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
      padding: 20px; min-width: 260px; max-width: 300px; flex-shrink: 0;
      display: flex; flex-direction: column; transition: all .25s;
    }
    .subgoal-node:hover { border-color: rgba(244,114,43,.3); }
    .subgoal-node.completed { border-color: var(--green); }
    .subgoal-node.in_progress { border-color: var(--orange); }
    .subgoal-node-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
    .subgoal-node-num { width: 28px; height: 28px; border-radius: 50%; background: rgba(244,114,43,.15); color: var(--orange);
      display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
    .subgoal-node.completed .subgoal-node-num { background: rgba(16,185,129,.15); color: var(--green); }
    .subgoal-node-title { font-size: 14px; font-weight: 600; }
    .subgoal-node-domain { font-size: 11px; color: var(--text-dim); background: var(--bg); padding: 2px 8px; border-radius: 4px; margin-bottom: 8px; }
    .subgoal-node-skills { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
    .subgoal-node-skills .tag { font-size: 11px; padding: 2px 8px; }
    .subgoal-agent { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-radius: 8px; margin-top: auto; }
    .subgoal-agent-icon { font-size: 20px; }
    .subgoal-agent-info { flex: 1; }
    .subgoal-agent-name { font-size: 13px; font-weight: 600; }
    .subgoal-agent-score { font-size: 11px; color: var(--green); }
    .subgoal-agent-score .score-bar { display: inline-block; width: 60px; height: 4px; background: var(--border); border-radius: 2px; vertical-align: middle; margin-left: 4px; }
    .subgoal-agent-score .score-fill { display: block; height: 100%; background: var(--green); border-radius: 2px; }

    .flow-arrow { display: flex; align-items: center; padding: 0 8px; flex-shrink: 0; color: var(--text-dim); font-size: 24px; }

    /* Execution panel */
    .exec-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-top: 24px; }
    .exec-panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
    .exec-list { display: flex; flex-direction: column; gap: 12px; }
    .exec-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bg); border-radius: 10px; }
    .exec-item-status { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
    .exec-item-status.pending { background: rgba(138,138,148,.15); }
    .exec-item-status.matched { background: rgba(251,191,36,.15); }
    .exec-item-status.in_progress { background: rgba(244,114,43,.15); }
    .exec-item-status.completed { background: rgba(16,185,129,.15); }
    .exec-item-status.failed { background: rgba(239,68,68,.15); }
    .exec-item-title { flex: 1; font-size: 14px; }
    .exec-item-agent { font-size: 12px; color: var(--text-dim); }


