/**
 * MeowHub Shared Styles
 * Used by trial.php (sidebar + overlay) and admin/miaohub.php (standalone page)
 */

/* ===== Sidebar quick-access (trial.php right panel) ===== */
.mh-section {
    padding: 14px 12px 8px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.mh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.mh-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.mh-header-left .mh-logo { font-size: 16px; }
.mh-header-left .mh-beta {
    font-size: 9px;
    background: var(--accent);
    color: #fff;
    padding: 1px 5px;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.3px;
}
.mh-search-btn {
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s;
}
.mh-search-btn:hover { background: var(--border); }
.mh-explore-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
}
.mh-explore-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Tabs & Sort */
.mh-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.mh-tabs::-webkit-scrollbar { display: none; }
.mh-tab {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text2);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}
.mh-tab:hover { border-color: var(--accent); color: var(--text); }
.mh-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mh-sort-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 11px;
}
.mh-sort-item {
    color: var(--text2);
    cursor: pointer;
    padding: 2px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.mh-sort-item:hover { color: var(--text); }
.mh-sort-item.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Skill cards grid (sidebar 2-col) */
.mh-skills-scroll {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-bottom: 10px;
}
.mh-skill-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 10px 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}
.mh-skill-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(139,92,246,0.12);
    transform: translateY(-2px);
}
.mh-skill-card .mh-card-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    --icon-color: var(--accent);
    --icon-bg: rgba(108,92,231,0.12);
    background: var(--icon-bg);
    color: var(--icon-color);
}
.mh-skill-card[data-cat="system"] .mh-card-icon        { --icon-bg: rgba(99,102,241,0.14);  --icon-color: #818cf8; }
.mh-skill-card[data-cat="social"] .mh-card-icon        { --icon-bg: rgba(34,197,94,0.12);   --icon-color: #4ade80; }
.mh-skill-card[data-cat="entertainment"] .mh-card-icon { --icon-bg: rgba(236,72,153,0.12);  --icon-color: #f472b6; }
.mh-skill-card[data-cat="daily"] .mh-card-icon         { --icon-bg: rgba(251,191,36,0.12);  --icon-color: #fbbf24; }
.mh-skill-card[data-cat="tools"] .mh-card-icon         { --icon-bg: rgba(59,130,246,0.12);  --icon-color: #60a5fa; }
.mh-skill-card[data-cat="shopping"] .mh-card-icon      { --icon-bg: rgba(249,115,22,0.12);  --icon-color: #fb923c; }
.mh-skill-card[data-cat="productivity"] .mh-card-icon  { --icon-bg: rgba(168,85,247,0.12);  --icon-color: #c084fc; }
.mh-skill-card .mh-card-name {
    font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-all;
}
.mh-card-meta-line {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; font-size: 9px; color: var(--text2);
}
.mh-card-meta-line span { display: flex; align-items: center; gap: 2px; }
.mh-card-meta-line .mh-meta-sep {
    width: 2px; height: 2px; border-radius: 50%;
    background: var(--text2); opacity: 0.5;
}

/* Search bar */
.mh-search-bar { padding: 0 0 8px; }
.mh-search-bar input {
    width: 100%; padding: 7px 10px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--card); color: var(--text);
    font-size: 12px; outline: none; box-sizing: border-box;
}
.mh-search-bar input:focus { border-color: var(--accent); }
.mh-empty { text-align: center; padding: 24px 12px; color: var(--text2); font-size: 12px; }
.mh-clickable { cursor: pointer; }
.mh-clickable:hover { color: var(--accent); }

/* ===== Skill detail overlay (shared) ===== */
.mh-detail-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.mh-detail-overlay.show { opacity: 1; pointer-events: all; }
.mh-detail-panel {
    position: relative; background: var(--bg);
    border: 1px solid var(--border); border-radius: 16px; padding: 0;
    width: 360px; max-width: 92vw; max-height: 80vh;
    overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    scrollbar-width: none; -ms-overflow-style: none;
}
.mh-detail-panel::-webkit-scrollbar { display: none; }
.mh-detail-header { display: flex; align-items: center; gap: 12px; padding: 20px 20px 12px; }
.mh-detail-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(108,92,231,0.12); color: var(--accent); flex-shrink: 0;
}
.mh-detail-title { flex: 1; min-width: 0; }
.mh-detail-title h3 { margin: 0; font-size: 16px; color: var(--text); font-weight: 700; }
.mh-detail-title .mh-detail-sub {
    display: flex; align-items: center; gap: 6px;
    margin-top: 4px; font-size: 11px; color: var(--text2);
}
.mh-detail-title .mh-detail-sub .mh-cat-badge {
    padding: 1px 7px; border-radius: 8px;
    background: rgba(108,92,231,0.10); color: var(--accent);
    font-size: 10px; font-weight: 500;
}
.mh-detail-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; color: var(--text2);
    cursor: pointer; padding: 4px; border-radius: 6px;
}
.mh-detail-close:hover { background: var(--border); color: var(--text); }
.mh-detail-desc { padding: 0 20px 12px; font-size: 12px; color: var(--text2); line-height: 1.5; }
.mh-detail-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1px; background: var(--border); margin: 0 20px; border-radius: 10px; overflow: hidden;
}
.mh-detail-stat { background: var(--card); padding: 10px 4px; text-align: center; }
.mh-detail-stat .stat-val { font-size: 14px; font-weight: 700; color: var(--text); }
.mh-detail-stat .stat-label { font-size: 9px; color: var(--text2); margin-top: 2px; }
.mh-detail-steps-title {
    padding: 14px 20px 6px; font-size: 12px; font-weight: 600;
    color: var(--text); display: flex; align-items: center; gap: 4px;
}
.mh-detail-steps { padding: 0 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.mh-detail-step {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; padding: 5px 8px; border-radius: 8px;
    background: var(--card); color: var(--text2);
}
.mh-detail-step .step-type-icon {
    width: 18px; height: 18px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mh-detail-step .step-type-icon.ai   { background: rgba(139,92,246,0.15); color: var(--accent); }
.mh-detail-step .step-type-icon.api  { background: rgba(34,197,94,0.12);  color: #22c55e; }
.mh-detail-step .step-type-icon.wait { background: rgba(245,158,11,0.12); color: #f59e0b; }
.mh-detail-step .step-type-icon.user { background: rgba(59,130,246,0.12); color: #3b82f6; }
.mh-detail-footer { padding: 12px 20px 20px; position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--border); z-index: 1; }
.mh-detail-run-btn {
    width: 100%; padding: 10px; font-size: 13px; font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; border: none; border-radius: 10px; cursor: pointer;
    transition: opacity 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.mh-detail-run-btn:hover { opacity: 0.85; }
.mh-detail-actions {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px 14px; font-size: 11px;
}
.mh-detail-star-btn {
    display: flex; align-items: center; gap: 4px;
    background: none; border: 1px solid var(--border); border-radius: 8px;
    padding: 5px 12px; color: var(--text2); cursor: pointer; font-size: 11px;
    transition: all 0.2s;
}
.mh-detail-star-btn:hover { border-color: var(--accent); color: var(--accent); }
.mh-detail-star-btn.starred { color: #f472b6; border-color: #f472b6; }
.mh-detail-report-link {
    color: var(--text2); font-size: 10px; cursor: pointer;
    opacity: 0.6; transition: opacity 0.2s;
}
.mh-detail-report-link:hover { opacity: 1; color: #ef4444; }

/* ===== Skill execution progress ===== */
.mh-progress-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 12px; margin: 4px 0;
}
.mh-progress-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.mh-progress-title {
    font-size: 13px; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.mh-progress-controls { display: flex; gap: 4px; }
.mh-progress-controls button {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    padding: 3px 8px; font-size: 10px; cursor: pointer;
    color: var(--text2); transition: all 0.2s;
}
.mh-progress-controls button:hover { border-color: var(--accent); color: var(--accent); }
.mh-progress-stats {
    display: flex; gap: 12px; font-size: 10px; color: var(--text2); margin-bottom: 8px;
}
.mh-progress-stats span { display: flex; align-items: center; gap: 3px; }
.mh-step-list { display: flex; flex-direction: column; gap: 3px; }
.mh-step-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; padding: 3px 6px; border-radius: 6px; color: var(--text2);
}
.mh-step-item.active { background: rgba(139,92,246,0.08); color: var(--text); }
.mh-step-item.done { color: #22c55e; }
.mh-step-item.error { color: #ef4444; }
.mh-step-item.skip { color: var(--text2); opacity: 0.6; }
.mh-step-icon { width: 16px; text-align: center; flex-shrink: 0; }

/* Debug panel */
.mh-debug-panel {
    margin-top: 8px; border-top: 1px solid var(--border);
}
.mh-debug-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 600; color: #f1c40f;
    padding: 6px 4px 4px; cursor: pointer; user-select: none;
}
.mh-debug-log {
    background: #0d1117; color: #c9d1d9; border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 10px; line-height: 1.6; padding: 8px 10px;
    max-height: 300px; overflow-y: auto; white-space: pre-wrap;
    word-break: break-all; margin: 0;
}
.mh-debug-log::-webkit-scrollbar { width: 4px; }
.mh-debug-log::-webkit-scrollbar-thumb { background: #30363d; border-radius: 2px; }

/* Summary card */
.mh-summary-card {
    position: relative;
    background: linear-gradient(135deg, rgba(108,92,231,0.06) 0%, rgba(162,155,254,0.04) 100%);
    border: 1px solid rgba(108,92,231,0.25);
    border-radius: 14px; padding: 0; margin: 10px 0 2px;
    font-size: 12px; line-height: 1.7; color: var(--text);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(108,92,231,0.08);
}
.mh-summary-card .mh-summary-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: #fff;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    letter-spacing: 0.2px;
}
.mh-summary-card .mh-summary-header i,
.mh-summary-card .mh-summary-header svg { color: #fff; }
.mh-summary-body {
    padding: 14px 16px 16px;
    white-space: pre-wrap; word-break: break-word;
}
.mh-summary-body .mh-summary-line {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mh-summary-body .mh-summary-line:last-child { border-bottom: none; }
.mh-summary-body .mh-summary-line .mh-sl-num {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; margin-top: 1px;
    background: rgba(108,92,231,0.12); color: var(--accent2);
}
.mh-summary-body .mh-summary-line .mh-sl-text {
    flex: 1; font-size: 12px; line-height: 1.6; color: var(--text);
}
.mh-summary-body .mh-summary-plain {
    font-size: 12px; line-height: 1.7; color: var(--text);
}
.mh-summary-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px 10px; font-size: 10px; color: var(--text2);
    border-top: 1px solid rgba(255,255,255,0.04);
}
.mh-summary-footer .mh-sf-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 10px;
    background: rgba(34,197,94,0.1); color: #4ade80;
    font-size: 10px; font-weight: 600;
}
.mh-summary-card.error-card {
    background: linear-gradient(135deg, rgba(239,68,68,0.06) 0%, rgba(239,68,68,0.02) 100%);
    border-color: rgba(239,68,68,0.25);
    box-shadow: 0 2px 12px rgba(239,68,68,0.08);
}
.mh-summary-card.error-card .mh-summary-header {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

/* Prompt user overlay */
.mh-prompt-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.mh-prompt-overlay.show { opacity: 1; pointer-events: all; }
.mh-prompt-modal {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 16px; padding: 24px; min-width: 300px; max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.mh-prompt-modal h3 { margin: 0 0 14px; font-size: 16px; color: var(--text); }
.mh-prompt-modal .mh-prompt-field { margin-bottom: 12px; }
.mh-prompt-modal label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.mh-prompt-modal input,
.mh-prompt-modal select {
    width: 100%; padding: 8px 10px; background: var(--card);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 13px; outline: none; box-sizing: border-box;
}
.mh-prompt-modal input:focus { border-color: var(--accent); }
.mh-prompt-modal .mh-prompt-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.mh-prompt-modal .mh-prompt-actions button {
    padding: 7px 18px; border-radius: 8px; font-size: 12px; font-weight: 600;
    cursor: pointer; border: 1px solid var(--border); transition: all 0.2s;
}
.mh-prompt-modal .mh-prompt-cancel { background: var(--card); color: var(--text2); }
.mh-prompt-modal .mh-prompt-submit {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; border: none;
}

/* ===== Chat prompt card (in-chat interaction) ===== */
.mh-prompt-card {
    background: var(--card, #1a1a2e);
    border: 1.5px solid var(--accent, #8b5cf6);
    border-radius: 12px; padding: 14px 16px;
    margin: 8px 0; animation: mhPromptIn .25s ease both;
}
@keyframes mhPromptIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.mh-prompt-card.mh-prompt-done {
    border-color: var(--border, #2a2a3e); opacity: .7;
}
.mh-prompt-card-title {
    font-size: 13px; font-weight: 600;
    color: var(--text, #e0e0e8); margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}
.mh-prompt-card-title::before {
    content: ''; display: inline-block;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent, #8b5cf6);
    animation: mhPulse 1.5s ease-in-out infinite;
}
.mh-prompt-done .mh-prompt-card-title::before { animation: none; background: var(--border); }
@keyframes mhPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(.8); }
}
.mh-prompt-card-hint {
    font-size: 11px; color: var(--text2, #8888a0);
    padding: 6px 0 2px;
}
.mh-prompt-card-field {
    margin-bottom: 8px;
}
.mh-prompt-card-field label {
    display: block; font-size: 11px; color: var(--text2);
    margin-bottom: 3px;
}
.mh-prompt-card-field input,
.mh-prompt-card-field select {
    width: 100%; padding: 7px 10px;
    background: var(--bg, #0a0a1a); border: 1px solid var(--border, #2a2a3e);
    border-radius: 8px; color: var(--text); font-size: 12px;
    outline: none; box-sizing: border-box;
}
.mh-prompt-card-field input:focus { border-color: var(--accent); }
.mh-prompt-card-actions {
    display: flex; justify-content: flex-end; margin-top: 10px;
}
.mh-prompt-card-submit {
    padding: 6px 18px; border-radius: 8px; border: none;
    background: linear-gradient(135deg, var(--accent, #8b5cf6), var(--accent2, #6c5ce7));
    color: #fff; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: opacity .2s;
}
.mh-prompt-card-submit:hover { opacity: .85; }
.mh-prompt-countdown {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px;
}
.mh-prompt-countdown-bar {
    flex: 1; height: 3px; border-radius: 2px;
    background: var(--accent, #8b5cf6);
    transition: width .2s linear;
}
.mh-prompt-countdown-text {
    font-size: 10px; color: var(--text2); min-width: 28px;
    text-align: right;
}
.mh-prompt-status {
    font-size: 11px; color: var(--success, #22c55e);
    margin-top: 6px;
}

/* AI ask_user question bubble */
.mh-ask-question {
    font-size: 13px; color: var(--text);
    padding: 2px 0;
}

/* ===== Full market window (overlay in trial / standalone page) ===== */
.mhub-overlay {
    position: fixed; inset: 0; z-index: 9500;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.mhub-overlay.show { opacity: 1; pointer-events: all; }

.mhub-container {
    background: var(--bg, #0a0a12);
    border-radius: 16px;
    width: 90vw; max-width: 1100px;
    height: 85vh; max-height: 800px;
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.4);
    border: 1px solid var(--border, #2a2a3e);
}
.mhub-container.page-mode {
    width: 100%; max-width: 1200px;
    height: auto; min-height: 100vh;
    border-radius: 0; box-shadow: none; border: none;
    margin: 0 auto;
}

.mhub-topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border, #2a2a3e);
    flex-shrink: 0;
}
.mhub-topbar-logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 18px; font-weight: 700; color: var(--text, #e0e0e8);
    flex-shrink: 0;
}
.mhub-topbar-logo .mhub-logo-badge {
    font-size: 9px; background: var(--accent, #6c5ce7); color: #fff;
    padding: 2px 6px; border-radius: 6px; font-weight: 500;
}
.mhub-search-box {
    flex: 1; max-width: 400px; position: relative;
}
.mhub-search-box input {
    width: 100%; padding: 8px 12px 8px 34px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 10px; color: var(--text, #e0e0e8); font-size: 13px;
    outline: none; transition: border-color 0.2s;
}
.mhub-search-box input:focus { border-color: var(--accent, #6c5ce7); }
.mhub-search-box .mhub-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text2, #8888a0); pointer-events: none;
}
.mhub-topbar-close {
    background: none; border: none; color: var(--text2, #8888a0);
    cursor: pointer; padding: 6px; border-radius: 8px; margin-left: auto;
    transition: all 0.2s;
}
.mhub-topbar-close:hover { background: var(--border, #2a2a3e); color: var(--text, #e0e0e8); }

.mhub-body { display: flex; flex: 1; overflow: hidden; }

.mhub-sidebar {
    width: 180px; flex-shrink: 0; padding: 16px 12px;
    border-right: 1px solid var(--border, #2a2a3e);
    overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.mhub-sidebar-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px; font-size: 13px;
    color: var(--text2, #8888a0); cursor: pointer; transition: all 0.2s;
}
.mhub-sidebar-item:hover { background: rgba(108,92,231,0.06); color: var(--text, #e0e0e8); }
.mhub-sidebar-item.active {
    background: rgba(108,92,231,0.12); color: var(--accent, #6c5ce7); font-weight: 600;
}
.mhub-sidebar-item .mhub-cat-count {
    margin-left: auto; font-size: 10px; color: var(--text2, #8888a0); opacity: 0.6;
}

.mhub-content {
    flex: 1; overflow-y: auto; padding: 16px 20px;
    display: flex; flex-direction: column; gap: 16px;
}
.mhub-sort-row {
    display: flex; align-items: center; justify-content: space-between;
}
.mhub-sort-tabs { display: flex; gap: 16px; }
.mhub-sort-tab {
    font-size: 12px; color: var(--text2, #8888a0); cursor: pointer;
    padding: 4px 0; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.mhub-sort-tab:hover { color: var(--text, #e0e0e8); }
.mhub-sort-tab.active { color: var(--accent, #6c5ce7); border-bottom-color: var(--accent, #6c5ce7); }
.mhub-result-count { font-size: 11px; color: var(--text2, #8888a0); }

.mhub-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.mhub-card {
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 12px; padding: 16px 14px 14px;
    cursor: pointer; transition: all 0.2s;
    display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: 10px;
}
.mhub-card:hover {
    border-color: var(--accent, #6c5ce7);
    box-shadow: 0 4px 20px rgba(139,92,246,0.12);
    transform: translateY(-2px);
}
.mhub-card .mhub-card-icon {
    width: 44px; height: 44px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    --icon-color: var(--accent, #6c5ce7);
    --icon-bg: rgba(108,92,231,0.12);
    background: var(--icon-bg); color: var(--icon-color);
}
.mhub-card[data-cat="system"] .mhub-card-icon        { --icon-bg: rgba(99,102,241,0.14);  --icon-color: #818cf8; }
.mhub-card[data-cat="social"] .mhub-card-icon        { --icon-bg: rgba(34,197,94,0.12);   --icon-color: #4ade80; }
.mhub-card[data-cat="entertainment"] .mhub-card-icon { --icon-bg: rgba(236,72,153,0.12);  --icon-color: #f472b6; }
.mhub-card[data-cat="daily"] .mhub-card-icon         { --icon-bg: rgba(251,191,36,0.12);  --icon-color: #fbbf24; }
.mhub-card[data-cat="tools"] .mhub-card-icon         { --icon-bg: rgba(59,130,246,0.12);  --icon-color: #60a5fa; }
.mhub-card[data-cat="shopping"] .mhub-card-icon      { --icon-bg: rgba(249,115,22,0.12);  --icon-color: #fb923c; }
.mhub-card[data-cat="productivity"] .mhub-card-icon  { --icon-bg: rgba(168,85,247,0.12);  --icon-color: #c084fc; }
.mhub-card .mhub-card-name {
    font-size: 13px; font-weight: 600; color: var(--text, #e0e0e8); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-all;
}
.mhub-card .mhub-card-desc {
    font-size: 11px; color: var(--text2, #8888a0); line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.mhub-card .mhub-card-meta {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; font-size: 9px; color: var(--text2, #8888a0);
}
.mhub-card .mhub-card-meta span { display: flex; align-items: center; gap: 2px; }
.mhub-card .mhub-card-meta .mhub-meta-dot {
    width: 2px; height: 2px; border-radius: 50%;
    background: var(--text2, #8888a0); opacity: 0.5;
}

.mhub-pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 0; flex-shrink: 0;
}
.mhub-page-btn {
    padding: 5px 12px; border-radius: 8px; font-size: 12px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    color: var(--text2, #8888a0); cursor: pointer; transition: all 0.2s;
}
.mhub-page-btn:hover { border-color: var(--accent, #6c5ce7); color: var(--text, #e0e0e8); }
.mhub-page-btn.active { background: var(--accent, #6c5ce7); color: #fff; border-color: var(--accent, #6c5ce7); }
.mhub-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.mhub-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; color: var(--text2, #8888a0); gap: 12px;
}
.mhub-empty-icon { opacity: 0.3; }

/* Page-mode inline search */
.mhub-inline-search {
    display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
    animation: mhubFadeUp .4s ease .1s both;
}
.mhub-inline-search .mhub-search-box { flex: 1; max-width: 480px; }
.mhub-inline-search .mhub-result-count { white-space: nowrap; }

/* Page-mode animations */
.page-mode .mhub-sidebar { animation: mhubFadeRight .5s ease .15s both; }
.page-mode .mhub-sort-row { animation: mhubFadeUp .4s ease .2s both; }
.page-mode .mhub-grid { animation: mhubFadeUp .5s ease .3s both; }

.page-mode .mhub-card {
    animation: mhubCardIn .4s ease both;
}
.page-mode .mhub-card:nth-child(1) { animation-delay: .1s; }
.page-mode .mhub-card:nth-child(2) { animation-delay: .15s; }
.page-mode .mhub-card:nth-child(3) { animation-delay: .2s; }
.page-mode .mhub-card:nth-child(4) { animation-delay: .25s; }
.page-mode .mhub-card:nth-child(5) { animation-delay: .3s; }
.page-mode .mhub-card:nth-child(6) { animation-delay: .35s; }
.page-mode .mhub-card:nth-child(n+7) { animation-delay: .4s; }

/* Overlay entrance */
.mhub-overlay.show .mhub-container {
    animation: mhubScaleIn .35s cubic-bezier(.16,1,.3,1) both;
}

@keyframes mhubFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mhubFadeRight { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes mhubCardIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes mhubScaleIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* Responsive */
@media (max-width: 768px) {
    .mhub-sidebar { display: none; }
    .mhub-container { width: 96vw; height: 92vh; }
    .mhub-grid { grid-template-columns: 1fr 1fr; }
    .mhub-inline-search { flex-direction: column; align-items: stretch; }
    .mhub-inline-search .mhub-search-box { max-width: 100%; }
}
@media (max-width: 480px) {
    .mhub-grid { grid-template-columns: 1fr; }
}

/* ===== Skill Editor ===== */
/* ===== Skill Editor v2 — Flow Chart Canvas ===== */
.mhed-container {
    position: absolute; inset: 0; z-index: 50;
    background: var(--bg, #0a0a12);
    display: flex; flex-direction: column;
    animation: mhubFadeUp .3s ease both;
}
.mhed-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-bottom: 1px solid var(--border, #2a2a3e);
    flex-shrink: 0; gap: 8px;
}
.mhed-header-left {
    display: flex; align-items: center; gap: 8px; min-width: 0;
}
.mhed-header-title {
    font-size: 13px; font-weight: 600; color: var(--text, #e0e0e8);
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mhed-header-right { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; }
.mhed-btn {
    padding: 5px 10px; border-radius: 8px; font-size: 11px; font-weight: 600;
    cursor: pointer; border: 1px solid var(--border, #2a2a3e);
    background: var(--card, #1a1a2e); color: var(--text2, #8888a0);
    transition: all .2s; display: flex; align-items: center; gap: 4px;
    white-space: nowrap;
}
.mhed-btn:hover { border-color: var(--accent, #6c5ce7); color: var(--text, #e0e0e8); }
.mhed-btn.primary {
    background: linear-gradient(135deg, var(--accent, #6c5ce7), var(--accent2, #a29bfe));
    color: #fff; border: none;
}
.mhed-btn.primary:hover { opacity: .85; }
.mhed-btn.danger { color: #ef4444; }
.mhed-btn.danger:hover { border-color: #ef4444; }

/* Canvas area (main workspace) */
.mhed-canvas-area {
    flex: 1; display: flex; overflow: hidden; position: relative;
}
.mhed-canvas-wrap {
    flex: 1; overflow: hidden; position: relative;
    background:
        radial-gradient(circle at 50% 50%, rgba(108,92,231,.03) 0%, transparent 70%),
        linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px, 24px 24px;
    cursor: default;
}
.mhed-canvas {
    transform-origin: 0 0;
    transition: transform 0.05s ease-out;
    padding: 40px 60px 80px;
    display: inline-block;
    min-width: 100%;
}

/* Zoom controls */
.mhed-zoom-ctrl {
    position: absolute; bottom: 12px; right: 12px; z-index: 10;
    display: flex; align-items: center; gap: 2px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 10px; padding: 3px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.mhed-zoom-ctrl button {
    background: none; border: none; color: var(--text2, #8888a0);
    cursor: pointer; padding: 4px; border-radius: 6px; display: flex;
    align-items: center; transition: all .15s;
}
.mhed-zoom-ctrl button:hover { color: var(--text, #e0e0e8); background: rgba(255,255,255,.05); }
.mhed-zoom-ctrl span {
    font-size: 10px; font-weight: 600; color: var(--text2, #8888a0);
    min-width: 36px; text-align: center; cursor: pointer; user-select: none;
    padding: 2px 4px; border-radius: 4px;
}
.mhed-zoom-ctrl span:hover { background: rgba(255,255,255,.05); color: var(--text); }

.mhed-canvas-hint {
    position: absolute; bottom: 12px; left: 12px; z-index: 10;
    font-size: 9px; color: var(--text2, #8888a0); opacity: .5;
    display: flex; align-items: center; gap: 4px;
    pointer-events: none;
}

/* ===== Flow Chart Canvas ===== */
.mhed-flow-canvas {
    position: relative;
    min-width: 600px; min-height: 400px;
}

/* SVG layer */
.mhed-svg-layer {
    position: absolute; top: 0; left: 0;
    pointer-events: none; z-index: 0;
    overflow: visible;
}
.mhed-svg-edge {
    transition: opacity .2s;
}

/* START / END terminals */
.mhed-flow-terminal {
    display: flex; justify-content: center;
    z-index: 2;
}
.mhed-flow-terminal-inner {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 16px; border-radius: 20px;
    font-size: 10px; font-weight: 700; letter-spacing: .5px;
    user-select: none;
}
.mhed-flow-terminal.start .mhed-flow-terminal-inner {
    background: rgba(34,197,94,.12); color: #4ade80;
    border: 1px solid rgba(34,197,94,.25);
    transition: all .2s;
}
.mhed-flow-terminal.start:hover .mhed-flow-terminal-inner {
    background: rgba(34,197,94,.2); border-color: rgba(34,197,94,.5);
    box-shadow: 0 0 10px rgba(34,197,94,.2);
}
.mhed-flow-terminal.start.running .mhed-flow-terminal-inner {
    background: rgba(34,197,94,.25); border-color: #4ade80;
    animation: mhedStartPulse 1s ease-in-out infinite alternate;
}
@keyframes mhedStartPulse {
    from { box-shadow: 0 0 4px rgba(34,197,94,.2); }
    to { box-shadow: 0 0 16px rgba(34,197,94,.5); }
}
.mhed-flow-terminal.end .mhed-flow-terminal-inner {
    background: rgba(107,114,128,.12); color: #9ca3af;
    border: 1px solid rgba(107,114,128,.25);
}

/* Flow node (step card) — absolute positioned on canvas */
.mhed-flow-node {
    width: 280px; padding: 10px 12px;
    background: var(--card, #1a1a2e);
    border: 1.5px solid var(--border, #2a2a3e);
    border-radius: 12px; cursor: pointer;
    display: flex; align-items: flex-start; gap: 10px;
    position: absolute; transition: border-color .2s, box-shadow .2s;
    user-select: none; z-index: 2;
}
.mhed-flow-node.node-dragging {
    cursor: grabbing; opacity: .85;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    z-index: 10;
    transition: none;
}
.mhed-flow-node:hover {
    border-color: color-mix(in srgb, var(--node-color, #6c5ce7) 50%, transparent);
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
    transform: translateY(-1px);
}
.mhed-flow-node.selected {
    border-color: var(--node-color, #6c5ce7);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--node-color, #6c5ce7) 15%, transparent),
                0 4px 16px rgba(0,0,0,.25);
}
.mhed-flow-node.dragging { opacity: .5; border-style: dashed; }
.mhed-flow-node.drag-over {
    border-color: var(--accent, #6c5ce7);
    box-shadow: 0 0 0 3px rgba(108,92,231,.2);
}
.mhed-flow-node.running {
    border-color: var(--accent, #6c5ce7);
    animation: mhedNodePulse 1.5s ease-in-out infinite alternate;
}
.mhed-flow-node.done { border-color: #22c55e; }
.mhed-flow-node.error { border-color: #ef4444; }
@keyframes mhedNodePulse {
    from { box-shadow: 0 0 6px rgba(108,92,231,.2); }
    to { box-shadow: 0 0 16px rgba(108,92,231,.4); }
}

/* Node icon */
.mhed-flow-node-icon {
    width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
    background: color-mix(in srgb, var(--node-color, #6c5ce7) 15%, transparent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 1px;
}
.mhed-flow-node-icon i, .mhed-flow-node-icon svg {
    color: var(--node-color, #6c5ce7);
}

/* Node content */
.mhed-flow-node-content { flex: 1; min-width: 0; }
.mhed-flow-node-label {
    font-size: 11px; font-weight: 600; color: var(--text, #e0e0e8);
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    line-height: 1.4;
}
.mhed-flow-node-meta {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px;
}
.mhed-flow-node-type {
    font-size: 8px; padding: 1px 5px; border-radius: 3px;
    background: rgba(255,255,255,.06); color: var(--text2, #8888a0);
    font-family: 'SF Mono','Menlo',monospace;
}
.mhed-flow-node-id {
    font-size: 7px; color: var(--text2, #8888a0); opacity: .5;
    font-family: 'SF Mono','Menlo',monospace;
}
.mhed-flow-node-sub {
    font-size: 8px; padding: 1px 5px; border-radius: 3px;
    background: color-mix(in srgb, var(--node-color, #6c5ce7) 8%, transparent);
    color: var(--node-color, #6c5ce7);
    font-weight: 500;
}

/* Node actions (play/delete) */
.mhed-flow-node-actions {
    display: flex; flex-direction: column; gap: 2px;
    opacity: 0; transition: opacity .15s;
    flex-shrink: 0; margin-top: -2px;
}
.mhed-flow-node:hover .mhed-flow-node-actions { opacity: 1; }
.mhed-flow-node.selected .mhed-flow-node-actions { opacity: 1; }
.mhed-flow-node-actions button {
    background: none; border: none; color: var(--text2, #8888a0);
    cursor: pointer; padding: 3px; border-radius: 4px; transition: all .15s;
    display: flex; align-items: center;
}
.mhed-flow-node-actions button:first-child:hover { color: #4ade80; background: rgba(74,222,128,.08); }
.mhed-flow-node-actions button:last-child:hover { color: #ef4444; background: rgba(239,68,68,.08); }

/* Branch badges on node */
.mhed-flow-node-branches {
    position: absolute; bottom: -8px; right: 8px;
    display: flex; gap: 4px; z-index: 2;
}
.mhed-flow-branch {
    font-size: 7px; padding: 1px 5px; border-radius: 4px;
    display: inline-flex; align-items: center; gap: 2px;
    font-family: 'SF Mono','Menlo',monospace;
    font-weight: 500; white-space: nowrap;
}
.mhed-flow-branch.fail {
    background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.2);
}
.mhed-flow-branch.success {
    background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.2);
}

/* (Branch split area removed — connections now rendered via SVG) */

/* Highlight target node when hovering branch tag */
.mhed-flow-node.branch-highlight {
    border-color: var(--accent, #6c5ce7) !important;
    box-shadow: 0 0 0 3px rgba(108,92,231,.25), 0 0 20px rgba(108,92,231,.2) !important;
    animation: mhedBranchHighlight .6s ease-in-out infinite alternate;
}
@keyframes mhedBranchHighlight {
    from { box-shadow: 0 0 6px rgba(108,92,231,.2); }
    to { box-shadow: 0 0 20px rgba(108,92,231,.4); }
}

/* Has-branches node gets a subtle indicator */
.mhed-flow-node.has-branches {
    border-color: color-mix(in srgb, var(--node-color, #8b5cf6) 35%, transparent);
}

/* ===== Branch editor in properties panel ===== */
.mhed-branch-editor {
    background: rgba(139,92,246,.04); border: 1px solid rgba(139,92,246,.12);
    border-radius: 8px; padding: 8px; margin-top: 4px;
}
.mhed-branch-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.mhed-branch-title {
    font-size: 10px; font-weight: 600; color: var(--accent2, #a29bfe);
    display: flex; align-items: center; gap: 4px;
}
.mhed-branch-empty {
    font-size: 9px; color: var(--text2, #8888a0); padding: 8px 4px;
    display: flex; align-items: flex-start; gap: 5px; line-height: 1.5;
}
.mhed-branch-edit-row {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.03);
    flex-wrap: wrap;
}
.mhed-branch-edit-row:last-of-type { border-bottom: none; }
.mhed-branch-color {
    width: 16px; height: 16px; border: none; padding: 0;
    border-radius: 50%; cursor: pointer;
    background: none; flex-shrink: 0;
}
.mhed-branch-color::-webkit-color-swatch-wrapper { padding: 0; }
.mhed-branch-color::-webkit-color-swatch { border: none; border-radius: 50%; }
.mhed-branch-match {
    flex: 1; min-width: 50px; padding: 3px 6px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 4px; color: var(--text, #e0e0e8); font-size: 10px; outline: none;
    font-family: 'SF Mono','Menlo',monospace;
}
.mhed-branch-match:focus { border-color: var(--accent, #6c5ce7); }
.mhed-branch-arrow {
    font-size: 10px; color: var(--text2, #8888a0); flex-shrink: 0;
}
.mhed-branch-goto {
    flex: 1.2; min-width: 60px; padding: 3px 4px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 4px; color: var(--text, #e0e0e8); font-size: 9px; outline: none;
}
.mhed-branch-goto:focus { border-color: var(--accent, #6c5ce7); }
.mhed-branch-label {
    width: 50px; padding: 3px 6px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 4px; color: var(--text, #e0e0e8); font-size: 10px; outline: none;
}
.mhed-branch-label:focus { border-color: var(--accent, #6c5ce7); }
.mhed-branch-del {
    background: none; border: none; color: var(--text2, #8888a0);
    cursor: pointer; padding: 2px; border-radius: 3px;
    display: flex; align-items: center; flex-shrink: 0;
    transition: all .15s;
}
.mhed-branch-del:hover { color: #ef4444; background: rgba(239,68,68,.08); }

.mhed-branch-default {
    display: flex; align-items: center; gap: 6px;
    margin-top: 6px; padding-top: 6px;
    border-top: 1px dashed rgba(255,255,255,.06);
}
.mhed-branch-default-label {
    font-size: 9px; color: var(--text2, #8888a0);
    display: flex; align-items: center; gap: 3px;
    white-space: nowrap; flex-shrink: 0;
}

/* Empty state */
.mhed-flow-empty {
    cursor: pointer; padding: 8px; transition: all .2s;
}
.mhed-flow-empty-inner {
    width: 260px; padding: 24px; border: 2px dashed rgba(108,92,231,.25);
    border-radius: 14px; text-align: center;
    color: var(--text2, #8888a0); font-size: 12px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: all .2s;
}
.mhed-flow-empty:hover .mhed-flow-empty-inner {
    border-color: var(--accent, #6c5ce7); color: var(--text, #e0e0e8);
    background: rgba(108,92,231,.05);
}

/* ===== Properties Panel (right side) ===== */
.mhed-props-panel {
    width: 0; overflow: hidden; flex-shrink: 0;
    border-left: 1px solid var(--border, #2a2a3e);
    background: var(--bg, #0a0a12);
    display: flex; flex-direction: column;
    transition: width .25s ease;
}
.mhed-props-panel.open { width: 260px; }
.mhed-props-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--border, #2a2a3e);
    flex-shrink: 0;
}
.mhed-props-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: var(--text, #e0e0e8);
}
.mhed-props-icon {
    width: 24px; height: 24px; border-radius: 50%;
    background: color-mix(in srgb, var(--node-color, #6c5ce7) 15%, transparent);
    display: flex; align-items: center; justify-content: center;
}
.mhed-props-icon i, .mhed-props-icon svg { color: var(--node-color, #6c5ce7); }
.mhed-props-body {
    flex: 1; overflow-y: auto; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 8px;
}
.mhed-props-body::-webkit-scrollbar { width: 3px; }
.mhed-props-body::-webkit-scrollbar-thumb { background: var(--border, #2a2a3e); border-radius: 2px; }
.mhed-props-footer {
    padding: 8px 12px; border-top: 1px solid var(--border, #2a2a3e);
    flex-shrink: 0; display: flex; flex-direction: column; gap: 6px;
}
.mhed-step-result-box {
    max-height: 140px; overflow-y: auto;
    font-size: 10px; line-height: 1.4;
}

/* Flow control section */
.mhed-flowctrl {
    background: rgba(108,92,231,.04); border: 1px solid rgba(108,92,231,.1);
    border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px;
    margin-top: 4px;
}
.mhed-flowctrl-title {
    font-size: 9px; color: var(--accent2, #a29bfe); font-weight: 600;
    display: flex; align-items: center; gap: 4px;
    text-transform: uppercase; letter-spacing: .3px;
}

/* Form fields */
.mhed-field { display: flex; flex-direction: column; gap: 3px; }
.mhed-field label {
    font-size: 10px; color: var(--text2, #8888a0); font-weight: 500;
    display: flex; align-items: center; gap: 3px;
}
.mhed-field input, .mhed-field select, .mhed-field textarea {
    padding: 6px 8px; background: var(--card, #1a1a2e);
    border: 1px solid var(--border, #2a2a3e); border-radius: 6px;
    color: var(--text, #e0e0e8); font-size: 11px; outline: none;
    font-family: inherit; transition: border-color .2s;
    width: 100%; box-sizing: border-box;
}
.mhed-field input:focus, .mhed-field select:focus, .mhed-field textarea:focus {
    border-color: var(--accent, #6c5ce7);
}
.mhed-field textarea { resize: vertical; min-height: 50px; }
.mhed-field-row { display: flex; gap: 8px; }
.mhed-field-row .mhed-field { flex: 1; }

/* Token estimate */
.mhed-token-est {
    display: flex; align-items: center; gap: 4px;
    font-size: 10px; color: var(--text2, #8888a0);
    padding: 5px 10px; background: var(--bg, #0a0a12);
    border-radius: 8px; border: 1px solid var(--border, #2a2a3e);
}
.mhed-token-est .token-val { color: var(--accent2, #a29bfe); font-weight: 600; }

/* Prompt templates */
.mhed-prompt-tpl {
    display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px;
}
.mhed-prompt-tpl-btn {
    font-size: 9px; padding: 2px 7px; border-radius: 10px;
    background: rgba(108,92,231,.08); color: var(--accent2, #a29bfe);
    border: 1px solid rgba(108,92,231,.15); cursor: pointer; transition: all .15s;
}
.mhed-prompt-tpl-btn:hover { background: rgba(108,92,231,.15); border-color: var(--accent, #6c5ce7); }

/* Toolbar */
.mhed-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-top: 1px solid var(--border, #2a2a3e);
    flex-shrink: 0; gap: 6px;
}
.mhed-toolbar-left { display: flex; gap: 6px; align-items: center; position: relative; }
.mhed-toolbar-right { display: flex; gap: 6px; align-items: center; }

/* Combo chips in toolbar */
.mhed-combo-chips {
    display: flex; gap: 4px; flex-wrap: wrap; margin-left: 4px;
}
.mhed-tpl-chip {
    font-size: 9px; padding: 3px 8px; border-radius: 10px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    color: var(--text2, #8888a0); cursor: pointer; transition: all .15s;
    display: flex; align-items: center; gap: 3px; white-space: nowrap;
}
.mhed-tpl-chip:hover { border-color: var(--accent, #6c5ce7); color: var(--text, #e0e0e8); }

/* Add step menu (popup from toolbar) */
.mhed-add-menu {
    position: absolute; bottom: 100%; left: 0; margin-bottom: 6px;
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 10px; padding: 6px; min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    display: none; flex-direction: column; gap: 2px; z-index: 20;
}
.mhed-add-menu.show { display: flex; }

/* App picker */
.mhed-app-picker {
    margin-top: 6px; padding: 8px;
    background: var(--bg2, #0f0f1a); border: 1px solid var(--border, #2a2a3e);
    border-radius: 8px; max-height: 260px; overflow: hidden;
    display: flex; flex-direction: column;
}
.mhed-app-search {
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 6px; padding: 6px 10px; font-size: 12px;
    color: var(--text, #e0e0e8); outline: none;
    flex-shrink: 0;
}
.mhed-app-search:focus { border-color: var(--primary, #8b5cf6); }
.mhed-app-list {
    overflow-y: auto; max-height: 200px;
    display: flex; flex-direction: column; gap: 0;
}
.mhed-app-item {
    padding: 7px 10px; cursor: pointer;
    font-size: 12px; color: var(--text, #e0e0e8);
    transition: background .15s;
    border-bottom: 1px solid rgba(255,255,255,.04);
    display: flex; flex-direction: column; gap: 2px;
}
.mhed-app-item:last-child { border-bottom: none; }
.mhed-app-item:hover {
    background: rgba(108,92,231,.12);
}
.mhed-app-item .app-pkg {
    font-size: 10px; color: var(--text2, #8888a0);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mhed-app-item .app-ver {
    font-size: 9px; color: var(--text2, #666);
}

/* Insert menu (floating from connector) */
.mhed-insert-menu {
    background: var(--card, #1a1a2e); border: 1px solid var(--border, #2a2a3e);
    border-radius: 10px; padding: 6px; min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    z-index: 10000; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 2px;
    animation: mhubFadeUp .15s ease both;
}

.mhed-add-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 6px; cursor: pointer;
    font-size: 11px; color: var(--text2, #8888a0); transition: all .15s;
}
.mhed-add-item:hover { background: rgba(108,92,231,.08); color: var(--text, #e0e0e8); }
.mhed-add-item .mhed-add-icon {
    width: 22px; height: 22px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mhed-step-num.ai   { background: rgba(139,92,246,.15); color: #a78bfa; }
.mhed-step-num.api  { background: rgba(34,197,94,.12);  color: #4ade80; }
.mhed-step-num.wait { background: rgba(251,191,36,.12); color: #fbbf24; }
.mhed-step-num.user { background: rgba(59,130,246,.12); color: #60a5fa; }
.mhed-step-num.cond { background: rgba(168,85,247,.12); color: #c084fc; }

/* Node picker */
.mhed-pick-mode #videoContainer { cursor: crosshair !important; }
.mhed-pick-mode .screen-body::after {
    content: ''; position: absolute; inset: 0; z-index: 5;
    border: 2px solid var(--accent, #6c5ce7);
    border-radius: 12px; pointer-events: none;
    animation: mhedPickPulse 1.5s ease-in-out infinite;
}
.mhed-pick-hint {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    z-index: 15; background: var(--accent, #6c5ce7); color: #fff;
    font-size: 11px; font-weight: 600; padding: 5px 14px; border-radius: 16px;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 4px 16px rgba(108,92,231,.4);
}
@keyframes mhedPickPulse { 0%,100% { border-color: var(--accent, #6c5ce7); } 50% { border-color: var(--accent2, #a29bfe); } }

/* JSON / Publish modal */
.mhed-json-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.mhed-json-overlay.show { opacity: 1; pointer-events: all; }
.mhed-json-modal {
    background: var(--bg, #0a0a12); border: 1px solid var(--border, #2a2a3e);
    border-radius: 16px; width: 500px; max-width: 92vw; max-height: 80vh;
    display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.mhed-json-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border, #2a2a3e);
}
.mhed-json-header h3 {
    margin: 0; font-size: 14px; font-weight: 600; color: var(--text, #e0e0e8);
    display: flex; align-items: center; gap: 6px;
}
.mhed-json-body {
    flex: 1; overflow: auto; padding: 12px;
}
.mhed-json-body textarea {
    width: 100%; min-height: 300px; background: var(--card, #1a1a2e);
    border: 1px solid var(--border, #2a2a3e); border-radius: 8px;
    color: var(--text, #e0e0e8); font-size: 11px; font-family: 'SF Mono', monospace;
    padding: 10px; outline: none; resize: vertical; line-height: 1.5;
    box-sizing: border-box;
}
.mhed-json-body textarea:focus { border-color: var(--accent, #6c5ce7); }
.mhed-json-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 16px; border-top: 1px solid var(--border, #2a2a3e);
}

/* ===== Skill Recorder v3 — dual-column layout ===== */
@keyframes mhrecPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.mhrec-overlay {
    position: absolute; inset: 0; z-index: 50;
    background: var(--bg, #0a0a12);
    display: flex; flex-direction: column;
    animation: mhubFadeUp .25s ease both;
}

/* Header */
.mhrec-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-bottom: 1px solid var(--border, #2a2a3e); flex-shrink: 0;
}
.mhrec-header h3 {
    margin: 0; font-size: 13px; font-weight: 700; color: var(--text, #e0e0e8);
    display: flex; align-items: center; gap: 6px; flex: 1;
}
.mhrec-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
    animation: mhrecPulse 1s ease-in-out infinite; flex-shrink: 0;
}
.mhrec-header.stopped .mhrec-dot { background: #22c55e; animation: none; }
.mhrec-header.paused .mhrec-dot { background: #fbbf24; animation: none; }
.mhrec-timer { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--text2, #8888a0); }
.mhrec-hdr-btns { display: flex; gap: 4px; }
.mhrec-hdr-btn {
    background: rgba(108,92,231,.08); border: 1px solid var(--border, #2a2a3e);
    color: var(--text, #e0e0e8); padding: 3px 8px; border-radius: 6px;
    font-size: 9px; font-weight: 600; cursor: pointer; transition: all .12s;
    display: flex; align-items: center; gap: 3px;
}
.mhrec-hdr-btn:hover { background: rgba(108,92,231,.15); border-color: var(--accent, #6c5ce7); }
.mhrec-hdr-btn.danger { color: #ef4444; border-color: rgba(239,68,68,.3); }
.mhrec-hdr-btn.primary { background: var(--accent, #6c5ce7); color: #fff; border-color: transparent; }

/* Toolbar (recording mode) */
.mhrec-toolbar {
    display: flex; gap: 4px; padding: 5px 10px; flex-wrap: wrap;
    border-bottom: 1px solid var(--border, #2a2a3e); flex-shrink: 0;
}
.mhrec-toolbar button {
    background: rgba(108,92,231,.06); border: 1px solid var(--border, #2a2a3e);
    color: var(--text, #e0e0e8); padding: 3px 8px; border-radius: 6px;
    font-size: 9px; font-weight: 600; cursor: pointer; transition: all .12s;
    display: flex; align-items: center; gap: 3px;
}
.mhrec-toolbar button:hover { background: rgba(108,92,231,.15); border-color: var(--accent, #6c5ce7); }

/* Dual-column body */
.mhrec-body {
    flex: 1; display: flex; overflow: hidden; min-height: 0;
}
.mhrec-col {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
    min-width: 0;
}
.mhrec-col + .mhrec-col { border-left: 1px solid var(--border, #2a2a3e); }

.mhrec-col-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px; border-bottom: 1px solid var(--border, #2a2a3e);
    flex-shrink: 0;
}
.mhrec-col-title {
    margin: 0; font-size: 10px; font-weight: 700; color: var(--text2, #8888a0);
    text-transform: uppercase; letter-spacing: .5px;
    display: flex; align-items: center; gap: 4px;
}
.mhrec-col-count {
    font-size: 9px; padding: 1px 5px; border-radius: 4px;
    background: rgba(108,92,231,.1); color: var(--accent2, #a29bfe);
}
.mhrec-col-actions { display: flex; gap: 4px; }

.mhrec-list {
    flex: 1; overflow-y: auto; padding: 4px 6px;
}
.mhrec-list::-webkit-scrollbar { width: 3px; }
.mhrec-list::-webkit-scrollbar-thumb { background: var(--border, #2a2a3e); border-radius: 2px; }

/* Step card (shared) */
.mhrec-step {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 5px 7px; border-radius: 7px; margin-bottom: 2px;
    border: 1px solid var(--border, #2a2a3e); transition: all .15s;
    font-size: 10px; color: var(--text, #e0e0e8);
}
.mhrec-step:hover { background: rgba(255,255,255,.02); }
.mhrec-step.running { border-color: var(--accent, #6c5ce7); background: rgba(108,92,231,.06); }
.mhrec-step.done { opacity: .6; }
.mhrec-step.error { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.04); }
.mhrec-step-num {
    width: 16px; height: 16px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 8px; font-weight: 700; flex-shrink: 0;
    background: rgba(108,92,231,.12); color: var(--accent2, #a29bfe);
}
.mhrec-step.running .mhrec-step-num { background: var(--accent, #6c5ce7); color: #fff; }
.mhrec-step-info { flex: 1; min-width: 0; }
.mhrec-step-label { font-weight: 600; line-height: 1.3; font-size: 10px; }
.mhrec-step-meta {
    display: flex; gap: 5px; margin-top: 2px; font-size: 8px; color: var(--text2, #8888a0);
    flex-wrap: wrap;
}
.mhrec-snap-badge {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 4px; border-radius: 3px; font-size: 7px; font-weight: 600;
    background: rgba(34,197,94,.1); color: #22c55e;
}
.mhrec-step-del {
    background: none; border: none; color: var(--text2, #8888a0);
    cursor: pointer; padding: 2px; opacity: 0; transition: opacity .15s; flex-shrink: 0;
}
.mhrec-step:hover .mhrec-step-del { opacity: 1; }
.mhrec-step-del:hover { color: #ef4444; }

/* Right column: AI step editable */
.mhrec-ai-step { position: relative; }
.mhrec-ai-step .mhrec-step-num { background: rgba(34,197,94,.12); color: #22c55e; }
.mhrec-ai-step.running .mhrec-step-num { background: #22c55e; color: #fff; }
.mhrec-ai-edit {
    margin-top: 4px; padding: 4px 6px; border-radius: 5px;
    background: rgba(255,255,255,.02); border: 1px solid var(--border, #2a2a3e);
    display: none;
}
.mhrec-ai-step.expanded .mhrec-ai-edit, .mhrec-step.expanded .mhrec-ai-edit { display: block; }
.mhrec-ai-edit label {
    display: block; font-size: 8px; font-weight: 600; color: var(--text2, #8888a0);
    margin-top: 3px; margin-bottom: 1px;
}
.mhrec-ai-edit select, .mhrec-ai-edit input {
    width: 100%; padding: 3px 5px; border-radius: 4px; font-size: 9px;
    background: var(--bg, #0a0a12); border: 1px solid var(--border, #2a2a3e);
    color: var(--text, #e0e0e8); outline: none;
}
.mhrec-ai-edit select:focus, .mhrec-ai-edit input:focus { border-color: var(--accent, #6c5ce7); }
.mhrec-ai-edit-row { display: flex; gap: 4px; }
.mhrec-ai-edit-row > * { flex: 1; }

/* AI analysis progress */
.mhrec-ai-progress {
    padding: 12px; text-align: center; color: var(--text2, #8888a0); font-size: 11px;
}
.mhrec-ai-progress .spinner {
    display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border, #2a2a3e);
    border-top-color: var(--accent, #6c5ce7); border-radius: 50%;
    animation: mhrecSpin .6s linear infinite; vertical-align: middle; margin-right: 6px;
}
@keyframes mhrecSpin { to { transform: rotate(360deg); } }
.mhrec-ai-empty {
    padding: 20px 12px; text-align: center; color: var(--text2, #8888a0); font-size: 10px;
}

/* Footer */
.mhrec-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px; border-top: 1px solid var(--border, #2a2a3e); flex-shrink: 0;
    gap: 6px;
}
.mhrec-footer-left { display: flex; gap: 4px; align-items: center; font-size: 10px; color: var(--text2, #8888a0); }
.mhrec-footer-right { display: flex; gap: 4px; }

/* Replay button */
.mhrec-replay-btn {
    background: rgba(108,92,231,.08); border: 1px solid var(--border, #2a2a3e);
    color: var(--text, #e0e0e8); padding: 3px 8px; border-radius: 6px;
    font-size: 9px; font-weight: 600; cursor: pointer; transition: all .12s;
    display: inline-flex; align-items: center; gap: 3px;
}
.mhrec-replay-btn:hover { background: rgba(108,92,231,.2); border-color: var(--accent, #6c5ce7); }
.mhrec-replay-btn.stop { color: #ef4444; border-color: rgba(239,68,68,.3); }
.mhrec-replay-btn.primary { background: var(--accent, #6c5ce7); color: #fff; border-color: transparent; }

/* Screen indicator */
.screen-panel.mhrec-active .screen-body {
    box-shadow: inset 0 0 0 2px rgba(220,38,38,.4); border-radius: 12px;
}

/* Create menu */
.mhrec-create-menu {
    position: absolute; top: 100%; left: 0; z-index: 60;
    background: var(--bg, #0a0a12); border: 1px solid var(--border, #2a2a3e);
    border-radius: 10px; padding: 4px; min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: mhubFadeUp .15s ease both;
}
.mhrec-create-menu button {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 12px; border: none; background: none;
    color: var(--text, #e0e0e8); font-size: 12px; font-weight: 500;
    cursor: pointer; border-radius: 8px; transition: background .12s;
}
.mhrec-create-menu button:hover { background: rgba(108,92,231,.1); }
.mhrec-create-menu button i { color: var(--accent2, #a29bfe); }

/* AI Thinking display */
.mhrec-thinking {
    display: flex; flex-direction: column; height: 100%;
}
.mhrec-thinking-header {
    padding: 10px 12px; font-size: 11px; font-weight: 600;
    color: var(--accent2, #a29bfe); display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid var(--border, #2a2a3e); flex-shrink: 0;
}
.mhrec-thinking-spinner {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid var(--border, #2a2a3e); border-top-color: var(--accent, #6c5ce7);
    border-radius: 50%; animation: mhrecSpin .6s linear infinite;
}
.mhrec-thinking-body {
    flex: 1; overflow-y: auto; padding: 10px 12px;
    font-size: 10px; line-height: 1.6; color: var(--text2, #8888a0);
    white-space: pre-wrap; word-break: break-word;
    font-family: 'SF Mono', 'Menlo', monospace;
}
.mhrec-thinking-body::-webkit-scrollbar { width: 3px; }
.mhrec-thinking-body::-webkit-scrollbar-thumb { background: var(--border, #2a2a3e); border-radius: 2px; }

/* Note textarea */
.mhrec-note-bar {
    padding: 4px 8px; border-top: 1px solid var(--border, #2a2a3e); flex-shrink: 0;
}
.mhrec-note-input {
    width: 100%; box-sizing: border-box; resize: none; height: 32px;
    background: rgba(0,0,0,.15); border: 1px solid var(--border, #2a2a3e);
    border-radius: 6px; padding: 6px 8px; color: var(--text, #e0e0e8);
    font-size: 10px; line-height: 1.4; outline: none;
    font-family: inherit; transition: border-color .2s;
}
.mhrec-note-input:focus { border-color: var(--accent, #6c5ce7); height: 52px; }
.mhrec-note-input::placeholder { color: var(--text2, #8888a0); opacity: .6; }

/* Debug toggle */
.mhrec-debug-toggle {
    background: none; border: 1px solid var(--border, #2a2a3e); color: var(--text2, #8888a0);
    font-size: 9px; padding: 2px 6px; border-radius: 4px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 3px; margin-right: 6px;
    transition: all .2s;
}
.mhrec-debug-toggle:hover { border-color: var(--accent, #6c5ce7); color: var(--accent, #6c5ce7); }

/* Debug panel */
.mhrec-debug-panel {
    position: absolute; bottom: 32px; left: 0; right: 0;
    background: rgba(10, 10, 18, .97); border-top: 1px solid var(--accent, #6c5ce7);
    max-height: 50%; display: flex; flex-direction: column;
    z-index: 10; animation: mhrecSlideUp .2s ease;
}
@keyframes mhrecSlideUp { from { transform: translateY(100%); opacity:0 } to { transform: translateY(0); opacity:1 } }
.mhrec-debug-header {
    padding: 6px 10px; display: flex; align-items: center; justify-content: space-between;
    font-size: 10px; font-weight: 600; color: var(--accent, #6c5ce7);
    border-bottom: 1px solid var(--border, #2a2a3e); flex-shrink: 0;
}
.mhrec-debug-copy {
    background: none; border: 1px solid var(--border, #2a2a3e); color: var(--text2, #8888a0);
    font-size: 9px; padding: 2px 6px; border-radius: 3px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 2px;
}
.mhrec-debug-copy:hover { border-color: var(--accent, #6c5ce7); color: var(--accent, #6c5ce7); }
.mhrec-debug-body {
    flex: 1; overflow-y: auto; padding: 8px 10px; margin: 0;
    font-size: 9px; line-height: 1.6; color: var(--text2, #8888a0);
    white-space: pre-wrap; word-break: break-word;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}
.mhrec-debug-body::-webkit-scrollbar { width: 3px; }
.mhrec-debug-body::-webkit-scrollbar-thumb { background: var(--border, #2a2a3e); border-radius: 2px; }

/* ===== Flow Chart UI ===== */
.mhrec-flow { padding: 8px 6px 16px 6px; }

.mhrec-flow-step {
    display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px;
    border-radius: 8px; background: rgba(255,255,255,.03);
    border: 1px solid transparent; position: relative;
    transition: all .25s ease;
}
.mhrec-flow-step:hover { background: rgba(255,255,255,.06); border-color: var(--border, #2a2a3e); }
.mhrec-flow-step.running {
    border-color: var(--accent, #6c5ce7);
    box-shadow: 0 0 12px rgba(108,92,231,.3), 0 0 24px rgba(108,92,231,.1);
    animation: mhrecFlowGlow 1.5s ease-in-out infinite alternate;
}
@keyframes mhrecFlowGlow {
    from { box-shadow: 0 0 8px rgba(108,92,231,.2); }
    to { box-shadow: 0 0 16px rgba(108,92,231,.4), 0 0 30px rgba(108,92,231,.15); }
}
.mhrec-flow-step.done { border-color: rgba(34,197,94,.3); }
.mhrec-flow-step.done .mhrec-flow-node { background: rgba(34,197,94,.15); --node-color: #22c55e !important; }
.mhrec-flow-step.error { border-color: rgba(239,68,68,.3); }
.mhrec-flow-step.error .mhrec-flow-node { background: rgba(239,68,68,.15); --node-color: #ef4444 !important; }
.mhrec-flow-step.skip { opacity: .4; }

.mhrec-flow-node {
    width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
    background: color-mix(in srgb, var(--node-color, #3b82f6) 15%, transparent);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    margin-top: 1px; transition: all .2s;
}
.mhrec-flow-node i, .mhrec-flow-node svg { color: var(--node-color, #3b82f6); }

.mhrec-flow-content { flex: 1; min-width: 0; }
.mhrec-flow-label {
    font-size: 11px; font-weight: 500; color: var(--text, #e0e0e8);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mhrec-flow-meta {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px;
}
.mhrec-flow-type {
    font-size: 8px; padding: 1px 5px; border-radius: 3px;
    background: rgba(255,255,255,.06); color: var(--text2, #8888a0);
    font-family: 'SF Mono','Menlo',monospace;
}
.mhrec-flow-id {
    font-size: 7px; color: var(--text2, #8888a0); opacity: .5;
    font-family: 'SF Mono','Menlo',monospace;
}

.mhrec-flow-branch {
    font-size: 7px; padding: 1px 4px; border-radius: 3px;
    display: inline-flex; align-items: center; gap: 2px;
    font-family: 'SF Mono','Menlo',monospace;
}
.mhrec-flow-branch.fail {
    background: rgba(239,68,68,.1); color: #f87171; border: 1px solid rgba(239,68,68,.2);
}
.mhrec-flow-branch.success {
    background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.2);
}
.mhrec-flow-branch.retry {
    background: rgba(251,191,36,.1); color: #fbbf24; border: 1px solid rgba(251,191,36,.2);
}

.mhrec-flow-connector {
    display: flex; justify-content: center; padding: 0 0 0 19px; height: 16px;
}
.mhrec-flow-line {
    width: 2px; height: 100%;
    background: linear-gradient(180deg, var(--accent, #6c5ce7) 0%, rgba(108,92,231,.2) 100%);
    border-radius: 1px;
}

.mhrec-flow-step .mhrec-step-del {
    position: absolute; top: 4px; right: 4px; opacity: 0;
    background: none; border: none; cursor: pointer; padding: 2px;
    color: var(--text2, #8888a0); transition: opacity .2s;
}
.mhrec-flow-step:hover .mhrec-step-del { opacity: .6; }
.mhrec-flow-step .mhrec-step-del:hover { color: #ef4444; opacity: 1; }

/* Schedule Skill */
.mh-detail-schedule-btn {
    width: 100%; padding: 10px; font-size: 13px; font-weight: 600; margin-top: 8px;
    background: transparent; color: var(--accent);
    border: 1.5px solid var(--accent); border-radius: 10px; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.mh-detail-schedule-btn:hover { background: rgba(108,92,231,0.08); }

.mh-schedule-overlay {
    position: fixed; inset: 0; z-index: 10002;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.mh-schedule-overlay.show { opacity: 1; pointer-events: auto; }

.mh-schedule-panel {
    background: var(--bg, #1a1a2e); border: 1px solid var(--border, #333);
    border-radius: 16px; width: 340px; max-width: 90vw;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5); overflow: hidden;
}
.mh-schedule-header {
    display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 0;
}
.mh-schedule-icon-wrap {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(108,92,231,0.2), rgba(167,139,250,0.15));
    display: flex; align-items: center; justify-content: center; color: var(--accent);
    flex-shrink: 0;
}
.mh-schedule-title {
    font-size: 16px; font-weight: 700; color: var(--text, #eee); line-height: 1.3;
}
.mh-schedule-skill-name {
    margin-top: 4px; padding: 0 20px; font-size: 12px; color: var(--text2, #888);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
}
.mh-schedule-body { padding: 20px 20px 0; }
.mh-schedule-label {
    display: block; font-size: 12px; color: var(--text2, #888); margin-bottom: 10px;
}
.mh-schedule-time-row {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 12px;
}
.mh-schedule-select {
    min-width: 76px; padding: 14px 32px 14px 12px; font-size: 22px; font-weight: 700;
    text-align: center; letter-spacing: 1px;
    background: var(--card, #222); color: var(--text, #eee);
    border: 1.5px solid var(--border, #444); border-radius: 12px;
    outline: none; cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    padding-right: 32px;
    background-repeat: no-repeat; background-position: right 10px center;
    font-family: 'SF Mono','Menlo',monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.mh-schedule-select:hover { border-color: var(--accent, #6c5ce7); }
.mh-schedule-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(108,92,231,0.25); }
.mh-schedule-time-sep {
    font-size: 22px; font-weight: 700; color: var(--text2, #888); user-select: none;
}
.mh-schedule-preview {
    font-size: 13px; color: var(--accent); text-align: center; margin-bottom: 12px;
    font-weight: 500;
}
.mh-schedule-hint {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 12px; font-size: 12px; color: var(--text2, #888);
    background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2);
    border-radius: 10px;
}
.mh-schedule-hint svg, .mh-schedule-hint i { flex-shrink: 0; color: #f59e0b; }

.mh-schedule-actions {
    display: flex; gap: 10px; padding: 20px 20px 20px;
}
.mh-schedule-cancel-btn {
    flex: 1; padding: 10px; font-size: 13px; font-weight: 600;
    background: var(--card, #222); color: var(--text2, #888);
    border: 1px solid var(--border, #444); border-radius: 10px; cursor: pointer;
    transition: all 0.2s;
}
.mh-schedule-cancel-btn:hover { background: var(--border, #333); }
.mh-schedule-confirm-btn {
    flex: 1; padding: 10px; font-size: 13px; font-weight: 700;
    background: linear-gradient(135deg, var(--accent, #6c5ce7), var(--accent2, #a78bfa));
    color: #fff; border: none; border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: opacity 0.2s;
}
.mh-schedule-confirm-btn:hover { opacity: 0.85; }

.mh-schedule-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 10001;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 16px; font-size: 12px;
    background: linear-gradient(135deg, rgba(108,92,231,0.95), rgba(167,139,250,0.95));
    color: #fff; backdrop-filter: blur(8px);
    transform: translateY(-100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 2px 12px rgba(108,92,231,0.4);
}
.mh-schedule-banner.show { transform: translateY(0); }

.mh-banner-left {
    display: flex; align-items: center; gap: 6px; min-width: 0;
}
.mh-banner-skill {
    font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.mh-banner-time { opacity: 0.85; white-space: nowrap; }
.mh-banner-countdown {
    font-weight: 800; font-size: 14px; font-family: 'SF Mono','Menlo',monospace;
    white-space: nowrap; letter-spacing: 0.5px;
}
.mh-banner-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mh-banner-warn {
    display: flex; align-items: center; gap: 4px; opacity: 0.85; font-size: 11px; white-space: nowrap;
}
.mh-banner-cancel {
    background: rgba(255,255,255,0.2); border: none; border-radius: 6px;
    padding: 4px 6px; cursor: pointer; color: #fff; display: flex; align-items: center;
    transition: background 0.2s;
}
.mh-banner-cancel:hover { background: rgba(255,255,255,0.35); }

@media (max-width: 640px) {
    .mh-schedule-banner { flex-wrap: wrap; gap: 6px; padding: 6px 12px; }
    .mh-banner-left { order: 1; flex: 1 1 50%; }
    .mh-banner-countdown { order: 2; flex: 0 0 auto; }
    .mh-banner-right { order: 3; flex: 1 1 100%; justify-content: space-between; }
    .mh-banner-skill { max-width: 80px; }
}

/* ========== Local Skill Cards ========== */
.mh-local-card {
    position: relative;
}
.mh-local-card .mh-card-icon {
    --icon-bg: rgba(0,206,201,0.12);
    --icon-color: #00cec9;
}
.mh-local-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(0,206,201,0.15);
    color: #00cec9;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.4;
}
.mh-local-actions {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 2px;
}
.mh-local-act-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}
.mh-local-act-btn:hover {
    border-color: var(--accent);
    color: var(--text);
}
.mh-local-act-danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}
