medesign 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,17 +7,17 @@
7
7
 
8
8
  :root {
9
9
  /* 01. Typography */
10
- --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
11
- --font-sans: "Inter", "Sukhumvit Set", sans-serif;
12
- --font-mono: "IBM Plex Mono", "Fira Code", monospace;
10
+ --font-display: "Geist", "Inter", sans-serif;
11
+ --font-sans: "Geist", "IBM Plex Sans Thai", sans-serif;
12
+ --font-mono: "IBM Plex Mono", "JetBrains Mono", monospace;
13
13
  --tracking-heading: -0.020em;
14
14
  --tracking-coord: 0.04em;
15
15
  --leading-ui: 1.25;
16
- --leading-prose: 1.60;
16
+ --leading-prose: 1.70;
17
17
  --thai-headroom: 4px;
18
18
 
19
19
  /* 02. Color Tokens (Deep Slate / Geodetic Field Rig) */
20
- --color-canvas: #0c0e14;
20
+ --color-canvas: #0a0d14;
21
21
  --color-surface-raised: #141721;
22
22
  --color-surface-inset: #090a0f;
23
23
  --color-surface-dock: rgba(20, 23, 33, 0.88);
@@ -26,14 +26,14 @@
26
26
  --color-text-tertiary: #545d68;
27
27
  --color-border-subtle: rgba(255, 255, 255, 0.09);
28
28
  --color-border-strong: rgba(255, 255, 255, 0.18);
29
- --color-border-focus: oklch(0.68 0.20 250);
29
+ --color-border-focus: oklch(0.85 0.18 198);
30
30
 
31
- /* Brand Accents (Survey Electric Indigo & Geodetic Green) */
32
- --color-accent: oklch(0.65 0.20 250);
33
- --color-accent-hover: oklch(0.70 0.20 250);
34
- --color-accent-fg: #ffffff;
31
+ /* Brand Accents (Survey Electric Cyan & Precision Geodetic Green) */
32
+ --color-accent: oklch(0.85 0.18 198);
33
+ --color-accent-hover: oklch(0.88 0.18 198);
34
+ --color-accent-fg: #0a0d14;
35
35
 
36
- --color-status-info: oklch(0.68 0.20 250);
36
+ --color-status-info: oklch(0.85 0.18 198);
37
37
  --color-status-success: oklch(0.72 0.18 145);
38
38
  --color-status-warning: oklch(0.78 0.16 75);
39
39
  --color-status-critical: oklch(0.62 0.22 25);
@@ -44,7 +44,7 @@
44
44
  --hit-target-min: 44px;
45
45
 
46
46
  /* 04. Motion Tokens (Sub-second Field Precision) */
47
- --duration-entry: 140ms;
47
+ --duration-entry: 120ms;
48
48
  --duration-exit: 90ms;
49
49
  --ease-entry: cubic-bezier(0.16, 1, 0.3, 1);
50
50
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
@@ -1,207 +1,96 @@
1
- # Design Routing Guide
2
-
3
- When to use each design sub-skill.
4
-
5
- ## Skill Overview
6
-
7
- | Skill | Purpose | Key Files |
8
- |-------|---------|-----------|
9
- | brand | Brand identity, voice, assets | SKILL.md + 10 references + 3 scripts |
10
- | design-system | Token architecture, specs | SKILL.md + 7 references + 2 scripts |
11
- | ui-styling | Component implementation | SKILL.md + 7 references + 2 scripts |
12
- | logo-design | AI logo generation (55 styles, 30 palettes) | SKILL.md + 4 references + 2 scripts |
13
- | cip-design | Corporate Identity Program (50 deliverables) | SKILL.md + 3 references + 3 scripts |
14
- | slides | HTML presentations with Chart.js | SKILL.md + 4 references |
15
- | banner (built-in) | Banners for social, ads, web, print (22 styles) | references/banner-sizes-and-styles.md |
16
- | icon-design | SVG icon generation (15 styles, Gemini 3.1 Pro) | SKILL.md + 1 reference + 1 script |
17
-
18
- ## Routing by Task Type
19
-
20
- ### Brand Identity Tasks
21
- **→ brand**
22
-
23
- - Define brand colors and typography
24
- - Create logo usage guidelines
25
- - Establish brand voice and tone
26
- - Organize and validate assets
27
- - Create messaging frameworks
28
- - Audit brand consistency
29
-
30
- ### Token System Tasks
31
- **→ design-system**
32
-
33
- - Create design tokens JSON
34
- - Generate CSS variables
35
- - Define component specifications
36
- - Map tokens to Tailwind config
37
- - Validate token usage in code
38
- - Document state and variants
39
-
40
- ### Implementation Tasks
41
- **→ ui-styling**
42
-
43
- - Add shadcn/ui components
44
- - Style with Tailwind classes
45
- - Implement dark mode
46
- - Create responsive layouts
47
- - Build accessible components
48
-
49
- ### Logo Design Tasks
50
- **→ logo-design**
51
-
52
- - Create logos with AI (Gemini Nano Banana)
53
- - Search logo styles, color palettes, industry guidelines
54
- - Generate design briefs
55
- - Explore 55+ styles (minimalist, vintage, luxury, geometric, etc.)
56
-
57
- ### Corporate Identity Program Tasks
58
- **→ cip-design**
59
-
60
- - Generate CIP deliverables (business cards, letterheads, signage, vehicles, apparel)
61
- - Create CIP briefs with industry/style analysis
62
- - Generate mockups with/without logo (Gemini Flash/Pro)
63
- - Render HTML presentations from CIP mockups
64
-
65
- ### Presentation Tasks
66
- **→ slides**
67
-
68
- - Create strategic HTML presentations
69
- - Data visualization with Chart.js
70
- - Apply copywriting formulas to slide content
71
- - Use layout patterns and design tokens
72
-
73
- ### Banner Design Tasks
74
- **→ design (built-in banner: references/banner-sizes-and-styles.md)**
75
-
76
- - Design banners for social media (Facebook, Twitter, LinkedIn, YouTube, Instagram)
77
- - Create ad banners (Google Ads, Meta Ads)
78
- - Website hero banners and headers
79
- - Print banners and covers
80
- - 22 art direction styles (minimalist, bold typography, gradient, glassmorphism, etc.)
81
-
82
- ### Icon Design Tasks
83
- **→ icon-design**
84
-
85
- - Generate SVG icons with AI (Gemini 3.1 Pro Preview)
86
- - Batch icon variations in multiple styles
87
- - Multi-size export (16px, 24px, 32px, 48px)
88
- - 15 styles: outlined, filled, duotone, rounded, sharp, gradient, etc.
89
- - 12 categories: navigation, action, communication, media, commerce, data
90
-
91
- ## Routing by Question Type
92
-
93
- | Question | Skill |
94
- |----------|-------|
95
- | "What color should this be?" | brand |
96
- | "How do I create a token for X?" | design-system |
97
- | "How do I build a button component?" | ui-styling |
98
- | "Is this on-brand?" | brand |
99
- | "Should I use a CSS variable here?" | design-system |
100
- | "How do I add dark mode?" | ui-styling |
101
- | "Create a logo for my brand" | logo-design |
102
- | "Generate business card mockups" | cip-design |
103
- | "Create a pitch deck" | slides |
104
- | "Design brand identity package" | cip-design |
105
- | "What logo style fits my industry?" | logo-design |
106
- | "Design a Facebook cover" | design (built-in banner) |
107
- | "Create ad banners for Google" | design (built-in banner) |
108
- | "Make a website hero banner" | design (built-in banner) |
109
- | "Generate a settings icon" | icon-design |
110
- | "Create SVG icons for my app" | icon-design |
111
- | "Design an icon set" | icon-design |
112
-
113
- ## Multi-Skill Workflows
114
-
115
- ### New Project Setup
116
-
117
- ```
118
- 1. brand → Define identity
119
- - Colors, typography, voice
120
-
121
- 2. design-system → Create tokens
122
- - Primitive, semantic, component
123
-
124
- 3. ui-styling → Implement
125
- - Configure Tailwind, add components
126
- ```
127
-
128
- ### Design System Migration
129
-
130
- ```
131
- 1. brand → Audit existing
132
- - Extract brand colors, fonts
133
-
134
- 2. design-system → Formalize tokens
135
- - Create three-layer architecture
136
-
137
- 3. ui-styling → Update code
138
- - Replace hardcoded values
139
- ```
140
-
141
- ### Component Creation
142
-
143
- ```
144
- 1. design-system → Reference specs
145
- - Button states, sizes, variants
146
-
147
- 2. ui-styling → Implement
148
- - Build with shadcn/ui + Tailwind
149
- ```
150
-
151
- ## Skill Dependencies
152
-
153
- ```
154
- brand
155
- ↓ (colors, typography)
156
- design-system
157
- ↓ (tokens, specs)
158
- ui-styling
159
- ↓ (components)
160
- Application Code
161
- ```
162
-
163
- ## Quick Commands
164
-
165
- **Brand:**
166
- ```bash
167
- node ../brand/scripts/inject-brand-context.cjs
168
- node ../brand/scripts/validate-asset.cjs <path>
169
- ```
170
-
171
- **Tokens:**
172
- ```bash
173
- node ../design-system/scripts/generate-tokens.cjs -c tokens.json
174
- node ../design-system/scripts/validate-tokens.cjs -d src/
175
- ```
176
-
177
- **Components:**
178
- ```bash
179
- npx shadcn@latest add button card input
180
- ```
181
-
182
- ## When to Use Multiple Skills
183
-
184
- Use **all eight** when:
185
- - Complete brand package from scratch (logo → CIP → presentation)
186
-
187
- Use **brand + design-system + ui-styling** when:
188
- - Design system setup and implementation
189
-
190
- Use **logo-design + cip-design** when:
191
- - Complete brand identity package with deliverable mockups
192
-
193
- Use **logo-design + cip-design + slides** when:
194
- - Brand pitch: generate logo, create CIP mockups, build pitch deck
195
-
196
- Use **design (banner) + brand** when:
197
- - Social media presence: branded banners across all platforms
198
-
199
- Use **icon-design + design-system** when:
200
- - Custom icon set matching design tokens and component specs
201
-
202
- Use **brand + design-system** when:
203
- - Defining design language without implementation
204
-
205
- Use **design-system + ui-styling** when:
206
- - Implementing existing brand in code
207
- - Building component library
1
+ # ME-DESIGN — Knowledge & Design Intelligence Routing Guide
2
+
3
+ This document classifies all references within ME-DESIGN, mapping product contexts, intents, and user domains to relevant architectural modules.
4
+
5
+ ---
6
+
7
+ ## 1. Reference Classification (Four-Tier Architecture)
8
+
9
+ To minimize context pollution and prevent unnecessary loading, all 60+ repository references are organized into four distinct tiers:
10
+
11
+ ### Tier 1: Core Engineering Knowledge (Load on Frontend Design Workflows)
12
+ These references establish the non-negotiable foundations of web accessibility, layout, typography, and delivery verification:
13
+
14
+ | Reference | Domain & Purpose | Trigger Condition |
15
+ |---|---|---|
16
+ | `references/design-core.md` | Layout principles, 8-pt grid, closed spacing tokens, visual hierarchy | Spatial layout, spacing, containers |
17
+ | `references/typography-thai-latin.md` | Bilingual Thai-Latin font pairing, vertical metrics, line-height >= 1.7 | Typography, font stacks, Thai diacritic clipping |
18
+ | `references/modern-craft-invariants.md` | WCAG 2.2 standards, touch target contracts (44px), high contrast outline | Accessibility, interactive states, contracts |
19
+ | `references/quality-gate.md` | Deterministic verification: Squint Test, Grayscale, 10-State Matrix | Delivery review, code completion |
20
+ | `references/brief-intake.md` | Mode detection (`new` / `revamp` / `like`), ambiguity resolution | Initial brief intake (deep path) |
21
+
22
+ ---
23
+
24
+ ### Tier 2: Specialized Design Intelligence (Load JIT Based on Domain/Task)
25
+ Load only the reference matching the specific product domain or technical task:
26
+
27
+ | Reference | Domain & Purpose | Recommended Stack / Context |
28
+ |---|---|---|
29
+ | `references/argon-design-archetypes.md` | 38 Curated Domain Archetypes (SaaS, GIS, Cadastre, Telemetry, FinTech) | Creating distinct, non-generic interfaces |
30
+ | `references/brand-design-tokens.md` | 74 Global Brand System Profiles & OKLCH token mappings | Brand inspiration or theme adaptation |
31
+ | `references/motion-tokens.md` | 120fps spring physics curves, duration scales, micro-interactions | Animation, transition, hover/active physics |
32
+ | `references/compositor-smoothness.md` | Hardware-accelerated CSS properties (`transform`, `opacity`) | High-framerate interaction, scroll performance |
33
+ | `references/components.md` | Accessible component blueprints (dialog, combobox, tooltip, table) | Component implementation, complex controls |
34
+ | `references/ui-styling-shadcn.md` | Tailwind CSS + shadcn/ui integration conventions | React / Next.js / Tailwind stack |
35
+ | `references/web-retrofit-protocol.md` | Safe legacy web modernization (Tier 1-3 progressive patches) | Refactoring existing webbases without breakage |
36
+ | `references/style-extraction.md` | Methodical CSS / token reverse-engineering from live sites | `/medesign extract <url>` or theme cloning |
37
+ | `references/image-to-code.md` | Figma / screenshot to production code mapping protocol | Converting visual designs to code |
38
+ | `references/ai-tells.md` | Catalog of 44 AI-generated visual tells to detect and eradicate | Anti-generic polish, design critique |
39
+ | `references/redesign-audit.md` | Pre-implementation audit checklist for existing projects | Planning a surface or application revamp |
40
+
41
+ ---
42
+
43
+ ### Tier 3: Optional Media & Graphic References (User Explicit Request Only)
44
+ Do not load during web application or frontend development unless explicitly asked for graphics or slides:
45
+
46
+ | Reference | Media Type | Deliverable |
47
+ |---|---|---|
48
+ | `references/slides.md` | Presentation | HTML pitch decks with Chart.js |
49
+ | `references/slides-html-template.md` | Presentation | Reusable semantic HTML slide boilerplate |
50
+ | `references/slides-layout-patterns.md` | Presentation | Bento, split, timeline, and metric slide layouts |
51
+ | `references/slides-copywriting-formulas.md`| Presentation | Executive storytelling and slide messaging formulas |
52
+ | `references/slides-strategies.md` | Presentation | Slide deck pacing and structural strategies |
53
+ | `references/banner-sizes-and-styles.md` | Graphic Design | Social and display ad banner specifications (22 styles) |
54
+ | `references/social-photos-design.md` | Graphic Design | OpenGraph, Twitter card, and social post graphics |
55
+ | `references/logo-design.md` | Identity | SVG logo prompts, geometric/minimalist styles |
56
+ | `references/cip-design.md` | Identity | Corporate Identity Program (stationery, collateral) |
57
+ | `references/icon-design.md` | Graphic Design | Vector SVG icon design protocols (15 styles) |
58
+ | `references/executive-reports.md` | Documentation | High-density technical and executive report templates |
59
+ | `references/image-mockup-direction.md` | Mockup | 3D device mockup composition guides |
60
+
61
+ ---
62
+
63
+ ### Tier 4: Archived & Superset References (Retained for Provenance)
64
+ These references represent earlier iterations or raw vocabulary sources:
65
+
66
+ - `references/intake.md`: Early English brief intake (superseded by `brief-intake.md` v2.3).
67
+ - `references/redesign.md`: Legacy redesign notes (superseded by `web-retrofit-protocol.md`).
68
+ - `references/vocabulary.md`: Legacy UI vocabulary (superseded by `vocab-protocol.md` and `ui-ux-vocabulary-vault.md`).
69
+ - `references/ui-ux-vocabulary-vault.md` & `ui-ux-vocabulary-vault.json`: 90KB raw lexicon vault used by discovery indexing.
70
+
71
+ ---
72
+
73
+ ## 2. Design Decision Matrix (Context-Driven Architecture)
74
+
75
+ Design decisions must be derived from context, not arbitrary taste. Never force a single archetype or visual style across different products:
76
+
77
+ | Product Domain | Target Audience | Spatial Model | Recommended Typography | Primary Palette | Motion Profile |
78
+ |---|---|---|---|---|---|
79
+ | **B2B SaaS / Admin** | Technical Operators, Admins | Bento / Column Grid (Dense) | Geist / Inter + JetBrains Mono | Monochromatic Slate + Vibrant Action | `spring-settle` (160ms) |
80
+ | **GIS / Cadastre / Mapping** | Surveyors, Civil Engineers | 16:10 Split Canvas + Data Shelf | JetBrains Mono + IBM Plex Sans Thai | Ultra-Dark Obsidian + Electric Cyan (#00f5fb) | `precision` (120ms max) |
81
+ | **Telemetry / Industrial** | Operations Center, SREs | Multi-Pane Cockpit (100dvh) | Tabular Monospace | High-Contrast Charcoal + Passed Emerald | `instant` / `precision` |
82
+ | **FinTech / Banking** | Institutional / Retail Investors | Tabular Density + Key Metrics | Plus Jakarta Sans + Tabular Mono | Deep Navy / Forest + Restrained Gold/Emerald | `precision` (140ms) |
83
+ | **Consumer / E-Commerce** | Everyday Consumers | Fluid Editorial / Story Grid | Plus Jakarta Sans / Cabinet Grotesk | Warm Neutral + Product Accent | `soft-settle` (240ms) |
84
+ | **Developer Tooling** | Software Engineers | Terminal-First / Split Pane | Geist Sans + Geist Mono | Deep Void / Monochrome Carbon | `instant` (0-80ms) |
85
+ | **Public Sector / Utility** | General Public (High Diversity) | Simple Linear / Card Stack | Inter + System Sans (WCAG AAA) | High-Contrast Neutral + Accessible Blue | None / `soft-settle` |
86
+
87
+ ---
88
+
89
+ ## 3. Anti-Default Guarantees (No Universal Style)
90
+
91
+ ME-DESIGN strictly forbids enforcing the following as universal requirements:
92
+ 1. **No Forced Dark Mode:** Choose light, dark, or system-adaptive based entirely on product domain and lighting environment.
93
+ 2. **No Forced Bento Grid:** Use Bento layouts only when content units have genuine hierarchical asymmetry. Never distort tabular data into Bento boxes.
94
+ 3. **No Forced 3-Pane Cockpit:** Reserve 3-pane spatial layouts for map-centric, CAD, or telemetry tools. Never apply cockpit layouts to landing pages or mobile applications.
95
+ 4. **No Forced Neon Accents:** Saturated OKLCH cyan/magenta is suitable for technical displays; consumer, medical, and banking products require restrained semantic colors.
96
+ 5. **No Universal Font:** Thai requires Latin fonts defined first (`"Plus Jakarta Sans", "IBM Plex Sans Thai"`), with `line-height >= 1.7` to prevent diacritic clipping.
@@ -8,7 +8,7 @@
8
8
  - `MOTION_INTENSITY = 6/10` (Spring Physics `cubic-bezier(0.22, 1, 0.36, 1)` สำหรับ Hover/Drawer + 0ms Instant State Sync สำหรับการสลับเหรียญ/กรองตาราง + เคารพ `@media (prefers-reduced-motion: reduce)`)
9
9
  - `VISUAL_DENSITY = 7–8/10` (High-Craft Telemetry Density: ใช้ `font-variant-numeric: tabular-nums` ทุกตัวเลขราคา/พิกัด/เวลา, ช่องว่างภายในสัมพันธ์กับรัศมีขอบ)
10
10
  - **Gapless Bento & Viewport Budget:**
11
- - กริดแบบ Bento ต้องใส่ `grid-auto-flow: dense;` เสมอเพื่อไม่ให้เกิดหลุมว่าง (No orphan grid holes)
11
+ - กริดแบบ Bento ให้จัดวางด้วย `grid-auto-flow: row;` ร่วมกับ Named Grid Areas หรือวางคอลัมน์ให้เต็มพอดี (ห้ามใช้ `grid-auto-flow: dense;` เด็ดขาด เพื่อป้องกัน DOM/Tab Order สลับตำแหน่งตามกฎ MD101)
12
12
  - ใช้ `min-height: 100dvh;` แทน `100vh` และล็อก `overflow-x: hidden;` บน `body`
13
13
  - **Viewport Budget:** ใน 1 หน้าจอแรก (Above the Fold) ห้ามมีกลุ่มองค์ประกอบแยกกันเกิน 3 โซนหลัก และต้องมีพื้นที่ว่าง (Whitespace / Surface Canvas) อย่างน้อย 25%
14
14
 
@@ -62,15 +62,12 @@
62
62
  - "Join [notable company] and [notable company]"
63
63
  - "As seen in [publication]"
64
64
 
65
- ## Search Commands
65
+ ## Formula Selection Heuristic
66
66
 
67
- ```bash
68
- # Find formula for slide type
69
- python ../design-system/scripts/search-slides.py "problem agitation" -d copy
70
-
71
- # Get emotion-appropriate formula
72
- python ../design-system/scripts/search-slides.py "urgency cta" -d copy
73
- ```
67
+ - **Cold Audiences:** Start with PAS (Pain, Agitate, Solve)
68
+ - **Feature Announcements:** Use FAB (Features, Advantages, Benefits)
69
+ - **High-Stakes Pitches:** Lead with Problem-Agitation into Inevitable Solution
70
+ - **Action / Conversion Slides:** Conclude with Clear Urgency CTA
74
71
 
75
72
  ## Quick Reference
76
73
 
@@ -109,29 +109,14 @@
109
109
  | `contrast-pair` | Before/after |
110
110
  | `logo-grayscale` | Client logos |
111
111
 
112
- ## Search Commands
113
-
114
- ```bash
115
- # Find layout for specific use
116
- python ../design-system/scripts/search-slides.py "metrics dashboard" -d layout
117
-
118
- # Contextual recommendation
119
- python ../design-system/scripts/search-slides.py "traction slide" \
120
- --context --position 4 --total 10
121
- ```
122
-
123
112
  ## Layout Decision Flow
124
113
 
125
- ```
126
- 1. What's the slide goal?
127
- └─> Search layout-logic.csv
128
-
129
- 2. What emotion should it trigger?
130
- └─> Search color-logic.csv
114
+ 1. **What is the slide goal?**
115
+ - High Impact Intro -> Hero Pattern
116
+ - Metric Comparison -> Split Comparison or 3-Card Bento
117
+ - Sequence of Events -> Timeline Pattern
118
+ - Multi-feature Overview -> 4-Column Feature Grid
131
119
 
132
- 3. What's the content type?
133
- └─> Search typography.csv
134
-
135
- 4. Should it break pattern?
136
- └─> Check position (1/3, 2/3) → Use full-bleed
137
- ```
120
+ 2. **What visual density is required?**
121
+ - Executive / Pitch: Low density, high whitespace (40%+ canvas)
122
+ - Technical Review: High tabular density with Chart.js container
@@ -72,16 +72,6 @@ What Is → What Could Be → What Is → What Could Be → New Bliss
72
72
 
73
73
  Pattern breaks at 1/3 and 2/3 positions create engagement peaks.
74
74
 
75
- ## Search Commands
76
-
77
- ```bash
78
- # Find strategy by goal
79
- python ../design-system/scripts/search-slides.py "investor pitch" -d strategy
80
-
81
- # Get emotion arc
82
- python ../design-system/scripts/search-slides.py "series a funding" -d strategy --json
83
- ```
84
-
85
75
  ## Matching Strategy to Context
86
76
 
87
77
  | Context | Recommended Strategy |
@@ -61,6 +61,11 @@ if (!fs.existsSync(targetFile)) {
61
61
  process.exit(2);
62
62
  }
63
63
 
64
+ if (typeof WebSocket === 'undefined') {
65
+ console.error(`${ANSI_RED}Error:${ANSI_RESET} Headless browser audit requires native WebSocket support (Node.js >= 20.10.0 or Node.js >= 22). Current: ${process.version}`);
66
+ process.exit(2);
67
+ }
68
+
64
69
  const resolvedPath = path.resolve(targetFile);
65
70
  const fileUrl = 'file:///' + resolvedPath.replace(/\\/g, '/');
66
71
 
@@ -367,12 +372,19 @@ async function runAudit() {
367
372
  highContrastOutlineRendered = hasOutline;
368
373
  }
369
374
 
375
+ // Test 4: Viewport Horizontal Overflow Detection
376
+ const docEl = document.documentElement;
377
+ const horizontalOverflow = (docEl.scrollWidth - window.innerWidth) > 2.0;
378
+
370
379
  return {
371
380
  buttonCount: buttons.length,
372
381
  hitTargetViolations,
373
382
  minContrastRatio: Math.round(minContrast * 10) / 10,
374
383
  focusVisibleRendered,
375
384
  highContrastOutlineRendered,
385
+ horizontalOverflow,
386
+ scrollWidth: docEl.scrollWidth,
387
+ viewportWidth: window.innerWidth,
376
388
  debugContrast
377
389
  };
378
390
  })()
@@ -404,8 +416,9 @@ async function runAudit() {
404
416
  const focusPass = isForced
405
417
  ? (r.highContrastOutlineRendered || r.buttonCount === 0)
406
418
  : (r.focusVisibleRendered || r.buttonCount === 0);
419
+ const overflowPass = !r.horizontalOverflow;
407
420
 
408
- if (!contrastPass || !hitTargetPass || !focusPass) overallPass = false;
421
+ if (!contrastPass || !hitTargetPass || !focusPass || !overflowPass) overallPass = false;
409
422
  });
410
423
 
411
424
  if (isJson) {
@@ -420,11 +433,11 @@ async function runAudit() {
420
433
  // Render Matrix Card
421
434
  console.log(`\n${ANSI_BOLD}ME-DESIGN Phase 2 — Browser Verification Matrix${ANSI_RESET}`);
422
435
  console.log(`${ANSI_CYAN}Headless Chromium Runtime Engine (CDP v156)${ANSI_RESET}`);
423
- console.log(`${ANSI_GRAY}────────────────────────────────────────────────────────────────────────${ANSI_RESET}`);
436
+ console.log(`${ANSI_GRAY}────────────────────────────────────────────────────────────────────────────────────────${ANSI_RESET}`);
424
437
  console.log(`Target: ${path.basename(targetFile)}\n`);
425
438
 
426
- console.log(`${'VIEWPORT'.padEnd(10)} | ${'MODE'.padEnd(14)} | ${'CONTRAST'.padEnd(10)} | ${'HIT-TARGET (≥44px)'.padEnd(20)} | ${'TAB FOCUS'.padEnd(10)}`);
427
- console.log(`${ANSI_GRAY}------------------------------------------------------------------------${ANSI_RESET}`);
439
+ console.log(`${'VIEWPORT'.padEnd(10)} | ${'MODE'.padEnd(14)} | ${'CONTRAST'.padEnd(10)} | ${'HIT-TARGET (≥44px)'.padEnd(20)} | ${'TAB FOCUS'.padEnd(12)} | ${'OVERFLOW'}`);
440
+ console.log(`${ANSI_GRAY}----------------------------------------------------------------------------------------${ANSI_RESET}`);
428
441
 
429
442
  auditResults.forEach(r => {
430
443
  const isForced = r.theme === 'forced-colors';
@@ -433,6 +446,7 @@ async function runAudit() {
433
446
  const focusPass = isForced
434
447
  ? (r.highContrastOutlineRendered || r.buttonCount === 0)
435
448
  : (r.focusVisibleRendered || r.buttonCount === 0);
449
+ const overflowPass = !r.horizontalOverflow;
436
450
 
437
451
  const contrastStr = isForced
438
452
  ? ANSI_CYAN + 'SYS-HIGH' + ANSI_RESET
@@ -444,10 +458,14 @@ async function runAudit() {
444
458
 
445
459
  const focusStr = (focusPass ? ANSI_GREEN : ANSI_RED) + (focusPass ? (isForced ? 'OUTLINE OK' : 'VERIFIED') : (isForced ? 'NO OUTLINE' : 'NO FOCUS')) + ANSI_RESET;
446
460
 
447
- console.log(`${r.viewport.padEnd(10)} | ${r.theme.padEnd(14)} | ${contrastStr.padEnd(19)} | ${hitStr.padEnd(31)} | ${focusStr}`);
461
+ const overflowStr = overflowPass
462
+ ? ANSI_GREEN + 'OK (Fit)' + ANSI_RESET
463
+ : ANSI_RED + `FAIL (+${Math.round(r.scrollWidth - r.viewportWidth)}px)` + ANSI_RESET;
464
+
465
+ console.log(`${r.viewport.padEnd(10)} | ${r.theme.padEnd(14)} | ${contrastStr.padEnd(19)} | ${hitStr.padEnd(31)} | ${focusStr.padEnd(21)} | ${overflowStr}`);
448
466
  });
449
467
 
450
- console.log(`${ANSI_GRAY}────────────────────────────────────────────────────────────────────────${ANSI_RESET}`);
468
+ console.log(`${ANSI_GRAY}────────────────────────────────────────────────────────────────────────────────────────${ANSI_RESET}`);
451
469
  if (overallPass) {
452
470
  console.log(`${ANSI_GREEN}${ANSI_BOLD}BROWSER MATRIX VERIFICATION: PASS (Exit Code: 0)${ANSI_RESET}\n`);
453
471
  process.exit(0);