#!/usr/bin/env python3
"""
Generate High-Resolution Architectural Cut Diagrams for 1:12 Scale Dollhouse.
Includes all panels, dimensions (fractions + decimals), and highlighted 1/8" grooves/rabbets.
Polished for maximum clarity, readability, and zero text collisions.
"""

import os
from PIL import Image, ImageDraw, ImageFont

# Dimensions & Output Paths
IMG_WIDTH = 1440
IMG_HEIGHT = 920

OUTPUT_DIRS = [
    r"c:\code2026\house\images",
    r"C:\Users\Hack\.gemini\antigravity\brain\be34cacd-367e-4ed7-819c-8f861ebb0996\images"
]

for d in OUTPUT_DIRS:
    os.makedirs(d, exist_ok=True)

# Load Fonts
try:
    font_title = ImageFont.truetype("arialbd.ttf", 24)
    font_sub = ImageFont.truetype("arial.ttf", 14)
    font_badge = ImageFont.truetype("arialbd.ttf", 15)
    font_dim = ImageFont.truetype("arialbd.ttf", 13)
    font_dim_sub = ImageFont.truetype("arial.ttf", 12)
    font_label = ImageFont.truetype("arialbd.ttf", 14)
    font_notes = ImageFont.truetype("arial.ttf", 13)
    font_notes_bd = ImageFont.truetype("arialbd.ttf", 13)
    font_cutout_title = ImageFont.truetype("arialbd.ttf", 12)
    font_cutout_sub = ImageFont.truetype("arial.ttf", 11)
except Exception:
    font_title = font_sub = font_badge = font_dim = font_dim_sub = font_label = font_notes = font_notes_bd = font_cutout_title = font_cutout_sub = ImageFont.load_default()

# Colors (Clean High-Contrast White Architectural Drafting Theme)
BG_COLOR = (255, 255, 255)         # Pure White Canvas
GRID_COLOR = (241, 245, 249)       # Faint Grid (Slate 100)
CARD_BG = (248, 250, 252)          # Card Header/Footer (Slate 50)
BORDER_COLOR = (148, 163, 184)     # Crisp Card Border (Slate 400)
PANEL_FILL = (241, 245, 249)       # Birch Plywood Drafting Light Tint
PANEL_OUTLINE = (15, 23, 42)       # Bold Dark Slate Outline (Slate 900)
GROOVE_FILL = (254, 243, 199)      # Light Amber 100 Highlight
GROOVE_BORDER = (217, 119, 6)      # Sharp Amber 600 Border/Hatch
RABBET_FILL = (253, 230, 138)      # Amber 200 Highlight
CUTOUT_BG = (254, 226, 226)        # Soft Red/Coral 100 Cutout Background
CUTOUT_BORDER = (220, 38, 38)      # Bold Red 600 Outline
DIM_COLOR = (2, 132, 199)          # Crisp Sky/Cyan Blue 600
DIM_MUTED = (14, 116, 144)         # Deep Cyan 700
TEXT_DARK = (15, 23, 42)           # Dark Slate 900
TEXT_WHITE = TEXT_DARK             # Backward compatible alias for dark text on white bg
TEXT_LIGHT = (255, 255, 255)       # Pure White for Dark Badges
TEXT_MUTED = (71, 85, 105)         # Slate 600
TEXT_AMBER = (180, 83, 9)          # Deep Amber 700
TEXT_EMERALD = (4, 120, 87)        # Deep Emerald 700

def create_base_canvas(part_id, part_name, dimensions_str, scale_str="1:12 Scale • 1/4\" Baltic Birch"):
    """Create blueprint canvas with dynamic title header, grid, and footer notes box."""
    im = Image.new("RGBA", (IMG_WIDTH, IMG_HEIGHT), BG_COLOR)
    draw = ImageDraw.Draw(im)

    # Background grid lines (every 40px)
    for x in range(0, IMG_WIDTH, 40):
        draw.line([(x, 0), (x, IMG_HEIGHT)], fill=GRID_COLOR, width=1)
    for y in range(0, IMG_HEIGHT, 40):
        draw.line([(0, y), (IMG_WIDTH, y)], fill=GRID_COLOR, width=1)

    # Outer border
    draw.rectangle([(20, 20), (IMG_WIDTH - 20, IMG_HEIGHT - 20)], outline=BORDER_COLOR, width=2)

    # Header Card
    draw.rectangle([(20, 20), (IMG_WIDTH - 20, 95)], fill=CARD_BG, outline=BORDER_COLOR, width=2)
    
    # Dynamic Part ID Badge based on text length
    text_w = int(draw.textlength(part_id, font=font_badge))
    badge_w = max(90, text_w + 30)
    badge_h = 42
    draw.rectangle([(35, 36), (35 + badge_w, 36 + badge_h)], fill=(37, 99, 235), outline=(29, 78, 216), width=2)
    draw.text((35 + badge_w / 2, 36 + badge_h / 2), part_id, fill=TEXT_LIGHT, font=font_badge, anchor="mm")

    # Title & Subtitle
    title_x = 35 + badge_w + 20
    draw.text((title_x, 40), f"{part_name} — Shop Cut Sheet & 1/8\" Groove Blueprint", fill=TEXT_DARK, font=font_title)
    draw.text((title_x, 68), f"Ruler Cut Size: {dimensions_str}   |   {scale_str}   |   Thickness: 1/4\" (0.250\")", fill=TEXT_MUTED, font=font_sub)

    # Footer Card
    draw.rectangle([(20, IMG_HEIGHT - 90), (IMG_WIDTH - 20, IMG_HEIGHT - 20)], fill=CARD_BG, outline=BORDER_COLOR, width=2)
    
    return im, draw

def draw_dim_h(draw, x1, x2, y, text_top, text_sub="", arrow_color=DIM_COLOR, ext_lines=True):
    """Draw horizontal dimension line with extension lines, arrows, and center text."""
    if ext_lines:
        draw.line([(x1, y - 8), (x1, y + 8)], fill=arrow_color, width=1)
        draw.line([(x2, y - 8), (x2, y + 8)], fill=arrow_color, width=1)
    draw.line([(x1, y), (x2, y)], fill=arrow_color, width=1)
    # arrows
    draw.polygon([(x1, y), (x1 + 6, y - 3), (x1 + 6, y + 3)], fill=arrow_color)
    draw.polygon([(x2, y), (x2 - 6, y - 3), (x2 - 6, y + 3)], fill=arrow_color)
    
    # text
    mid_x = (x1 + x2) / 2
    draw.text((mid_x, y - 9), text_top, fill=TEXT_WHITE, font=font_dim, anchor="mb")
    if text_sub:
        draw.text((mid_x, y + 5), text_sub, fill=DIM_MUTED, font=font_dim_sub, anchor="mt")

def draw_dim_v(draw, y1, y2, x, text_top, text_sub="", arrow_color=DIM_COLOR, ext_lines=True, text_side="right"):
    """Draw vertical dimension line with extension lines, arrows, and center text."""
    if ext_lines:
        draw.line([(x - 8, y1), (x + 8, y1)], fill=arrow_color, width=1)
        draw.line([(x - 8, y2), (x + 8, y2)], fill=arrow_color, width=1)
    draw.line([(x, y1), (x, y2)], fill=arrow_color, width=1)
    # arrows
    draw.polygon([(x, y1), (x - 3, y1 + 6), (x + 3, y1 + 6)], fill=arrow_color)
    draw.polygon([(x, y2), (x - 3, y2 - 6), (x + 3, y2 - 6)], fill=arrow_color)
    
    # text
    mid_y = (y1 + y2) / 2
    if text_side == "left":
        if text_sub:
            draw.text((x - 12, mid_y - 7), text_top, fill=TEXT_WHITE, font=font_dim, anchor="rm")
            draw.text((x - 12, mid_y + 8), text_sub, fill=DIM_MUTED, font=font_dim_sub, anchor="rm")
        else:
            draw.text((x - 12, mid_y), text_top, fill=TEXT_WHITE, font=font_dim, anchor="rm")
    else:
        if text_sub:
            draw.text((x + 12, mid_y - 7), text_top, fill=TEXT_WHITE, font=font_dim, anchor="lm")
            draw.text((x + 12, mid_y + 8), text_sub, fill=DIM_MUTED, font=font_dim_sub, anchor="lm")
        else:
            draw.text((x + 12, mid_y), text_top, fill=TEXT_WHITE, font=font_dim, anchor="lm")

def draw_hatched_rect(draw, box, fill_color=GROOVE_FILL, border_color=GROOVE_BORDER, step=7):
    """Draw a rectangle with diagonal crosshatching to represent routed grooves/rabbets."""
    x1, y1, x2, y2 = box
    draw.rectangle([x1, y1, x2, y2], fill=fill_color, outline=border_color, width=2)
    # diagonal lines
    width = int(x2 - x1)
    height = int(y2 - y1)
    for offset in range(-height, width, step):
        px1 = max(x1, min(x2, x1 + offset))
        py1 = y1
        px2 = max(x1, min(x2, x1 + offset + (y2 - y1)))
        py2 = y2
        draw.line([(px1, py1), (px2, py2)], fill=border_color, width=1)

def draw_cutout_box(draw, box, title, sub=""):
    """Draw a high-contrast cutout box with readable text."""
    x1, y1, x2, y2 = box
    draw.rectangle([x1, y1, x2, y2], fill=CUTOUT_BG, outline=CUTOUT_BORDER, width=2)
    mid_x = (x1 + x2) / 2
    mid_y = (y1 + y2) / 2
    if sub:
        draw.text((mid_x, mid_y - 7), title, fill=TEXT_WHITE, font=font_cutout_title, anchor="mm", align="center")
        draw.text((mid_x, mid_y + 9), sub, fill=TEXT_AMBER, font=font_cutout_sub, anchor="mm", align="center")
    else:
        draw.text((mid_x, mid_y), title, fill=TEXT_WHITE, font=font_cutout_title, anchor="mm", align="center")

def save_image(im, filename):
    for d in OUTPUT_DIRS:
        dest = os.path.join(d, filename)
        im.save(dest, "PNG")
    print(f"Generated: {filename}")

# ==============================================================================
# 1. BASE DECK A1 (32" x 12")
# ==============================================================================
def gen_cut_01_a1():
    im, draw = create_base_canvas("A1", "Base Platform Plate (Level 1)", "32\" × 12\" (32.00\" × 12.00\")")
    
    ox, oy = 250, 270
    scale = 28.0
    pw = 32.0 * scale   # 896
    ph = 12.0 * scale   # 336

    # Main Deck Plate
    draw.rectangle([(ox, oy), (ox + pw, oy + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)
    
    # Left Edge Rabbet (X = 0 to 1/4")
    rx1, rx2 = ox, ox + 0.25 * scale
    draw_hatched_rect(draw, (rx1, oy, rx2, oy + ph), RABBET_FILL, GROOVE_BORDER, step=5)
    
    # Right Edge Rabbet (X = 31-3/4" to 32")
    rx3, rx4 = ox + 31.75 * scale, ox + pw
    draw_hatched_rect(draw, (rx3, oy, rx4, oy + ph), RABBET_FILL, GROOVE_BORDER, step=5)

    # Groove 1 (for D1-A Living/Kitchen): X = 11-3/4" to 12"
    g1x1 = ox + 11.75 * scale
    g1x2 = ox + 12.00 * scale
    draw_hatched_rect(draw, (g1x1, oy, g1x2, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    
    # Groove 2 (for D1-B Kitchen/Foyer): X = 23-1/2" to 23-3/4"
    g2x1 = ox + 23.50 * scale
    g2x2 = ox + 23.75 * scale
    draw_hatched_rect(draw, (g2x1, oy, g2x2, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)

    # Room Labels
    draw.text((ox + 5.875 * scale, oy + ph/2 - 10), "LIVING ROOM ZONE", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.text((ox + 5.875 * scale, oy + ph/2 + 15), "11-1/2\" W (11.50\")", fill=TEXT_AMBER, font=font_dim, anchor="mm")
    
    draw.text((ox + 17.75 * scale, oy + ph/2 - 10), "KITCHEN ZONE", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.text((ox + 17.75 * scale, oy + ph/2 + 15), "11-1/2\" W (11.50\")", fill=TEXT_EMERALD, font=font_dim, anchor="mm")

    draw.text((ox + 27.75 * scale, oy + ph/2 - 10), "FOYER ZONE", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.text((ox + 27.75 * scale, oy + ph/2 + 15), "8\" W (8.00\")", fill=TEXT_AMBER, font=font_dim, anchor="mm")

    # Callouts for 1/8" Grooves (Positioned neatly above without collision)
    # Groove 1 Callout
    draw.line([(g1x1 + 3, oy + 40), (g1x1 - 30, oy - 70)], fill=TEXT_AMBER, width=2)
    draw.rectangle([(g1x1 - 180, oy - 110), (g1x1 + 40, oy - 65)], fill=CARD_BG, outline=GROOVE_BORDER, width=2)
    draw.text((g1x1 - 70, oy - 98), "1/8\" GROOVE: D1-A (Living/Kit)", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((g1x1 - 70, oy - 78), "X = 11-3/4\" to 12\" | Center = 11-7/8\"", fill=TEXT_WHITE, font=font_dim_sub, anchor="mm")

    # Groove 2 Callout
    draw.line([(g2x1 + 3, oy + 40), (g2x1 - 30, oy - 70)], fill=TEXT_AMBER, width=2)
    draw.rectangle([(g2x1 - 160, oy - 110), (g2x1 + 60, oy - 65)], fill=CARD_BG, outline=GROOVE_BORDER, width=2)
    draw.text((g2x1 - 50, oy - 98), "1/8\" GROOVE: D1-B (Kit/Foyer)", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((g2x1 - 50, oy - 78), "X = 23-1/2\" to 23-3/4\" | Center = 23-5/8\"", fill=TEXT_WHITE, font=font_dim_sub, anchor="mm")

    # Rabbet Callouts
    draw.line([(rx1 + 3, oy + 60), (rx1 - 35, oy + 90)], fill=TEXT_AMBER, width=2)
    draw.text((rx1 - 40, oy + 90), "1/4\" W × 1/8\" D End Rabbet\n(Receives Left Gable B1)", fill=TEXT_AMBER, font=font_dim_sub, anchor="rm")
    
    draw.line([(rx4 - 3, oy + 60), (rx4 + 35, oy + 90)], fill=TEXT_AMBER, width=2)
    draw.text((rx4 + 40, oy + 90), "1/4\" W × 1/8\" D End Rabbet\n(Receives Right Gable B2)", fill=TEXT_AMBER, font=font_dim_sub, anchor="lm")

    # Dimensions
    draw_dim_h(draw, ox, ox + pw, oy - 25, "32\" (32.00\") OVERALL BASE DECK WIDTH", "")
    
    # Bottom segment dimensions
    dim_y_bot = oy + ph + 35
    draw_dim_h(draw, ox + 0.25*scale, g1x1, dim_y_bot, "11-1/2\" Living", "")
    draw_dim_h(draw, g1x2, g2x1, dim_y_bot, "11-1/2\" Kitchen", "")
    draw_dim_h(draw, g2x2, ox + 31.75*scale, dim_y_bot, "8\" Foyer", "")

    # Vertical depth 12"
    draw_dim_v(draw, oy, oy + ph, ox - 35, "12\" (12.00\")", "Depth")

    # Orientation notes
    draw.text((ox + pw/2, oy + ph - 18), "▲ FRONT OF HOUSE (Z = 0) ▲", fill=TEXT_WHITE, font=font_badge, anchor="mm")
    draw.text((ox + pw/2, oy + 18), "▼ OPEN REAR OF HOUSE (Z = 12\") ▼", fill=TEXT_MUTED, font=font_badge, anchor="mm")

    # Footer Notes
    draw.text((45, IMG_HEIGHT - 75), "WOODWORKING SHOP INSTRUCTIONS FOR DECK A1:", fill=TEXT_AMBER, font=font_notes_bd)
    draw.text((45, IMG_HEIGHT - 55), "1. Set table saw blade height or router bit to exactly 1/8\" (0.125\"). Fence at 11-3/4\" (D1-A) and 23-1/2\" (D1-B). Take 2 passes for 1/4\" width.", fill=TEXT_WHITE, font=font_notes)
    draw.text((45, IMG_HEIGHT - 35), "2. Cut outer end rabbets (1/4\" W x 1/8\" D) on left and right ends. Both partitions and gable side walls seat 1/8\" deep, locking 90° square.", fill=TEXT_MUTED, font=font_notes)

    save_image(im, "cut_01_A1_base_deck.png")

# ==============================================================================
# 2. SECOND FLOOR DECK A2 (Top Face & Underside Dual Detail)
# ==============================================================================
def gen_cut_02_a2():
    im, draw = create_base_canvas("A2", "Second Floor Deck (Dual Face Detail)", "32\" × 12\" (32.00\" × 12.00\") • Stair Opening & Grooves")

    scale = 19.5
    pw = 32.0 * scale   # 624px
    ph = 12.0 * scale   # 234px

    # Deck 1: TOP FACE (2nd Floor Floor Grooves)
    ox1, oy1 = 80, 160
    draw.text((ox1 + pw/2, oy1 - 30), "VIEW 1: TOP FACE (2nd Floor Floor Grooves & Stair Well)", fill=TEXT_AMBER, font=font_label, anchor="mm")
    draw.rectangle([(ox1, oy1), (ox1 + pw, oy1 + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=2)

    # Stair opening at front-right: X = 29-1/2" to 31-3/4", Z = 0 to 6"
    sx1 = ox1 + 29.5 * scale
    sx2 = ox1 + 31.75 * scale
    sy1 = oy1 + ph - 6.0 * scale
    sy2 = oy1 + ph
    draw_cutout_box(draw, (sx1, sy1, sx2, sy2), "STAIR WELL", "2-1/4\" × 6\"")

    # D2-A Groove (Bath / Women): X = 6-1/4" to 6-1/2"
    g1x1 = ox1 + 6.25 * scale
    g1x2 = ox1 + 6.50 * scale
    draw_hatched_rect(draw, (g1x1, oy1, g1x2, oy1 + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((g1x1 + 2, oy1 - 12), "D2-A (6-1/4\" to 6-1/2\")", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mb")

    # D2-B Groove (Women / Mans): X = 19" to 19-1/4"
    g2x1 = ox1 + 19.00 * scale
    g2x2 = ox1 + 19.25 * scale
    draw_hatched_rect(draw, (g2x1, oy1, g2x2, oy1 + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((g2x1 + 2, oy1 - 12), "D2-B (19\" to 19-1/4\")", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mb")

    # End rabbets
    draw_hatched_rect(draw, (ox1, oy1, ox1 + 0.25*scale, oy1 + ph), RABBET_FILL, GROOVE_BORDER, step=4)
    draw_hatched_rect(draw, (ox1 + 31.75*scale, oy1, ox1 + pw, oy1 + ph), RABBET_FILL, GROOVE_BORDER, step=4)

    # Room notes
    draw.text((ox1 + 3.25*scale, oy1 + ph/2), "BATH\n6\" W (6.00\")", fill=TEXT_WHITE, font=font_dim, anchor="mm", align="center")
    draw.text((ox1 + 12.75*scale, oy1 + ph/2), "WOMEN ROOM\n12-1/2\" W (12.50\")", fill=TEXT_WHITE, font=font_dim, anchor="mm", align="center")
    draw.text((ox1 + 25.5*scale, oy1 + ph/2), "MANS ROOM\n12-1/2\" W (12.50\")", fill=TEXT_WHITE, font=font_dim, anchor="mm", align="center")

    draw_dim_h(draw, ox1, ox1 + pw, oy1 + ph + 45, "32\" (32.00\") CARCASS WIDTH", "")
    draw_dim_v(draw, oy1, oy1 + ph, ox1 - 25, "12\"", "")

    # Deck 2: UNDERSIDE (1st Floor Ceiling Grooves)
    ox2, oy2 = 740, 160
    draw.text((ox2 + pw/2, oy2 - 30), "VIEW 2: UNDERSIDE (1st Floor Ceiling Grooves)", fill=TEXT_EMERALD, font=font_label, anchor="mm")
    draw.rectangle([(ox2, oy2), (ox2 + pw, oy2 + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=2)

    # Stair opening shown from underside
    ssx1 = ox2 + 29.5 * scale
    ssx2 = ox2 + 31.75 * scale
    ssy1 = oy2 + ph - 6.0 * scale
    ssy2 = oy2 + ph
    draw_cutout_box(draw, (ssx1, ssy1, ssx2, ssy2), "STAIR WELL", "Cutout")

    # Underside Grooves (D1-A and D1-B top edges)
    ug1x1 = ox2 + 11.75 * scale
    ug1x2 = ox2 + 12.00 * scale
    draw_hatched_rect(draw, (ug1x1, oy2, ug1x2, oy2 + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((ug1x1 + 2, oy2 - 12), "D1-A Top (11-3/4\" to 12\")", fill=TEXT_EMERALD, font=font_cutout_sub, anchor="mb")

    ug2x1 = ox2 + 23.50 * scale
    ug2x2 = ox2 + 23.75 * scale
    draw_hatched_rect(draw, (ug2x1, oy2, ug2x2, oy2 + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((ug2x1 + 2, oy2 - 12), "D1-B Top (23-1/2\" to 23-3/4\")", fill=TEXT_EMERALD, font=font_cutout_sub, anchor="mb")

    # End rabbets
    draw_hatched_rect(draw, (ox2, oy2, ox2 + 0.25*scale, oy2 + ph), RABBET_FILL, GROOVE_BORDER, step=4)
    draw_hatched_rect(draw, (ox2 + 31.75*scale, oy2, ox2 + pw, oy2 + ph), RABBET_FILL, GROOVE_BORDER, step=4)

    draw_dim_h(draw, ox2, ox2 + pw, oy2 + ph + 45, "32\" (32.00\") CARCASS WIDTH", "")

    # Lower Info Box explaining dual machining
    draw.rectangle([(80, oy1 + ph + 65), (IMG_WIDTH - 80, oy1 + ph + 225)], fill=CARD_BG, outline=BORDER_COLOR, width=2)
    draw.text((100, oy1 + ph + 85), "CRITICAL 2-SIDED MACHINING INSTRUCTIONS FOR DECK A2:", fill=TEXT_AMBER, font=font_badge)
    draw.text((100, oy1 + ph + 115), "• Top Face receives two 1/8\" deep grooves for 2nd floor partitions (D2-A at 6-1/4\" and D2-B at 19\").", fill=TEXT_WHITE, font=font_notes)
    draw.text((100, oy1 + ph + 140), "• Underside receives two 1/8\" deep grooves for 1st floor partition tops (D1-A at 11-3/4\" and D1-B at 23-1/2\").", fill=TEXT_WHITE, font=font_notes)
    draw.text((100, oy1 + ph + 165), "• Cut stair opening (2-1/4\" x 6\") along right front corner (X = 29-1/2\" to 31-3/4\", Z = 0 to 6\") BEFORE carcass assembly!", fill=TEXT_EMERALD, font=font_notes_bd)
    draw.text((100, oy1 + ph + 195), "• Notice: D2-B groove is at X = 19\", leaving a massive 10-1/4\" of open floor space before the stair opening!", fill=TEXT_MUTED, font=font_notes)

    # Footer Notes
    draw.text((45, IMG_HEIGHT - 65), "Batch Tip: Cut underside grooves of A2 at the exact same table saw fence settings as the top face of Base A1!", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_02_A2_2nd_floor_deck.png")

# ==============================================================================
# 3. ATTIC FLOOR DECK A3 (32" x 12" Underside Ceiling Grooves)
# ==============================================================================
def gen_cut_03_a3():
    im, draw = create_base_canvas("A3", "Attic Floor Deck Plate", "32\" × 12\" (32.00\" × 12.00\") • Solid Deck with Underside Grooves")

    ox, oy = 250, 270
    scale = 28.0
    pw = 32.0 * scale
    ph = 12.0 * scale

    draw.rectangle([(ox, oy), (ox + pw, oy + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)

    # Left & Right end rabbets (1/4" x 1/8")
    draw_hatched_rect(draw, (ox, oy, ox + 0.25*scale, oy + ph), RABBET_FILL, GROOVE_BORDER, step=5)
    draw_hatched_rect(draw, (ox + 31.75*scale, oy, ox + pw, oy + ph), RABBET_FILL, GROOVE_BORDER, step=5)

    # Underside Grooves for D2-A and D2-B top edges
    g1x1 = ox + 6.25 * scale
    g1x2 = ox + 6.50 * scale
    draw_hatched_rect(draw, (g1x1, oy, g1x2, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)

    g2x1 = ox + 19.00 * scale
    g2x2 = ox + 19.25 * scale
    draw_hatched_rect(draw, (g2x1, oy, g2x2, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)

    # Zone labels
    draw.text((ox + 3.25*scale, oy + ph/2), "BATHROOM CEILING", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.text((ox + 12.75*scale, oy + ph/2), "WOMEN ROOM CEILING", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.text((ox + 25.5*scale, oy + ph/2), "MANS ROOM CEILING", fill=TEXT_WHITE, font=font_label, anchor="mm")

    # Dimensions
    draw_dim_h(draw, ox, ox + pw, oy - 25, "32\" (32.00\") OVERALL ATTIC DECK LENGTH", "Solid Clean Deck (Zero Chimney Holes)")
    draw_dim_h(draw, ox + 0.25*scale, g1x1, oy + ph + 35, "6\" (6.00\") Bath", "")
    draw_dim_h(draw, g1x2, g2x1, oy + ph + 35, "12-1/2\" (12.50\") Women Room", "")
    draw_dim_h(draw, g2x2, ox + 31.75*scale, oy + ph + 35, "12-1/2\" (12.50\") Mans Room", "")
    draw_dim_v(draw, oy, oy + ph, ox - 35, "12\" (12.00\")", "Depth", text_side="left")

    # Callouts
    draw.line([(g1x1 + 3, oy + 40), (g1x1 - 30, oy - 70)], fill=TEXT_AMBER, width=2)
    draw.rectangle([(g1x1 - 160, oy - 110), (g1x1 + 60, oy - 65)], fill=CARD_BG, outline=GROOVE_BORDER, width=2)
    draw.text((g1x1 - 50, oy - 98), "1/8\" GROOVE: D2-A TOP", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((g1x1 - 50, oy - 78), "X = 6-1/4\" to 6-1/2\" | Center = 6-3/8\"", fill=TEXT_WHITE, font=font_dim_sub, anchor="mm")

    draw.line([(g2x1 + 3, oy + 40), (g2x1 - 30, oy - 70)], fill=TEXT_AMBER, width=2)
    draw.rectangle([(g2x1 - 160, oy - 110), (g2x1 + 60, oy - 65)], fill=CARD_BG, outline=GROOVE_BORDER, width=2)
    draw.text((g2x1 - 50, oy - 98), "1/8\" GROOVE: D2-B TOP", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((g2x1 - 50, oy - 78), "X = 19\" to 19-1/4\" | Center = 19-1/8\"", fill=TEXT_WHITE, font=font_dim_sub, anchor="mm")

    # Footer Notes
    draw.text((45, IMG_HEIGHT - 65), "Deck A3 separates the 2nd floor from the open finished attic. The top face remains completely flat and smooth.", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_03_A3_attic_floor_deck.png")

# ==============================================================================
# 4. LEFT GABLE WALL B1 (12" x 27" with Rabbets & Dados)
# ==============================================================================
def gen_cut_04_b1():
    im, draw = create_base_canvas("B1", "Left Exterior Gable Side Wall", "12\" W × 24.90\" H (12.00\" × 24.90\") • 8.40\" Roof Rise (54.5° Pitch)")

    scale = 21.0
    pw = 12.0 * scale       # 252px
    ph_wall = 16.5 * scale  # 346.5px
    ph_peak = 8.40 * scale  # 176.4px
    ox, oy_base = 420, 705

    pts = [
        (ox, oy_base),
        (ox + pw, oy_base),
        (ox + pw, oy_base - ph_wall),
        (ox + pw/2, oy_base - ph_wall - ph_peak),
        (ox, oy_base - ph_wall)
    ]
    draw.polygon(pts, fill=PANEL_FILL, outline=PANEL_OUTLINE)

    # 1. Front Vertical Corner Edge Rabbet: Z = 0 to 1/4", Y = 0 to 16.5"
    rx1, rx2 = ox, ox + 0.25 * scale
    ry1, ry2 = oy_base - ph_wall, oy_base
    draw_hatched_rect(draw, (rx1, ry1, rx2, ry2), RABBET_FILL, GROOVE_BORDER, step=5)

    # 2. Horizontal Deck Housing Rabbets & Dados:
    draw_hatched_rect(draw, (ox, oy_base - 0.25*scale, ox + pw, oy_base), RABBET_FILL, GROOVE_BORDER, step=5)
    a2_y2 = oy_base - 8.25 * scale
    a2_y1 = oy_base - 8.50 * scale
    draw_hatched_rect(draw, (ox, a2_y1, ox + pw, a2_y2), GROOVE_FILL, GROOVE_BORDER, step=5)
    a3_y2 = oy_base - 16.25 * scale
    a3_y1 = oy_base - 16.50 * scale
    draw_hatched_rect(draw, (ox, a3_y1, ox + pw, a3_y2), GROOVE_FILL, GROOVE_BORDER, step=5)

    # 3. Living Room Side Window Cutout:
    win_w = 2.25 * scale
    win_h = 5.00 * scale
    wx1 = ox + 6.0 * scale - win_w / 2
    wx2 = wx1 + win_w
    wy2 = oy_base - 1.50 * scale
    wy1 = wy2 - win_h
    draw_cutout_box(draw, (wx1, wy1, wx2, wy2), "LIVING WINDOW", "2-1/4\" × 5\" (Z = 6\")")

    # 4. 2nd Floor Solid Wall Notice
    draw.text((ox + pw/2, oy_base - 12.5*scale), "2ND FLOOR BATHROOM SIDE WALL\n★ ZERO SIDE WINDOWS (SOLID BIRCH) ★", fill=TEXT_AMBER, font=font_badge, anchor="mm", align="center")

    # 5. Attic Gable Zone Notice
    draw.text((ox + pw/2, oy_base - 20.5*scale), "ATTIC GABLE ZONE\n8.40\" (8-3/8\") Peak Rise\n(54.5° Pitch • Reduced 20%)", fill=TEXT_MUTED, font=font_badge, anchor="mm", align="center")

    # Dimensions
    draw_dim_h(draw, ox, ox + pw, oy_base + 35, "12\" (12.00\") DEPTH", "Front (Z=0) to Rear (Z=12)")
    draw_dim_v(draw, oy_base - ph_wall, oy_base, ox - 45, "16-1/2\" (16.50\")", "Wall to Eave")
    draw_dim_v(draw, oy_base - ph_wall - ph_peak, oy_base, ox - 110, "24.90\" (24-7/8\")", "Total to Peak")
    draw_dim_v(draw, oy_base - ph_wall - ph_peak, oy_base - ph_wall, ox + pw + 35, "8.40\" (8-3/8\")", "Gable Peak Rise", text_side="right")

    # Callouts for Rabbets
    draw.line([(rx1 + 3, ry1 + 30), (rx1 - 130, ry1 + 30)], fill=TEXT_AMBER, width=2)
    draw.rectangle([(rx1 - 380, ry1 + 5), (rx1 - 130, ry1 + 55)], fill=CARD_BG, outline=GROOVE_BORDER, width=2)
    draw.text((rx1 - 255, ry1 + 20), "VERTICAL FRONT CORNER RABBET", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((rx1 - 255, ry1 + 40), "1/4\" W × 1/8\" D (Y = 0 to 16-1/2\") for Front C1", fill=TEXT_DARK, font=font_dim_sub, anchor="mm")

    # Callout for A2 Dado
    draw.line([(ox + pw - 20, a2_y2 - 2), (ox + pw + 70, a2_y2 - 2)], fill=TEXT_AMBER, width=2)
    draw.rectangle([(ox + pw + 70, a2_y2 - 25), (ox + pw + 340, a2_y2 + 30)], fill=CARD_BG, outline=GROOVE_BORDER, width=2)
    draw.text((ox + pw + 205, a2_y2 - 10), "2ND FLOOR DECK DADO (A2)", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((ox + pw + 205, a2_y2 + 12), "1/4\" W × 1/8\" D at Y = 8-1/4\" to 8-1/2\"", fill=TEXT_DARK, font=font_dim_sub, anchor="mm")

    # Callout for A3 Dado
    draw.line([(ox + pw - 20, a3_y2 - 2), (ox + pw + 70, a3_y2 - 2)], fill=TEXT_AMBER, width=2)
    draw.rectangle([(ox + pw + 70, a3_y2 - 25), (ox + pw + 340, a3_y2 + 30)], fill=CARD_BG, outline=GROOVE_BORDER, width=2)
    draw.text((ox + pw + 205, a3_y2 - 10), "ATTIC FLOOR DECK DADO (A3)", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((ox + pw + 205, a3_y2 + 12), "1/4\" W × 1/8\" D at Y = 16-1/4\" to 16-1/2\"", fill=TEXT_DARK, font=font_dim_sub, anchor="mm")

    # Footer
    draw.text((45, IMG_HEIGHT - 65), "Left Gable B1 total height is 24.90\" (16-1/2\" eave + 8.40\" peak rise). Zero side windows upstairs. All horizontal decks slide into 1/8\" dados.", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_04_B1_left_gable_wall.png")

# ==============================================================================
# 5. RIGHT GABLE WALL B2 (12" x 27" with Foyer Window at Z=9")
# ==============================================================================
def gen_cut_05_b2():
    im, draw = create_base_canvas("B2", "Right Exterior Gable Side Wall", "12\" W × 24.90\" H (12.00\" × 24.90\") • 8.40\" Roof Rise (54.5° Pitch) • Foyer Window at Z = 9\"")

    scale = 21.0
    pw = 12.0 * scale
    ph_wall = 16.5 * scale
    ph_peak = 8.40 * scale
    ox, oy_base = 420, 705

    pts = [
        (ox, oy_base),
        (ox + pw, oy_base),
        (ox + pw, oy_base - ph_wall),
        (ox + pw/2, oy_base - ph_wall - ph_peak),
        (ox, oy_base - ph_wall)
    ]
    draw.polygon(pts, fill=PANEL_FILL, outline=PANEL_OUTLINE)

    # 1. Front Vertical Corner Edge Rabbet: Z = 0 to 1/4"
    draw_hatched_rect(draw, (ox, oy_base - ph_wall, ox + 0.25*scale, oy_base), RABBET_FILL, GROOVE_BORDER, step=5)

    # 2. Horizontal Deck Housing Rabbets & Dados:
    draw_hatched_rect(draw, (ox, oy_base - 0.25*scale, ox + pw, oy_base), RABBET_FILL, GROOVE_BORDER, step=5)
    a2_y2 = oy_base - 8.25 * scale
    a2_y1 = oy_base - 8.50 * scale
    draw_hatched_rect(draw, (ox, a2_y1, ox + pw, a2_y2), GROOVE_FILL, GROOVE_BORDER, step=5)
    a3_y2 = oy_base - 16.25 * scale
    a3_y1 = oy_base - 16.50 * scale
    draw_hatched_rect(draw, (ox, a3_y1, ox + pw, a3_y2), GROOVE_FILL, GROOVE_BORDER, step=5)

    # 3. Foyer Side Window Cutout:
    win_w = 2.25 * scale
    win_h = 5.00 * scale
    wx1 = ox + 9.0 * scale - win_w / 2
    wx2 = wx1 + win_w
    wy2 = oy_base - 1.50 * scale
    wy1 = wy2 - win_h
    draw_cutout_box(draw, (wx1, wy1, wx2, wy2), "FOYER WINDOW", "2-1/4\" × 5\" (Z = 9\")")

    # Stair Position Outline
    stair_x1 = ox
    stair_x2 = ox + 6.0 * scale
    draw.rectangle([(stair_x1, oy_base - 14), (stair_x2, oy_base)], fill=(254, 243, 199), outline=(217, 119, 6), width=1)
    draw.text(((stair_x1+stair_x2)/2, oy_base - 28), "Stairs Footprint (Z = 0 to 6\")", fill=TEXT_AMBER, font=font_dim_sub, anchor="mm")

    # Clear Space Callout (1-7/8" clear between stairs and window!)
    draw.line([(stair_x2, oy_base - 48), (wx1, oy_base - 48)], fill=TEXT_EMERALD, width=2)
    draw.text(((stair_x2 + wx1)/2, oy_base - 65), "1-7/8\" CLEAR WALL\n(ZERO STAIR OVERLAP!)", fill=TEXT_EMERALD, font=font_badge, anchor="mm", align="center")

    # 2nd Floor Solid Wall Notice
    draw.text((ox + pw/2, oy_base - 12.5*scale), "2ND FLOOR MANS ROOM SIDE WALL\n★ ZERO SIDE WINDOWS (SOLID BIRCH) ★", fill=TEXT_AMBER, font=font_badge, anchor="mm", align="center")

    # Attic Gable Zone Notice
    draw.text((ox + pw/2, oy_base - 20.5*scale), "ATTIC GABLE ZONE\n8.40\" (8-3/8\") Peak Rise\n(54.5° Pitch • Reduced 20%)", fill=TEXT_MUTED, font=font_badge, anchor="mm", align="center")

    # Dimensions
    draw_dim_h(draw, ox, ox + pw, oy_base + 35, "12\" (12.00\") DEPTH", "Front (Z=0) to Rear (Z=12)")
    draw_dim_v(draw, oy_base - ph_wall, oy_base, ox - 45, "16-1/2\" (16.50\")", "Wall to Eave")
    draw_dim_v(draw, oy_base - ph_wall - ph_peak, oy_base, ox - 110, "24.90\" (24-7/8\")", "Total to Peak")
    draw_dim_v(draw, oy_base - ph_wall - ph_peak, oy_base - ph_wall, ox + pw + 35, "8.40\" (8-3/8\")", "Gable Peak Rise", text_side="right")

    # Footer
    draw.text((45, IMG_HEIGHT - 65), "Foyer window is moved back to Z = 9\" (centerline), leaving 1-7/8\" of solid wood wall before the stairs landing at Z = 6\". Total gable height = 24.90\".", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_05_B2_right_gable_wall.png")

# ==============================================================================
# 6. FRONT FACADE WALL C1 (32" x 16-1/2" with Aligned Windows & Door)
# ==============================================================================
def gen_cut_06_c1():
    im, draw = create_base_canvas("C1", "Front Facade Wall Plate", "32\" W × 16-1/2\" H (32.00\" × 16.50\") • 5 Aligned Windows (2-1/4\" × 5\") & Birch Door (2-3/4\" × 6-3/4\")")

    scale = 28.0
    pw = 32.0 * scale   # 896px
    ph = 16.5 * scale   # 462px
    ox, oy = 250, 180

    draw.rectangle([(ox, oy), (ox + pw, oy + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)

    # Floor divider line (dashed 2nd floor level at Y = 8.25")
    y_fl2 = oy + ph - 8.25 * scale
    for x in range(int(ox), int(ox + pw), 15):
        draw.line([(x, y_fl2), (min(x + 8, ox + pw), y_fl2)], fill=BORDER_COLOR, width=2)
    draw.text((ox + pw - 10, y_fl2 - 10), "2nd Floor Level (Y = 8-1/4\")", fill=TEXT_MUTED, font=font_dim_sub, anchor="rb")

    # Common window dimensions: 2-1/4" W x 5" H
    win_w = 2.25 * scale
    win_h = 5.00 * scale

    # 1. Living Room Window (replaces Bay Window)
    lw_x1 = ox + 6.0 * scale - win_w / 2
    lw_x2 = lw_x1 + win_w
    lw_y2 = oy + ph - 1.50 * scale
    lw_y1 = lw_y2 - win_h
    draw_cutout_box(draw, (lw_x1, lw_y1, lw_x2, lw_y2), "LIVING WIN", "2-1/4\" × 5\" (X = 6\")")

    # 2. Kitchen Window
    kw_x1 = ox + 16.0 * scale - win_w / 2
    kw_x2 = kw_x1 + win_w
    kw_y2 = oy + ph - 1.50 * scale
    kw_y1 = kw_y2 - win_h
    draw_cutout_box(draw, (kw_x1, kw_y1, kw_x2, kw_y2), "KITCHEN WIN", "2-1/4\" × 5\" (X = 16\")")

    # 3. Birch Front Door (2-3/4" W x 6-3/4" H)
    dr_w = 2.75 * scale
    dr_h = 6.75 * scale
    dr_x1 = ox + 26.5 * scale - dr_w / 2
    dr_x2 = dr_x1 + dr_w
    dr_y2 = oy + ph
    dr_y1 = dr_y2 - dr_h
    draw_cutout_box(draw, (dr_x1, dr_y1, dr_x2, dr_y2), "BIRCH DOOR", "2-3/4\" × 6-3/4\" (X = 26-1/2\")")

    # 4. Bathroom Window (2nd Fl)
    baw_x1 = ox + 3.25 * scale - win_w / 2
    baw_x2 = baw_x1 + win_w
    baw_y2 = oy + ph - 9.75 * scale
    baw_y1 = baw_y2 - win_h
    draw_cutout_box(draw, (baw_x1, baw_y1, baw_x2, baw_y2), "BATH WIN", "2-1/4\" × 5\" (X = 3-1/4\")")

    # 5. Women Room Window (CENTERED IN 12-1/2" WOMEN ROOM AT X = 12-3/4"!)
    ww_x1 = ox + 12.75 * scale - win_w / 2
    ww_x2 = ww_x1 + win_w
    draw_cutout_box(draw, (ww_x1, baw_y1, ww_x2, baw_y2), "WOMEN WIN", "2-1/4\" × 5\" (X = 12-3/4\")")

    # 6. Mans Room Window (Vertical Align Over Front Door!)
    mw_x1 = ox + 26.5 * scale - win_w / 2
    mw_x2 = mw_x1 + win_w
    draw_cutout_box(draw, (mw_x1, baw_y1, mw_x2, baw_y2), "MANS WIN", "2-1/4\" × 5\" (X = 26-1/2\")")

    # Alignment Dashed Guideline Lines
    # Living Room Window Centered at X = 6"
    draw.line([(ox + 6.0*scale, y_fl2), (ox + 6.0*scale, oy + ph)], fill=(217, 119, 6), width=1)
    draw.text((ox + 6.0*scale, oy - 16), "LIVING WIN", fill=TEXT_AMBER, font=font_dim_sub, anchor="mb")
    draw.text((ox + 6.0*scale, oy - 2), "Centered at X = 6\"", fill=TEXT_DARK, font=font_cutout_sub, anchor="mb")

    # Women Room Window Centered in Room at X = 12-3/4"
    draw.line([(ox + 12.75*scale, oy), (ox + 12.75*scale, baw_y2)], fill=(219, 39, 119), width=1)
    draw.text((ox + 12.75*scale, oy - 55), "WOMEN ROOM WIN", fill=(190, 24, 93), font=font_dim_sub, anchor="mb")
    draw.text((ox + 12.75*scale, oy - 40), "Centered at X = 12-3/4\"", fill=TEXT_DARK, font=font_cutout_sub, anchor="mb")

    # Kitchen Window Centered on Carcass at X = 16"
    draw.line([(ox + 16.0*scale, y_fl2), (ox + 16.0*scale, oy + ph)], fill=(5, 150, 105), width=1)
    draw.text((ox + 16.0*scale, oy - 16), "KITCHEN WIN", fill=TEXT_EMERALD, font=font_dim_sub, anchor="mb")
    draw.text((ox + 16.0*scale, oy - 2), "Centered at X = 16\"", fill=TEXT_DARK, font=font_cutout_sub, anchor="mb")

    # Mans Window Aligned Over Birch Door at X = 26-1/2"
    draw.line([(ox + 26.5*scale, oy), (ox + 26.5*scale, oy + ph)], fill=(2, 132, 199), width=1)
    draw.text((ox + 26.5*scale, oy - 18), "MANS OVER DOOR", fill=DIM_COLOR, font=font_dim_sub, anchor="mb")
    draw.text((ox + 26.5*scale, oy - 4), "Aligned at X = 26-1/2\"", fill=TEXT_DARK, font=font_cutout_sub, anchor="mb")

    # Outer Rabbet Nesting Note
    draw.rectangle([(ox - 10, oy), (ox, oy + ph)], fill=RABBET_FILL)
    draw.rectangle([(ox + pw, oy), (ox + pw + 10, oy + ph)], fill=RABBET_FILL)
    draw.text((ox - 16, oy + 70), "Nests into B1 Rabbet", fill=TEXT_AMBER, font=font_dim_sub, anchor="rm")
    draw.text((ox + pw + 16, oy + 70), "Nests into B2 Rabbet", fill=TEXT_AMBER, font=font_dim_sub, anchor="lm")

    # Dimensions
    draw_dim_h(draw, ox, ox + pw, oy + ph + 35, "32\" (32.00\") FACADE WIDTH", "")
    draw_dim_v(draw, oy, oy + ph, ox - 65, "16-1/2\" (16.50\")", "Height", text_side="left")

    # Footer
    draw.text((45, IMG_HEIGHT - 65), "Front facade C1: All 5 windows are identical 2-1/4\" x 5\" (1/8\" flange). Birch Door cutout is 2-3/4\" x 6-3/4\" at X = 26-1/2\" directly under Mans window.", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_06_C1_front_facade.png")

# ==============================================================================
# 7. 1ST FLOOR PARTITIONS D1-A & D1-B (12" x 8-1/4" with 1/8" Tongues)
# ==============================================================================
def gen_cut_07_d1():
    im, draw = create_base_canvas("D1-A & D1-B", "1st Floor Partitions (Living/Kitchen & Kitchen/Foyer)", "12\" W × 8-1/4\" H (12.00\" × 8.25\") • 1/8\" Floor & Ceiling Tongues")

    scale = 35.0
    pw = 12.0 * scale   # 420px
    ph = 8.25 * scale   # 288.75px

    ox1, oy = 180, 230
    ox2 = 820

    # Panel 1: D1-A (Living / Kitchen)
    draw.text((ox1 + pw/2, oy - 35), "PARTITION D1-A (Living / Kitchen)", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.rectangle([(ox1, oy), (ox1 + pw, oy + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)

    # Highlight Top & Bottom 1/8" Tongues
    draw_hatched_rect(draw, (ox1, oy, ox1 + pw, oy + 0.125*scale), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw_hatched_rect(draw, (ox1, oy + ph - 0.125*scale, ox1 + pw, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((ox1 + pw/2, oy - 14), "▲ TOP 1/8\" TONGUE (SEATS IN A2 CEILING GROOVE) ▲", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mb")
    draw.text((ox1 + pw/2, oy + ph + 14), "▼ BOTTOM 1/8\" TONGUE (SEATS IN A1 FLOOR GROOVE) ▼", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mt")

    # Cased Walkthrough Cutout
    cw_w = 3.0 * scale
    cw_h = 6.5 * scale
    cw_x1 = ox1 + 0.5 * scale
    cw_x2 = cw_x1 + cw_w
    cw_y2 = oy + ph - 0.125 * scale
    cw_y1 = cw_y2 - cw_h
    draw_cutout_box(draw, (cw_x1, cw_y1, cw_x2, cw_y2), "OPEN WALKTHROUGH", "3\" W × 6-1/2\" H (NO DOORS)")

    draw_dim_h(draw, ox1, ox1 + pw, oy + ph + 55, "12\" (12.00\") DEPTH", "")
    draw_dim_v(draw, oy, oy + ph, ox1 - 35, "8-1/4\" (8.25\")", "Cut Height", text_side="left")
    draw_dim_v(draw, oy + 0.125*scale, oy + ph - 0.125*scale, ox1 + pw + 25, "8.00\"", "Clear Ceiling")

    # Panel 2: D1-B (Kitchen / Foyer)
    draw.text((ox2 + pw/2, oy - 35), "PARTITION D1-B (Kitchen / Foyer)", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.rectangle([(ox2, oy), (ox2 + pw, oy + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)

    draw_hatched_rect(draw, (ox2, oy, ox2 + pw, oy + 0.125*scale), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw_hatched_rect(draw, (ox2, oy + ph - 0.125*scale, ox2 + pw, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((ox2 + pw/2, oy - 14), "▲ TOP 1/8\" TONGUE (SEATS IN A2 CEILING GROOVE) ▲", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mb")
    draw.text((ox2 + pw/2, oy + ph + 14), "▼ BOTTOM 1/8\" TONGUE (SEATS IN A1 FLOOR GROOVE) ▼", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mt")

    # Fireplace Mounting Zone at front: Z = 0.5" to 5.5"
    fp_x1 = ox2 + 0.5 * scale
    fp_x2 = ox2 + 5.5 * scale
    fp_y2 = oy + ph - 0.125 * scale
    fp_y1 = fp_y2 - 4.5 * scale
    draw.rectangle([(fp_x1, fp_y1), (fp_x2, fp_y2)], fill=(254, 226, 226), outline=(225, 29, 72), width=2)
    draw.text(((fp_x1+fp_x2)/2, (fp_y1+fp_y2)/2), "5\" × 1.5\" FIREPLACE\nMOUNTING ZONE\n(Faces Foyer)", fill=(159, 18, 57), font=font_cutout_title, anchor="mm", align="center")

    # Walkthrough at REAR: Z = 7-1/2" to 10-1/2"
    cw2_x1 = ox2 + 7.5 * scale
    cw2_x2 = cw2_x1 + cw_w
    draw_cutout_box(draw, (cw2_x1, cw_y1, cw2_x2, cw_y2), "WALKTHROUGH", "3\" × 6-1/2\" (At Rear)")

    draw_dim_h(draw, ox2, ox2 + pw, oy + ph + 55, "12\" (12.00\") DEPTH", "")

    # Engineering Math Box
    draw.rectangle([(180, oy + ph + 90), (IMG_WIDTH - 180, oy + ph + 175)], fill=CARD_BG, outline=BORDER_COLOR, width=2)
    draw.text((200, oy + ph + 102), "WHY ARE PARTITIONS CUT TO 8-1/4\" (8.25\") HIGH?", fill=TEXT_AMBER, font=font_badge)
    draw.text((200, oy + ph + 125), "Formula: 8.00\" (Clear Ceiling) + 0.125\" (Floor Tongue in A1) + 0.125\" (Ceiling Tongue in A2) = 8.25\" (8-1/4\")", fill=TEXT_EMERALD, font=font_notes_bd)
    draw.text((200, oy + ph + 148), "When seated 1/8\" into both decks, exactly 8.00\" (8'-0\" scale) of visible wall height remains visible in every room!", fill=TEXT_MUTED, font=font_notes)

    # Footer
    draw.text((45, IMG_HEIGHT - 65), "First floor interior doors are completely removed. Cased walkthroughs provide open circulation between Living, Kitchen, and Foyer.", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_07_D1_1st_fl_partitions.png")

# ==============================================================================
# 8. 2ND FLOOR PARTITIONS D2-A & D2-B (12" x 8-1/4" with Authentic Inside Doors)
# ==============================================================================
def gen_cut_08_d2():
    im, draw = create_base_canvas("D2-A & D2-B", "2nd Floor Partitions (Bath/Women & Women/Mans)", "12\" W × 8-1/4\" H (12.00\" × 8.25\") • Authentic 1:12 Inside Doors")

    scale = 35.0
    pw = 12.0 * scale
    ph = 8.25 * scale

    ox1, oy = 180, 230
    ox2 = 820

    # Panel 1: D2-A (Bath / Women)
    draw.text((ox1 + pw/2, oy - 35), "PARTITION D2-A (Bath / Women Room)", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.rectangle([(ox1, oy), (ox1 + pw, oy + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)
    draw_hatched_rect(draw, (ox1, oy, ox1 + pw, oy + 0.125*scale), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw_hatched_rect(draw, (ox1, oy + ph - 0.125*scale, ox1 + pw, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((ox1 + pw/2, oy - 14), "▲ TOP 1/8\" TONGUE (SEATS IN A3 CEILING GROOVE) ▲", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mb")
    draw.text((ox1 + pw/2, oy + ph + 14), "▼ BOTTOM 1/8\" TONGUE (SEATS IN A2 FLOOR GROOVE) ▼", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mt")

    # Doorway Cutout (Positioned at Z = 3-1/2" to allow front tub, sink in front of door, toilet behind door)
    dw_w = 3.46 * scale
    dw_h = 6.29 * scale
    dw_x1 = ox1 + 3.5 * scale
    dw_x2 = dw_x1 + dw_w
    dw_y2 = oy + ph - 0.125 * scale
    dw_y1 = dw_y2 - dw_h
    draw_cutout_box(draw, (dw_x1, dw_y1, dw_x2, dw_y2), "BATH DOOR ($12.47)", "3-7/16\" W × 6-5/16\" H (Z = 3-1/2\")")

    draw_dim_h(draw, ox1, ox1 + pw, oy + ph + 55, "12\" (12.00\") DEPTH", "")
    draw_dim_v(draw, oy, oy + ph, ox1 - 35, "8-1/4\" (8.25\")", "Cut Height", text_side="left")
    draw_dim_v(draw, oy + 0.125*scale, oy + ph - 0.125*scale, ox1 + pw + 25, "8.00\"", "Clear Ceiling")

    # Panel 2: D2-B (Women / Mans)
    draw.text((ox2 + pw/2, oy - 35), "PARTITION D2-B (Women / Mans Room)", fill=TEXT_WHITE, font=font_label, anchor="mm")
    draw.rectangle([(ox2, oy), (ox2 + pw, oy + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)
    draw_hatched_rect(draw, (ox2, oy, ox2 + pw, oy + 0.125*scale), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw_hatched_rect(draw, (ox2, oy + ph - 0.125*scale, ox2 + pw, oy + ph), GROOVE_FILL, GROOVE_BORDER, step=5)
    draw.text((ox2 + pw/2, oy - 14), "▲ TOP 1/8\" TONGUE (SEATS IN A3 CEILING GROOVE) ▲", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mb")
    draw.text((ox2 + pw/2, oy + ph + 14), "▼ BOTTOM 1/8\" TONGUE (SEATS IN A2 FLOOR GROOVE) ▼", fill=TEXT_AMBER, font=font_cutout_sub, anchor="mt")

    dw2_x1 = ox2 + 1.0 * scale
    dw2_x2 = dw2_x1 + dw_w
    draw_cutout_box(draw, (dw2_x1, dw_y1, dw2_x2, dw_y2), "AUTHENTIC 1:12 DOOR", "3-7/16\" W × 6-5/16\" H ($12.47)")

    draw_dim_h(draw, ox2, ox2 + pw, oy + ph + 55, "12\" (12.00\") DEPTH", "")

    # Doorway notes
    draw.rectangle([(180, oy + ph + 90), (IMG_WIDTH - 180, oy + ph + 175)], fill=CARD_BG, outline=BORDER_COLOR, width=2)
    draw.text((200, oy + ph + 102), "2ND FLOOR ROOM DIMENSIONS & DOOR SCRIBING RULE:", fill=TEXT_AMBER, font=font_badge)
    draw.text((200, oy + ph + 125), "• Bathroom is 6\" W. Women & Mans rooms are equal 12-1/2\" W (12.50\"). Total span = 31.00\" (equal to 1st fl!).", fill=TEXT_EMERALD, font=font_notes_bd)
    draw.text((200, oy + ph + 148), "• Bathroom Suite: Bathtub against front wall, sink in front of door, toilet tucked behind door. Solid left side wall (no windows).", fill=TEXT_WHITE, font=font_notes)

    # Footer
    draw.text((45, IMG_HEIGHT - 65), "Bathroom is 6\" (6.00\") wide with front window only (zero side window). Both bedrooms (Women & Mans) are equal 12-1/2\" (12.50\") wide.", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_08_D2_2nd_fl_partitions.png")

# ==============================================================================
# 9. ROOF PANELS E1 & E2 (Front Solid E1 & Rear E2 with Peek-In Cutout)
# ==============================================================================
def gen_cut_09_roof():
    im, draw = create_base_canvas("E1 & E2", "Main Roof Slope Panels (Front Solid & Rear Peek-In Cutout)", "32\" W × 12-1/16\" Slope Run (32.00\" × 12.04\") • 27\" × 8.40\" Cutout • 54.5° Pitch")

    scale = 22.0
    pw = 32.0 * scale   # 704px
    ph = 12.04 * scale  # 264.88px

    ox = int((IMG_WIDTH - pw) / 2) # 368px
    oy1 = 150
    oy2 = 475

    # ---------------- E1: Solid Front Slope ----------------
    draw.text((ox + pw/2, oy1 - 25), "FRONT ROOF SLOPE (E1) — SOLID CONTINUOUS BIRCH PANEL", fill=TEXT_DARK, font=font_label, anchor="mm")
    draw.rectangle([(ox, oy1), (ox + pw, oy1 + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)
    
    draw.text((ox + pw/2, oy1 + ph/2 - 12), "SOLID CONTINUOUS BALTIC BIRCH ROOFLINE (54.5° PITCH)", fill=TEXT_AMBER, font=font_badge, anchor="mm")
    draw.text((ox + pw/2, oy1 + ph/2 + 12), "32\" Roof Length (Flush with 32\" Carcass Gables • Zero Overhang)", fill=TEXT_DARK, font=font_dim, anchor="mm")
    draw.text((ox + pw/2, oy1 + ph/2 + 32), "12-1/16\" Slope Run (8.40\" Peak Rise + 1\" Front Eave Overhang • Zero Roof Windows)", fill=TEXT_MUTED, font=font_dim_sub, anchor="mm")

    # Dimensions E1
    draw_dim_h(draw, ox, ox + pw, oy1 - 10, "32\" (32.00\") ROOF LENGTH", "")
    draw_dim_v(draw, oy1, oy1 + ph, ox - 35, "12-1/16\" (12.04\")", "Slope Run", text_side="left")

    # ---------------- E2: Rear Slope with Triangular Cutout ----------------
    draw.text((ox + pw/2, oy2 - 25), "REAR ROOF SLOPE (E2) — PROMINENT TRIANGULAR PEEK-IN CUTOUT", fill=TEXT_AMBER, font=font_label, anchor="mm")
    draw.rectangle([(ox, oy2), (ox + pw, oy2 + ph)], fill=PANEL_FILL, outline=PANEL_OUTLINE, width=3)

    # Triangular Cutout
    tx_base_left = ox + 2.5 * scale
    tx_base_right = ox + pw - 2.5 * scale
    ty_base = oy2 + ph
    tx_apex = ox + pw / 2
    ty_apex = oy2 + ph - 8.40 * scale
    
    tri_pts = [(tx_base_left, ty_base), (tx_apex, ty_apex), (tx_base_right, ty_base)]
    draw.polygon(tri_pts, fill=CUTOUT_BG, outline=CUTOUT_BORDER, width=2)

    # Diagonal trim highlight lines
    draw.line([(tx_base_left, ty_base), (tx_apex, ty_apex)], fill=CUTOUT_BORDER, width=3)
    draw.line([(tx_base_right, ty_base), (tx_apex, ty_apex)], fill=CUTOUT_BORDER, width=3)

    draw.text((tx_apex, ty_apex + 45), "TRIANGULAR ATTIC OPENING\n27\" Base × 8.40\" Altitude\n(Direct Hands-On Access into Attic!)", fill=TEXT_DARK, font=font_dim, anchor="mm", align="center")

    # Side Wings and Ridge Header
    draw.text((ox + 1.25*scale, oy2 + ph/2), "2-1/2\" Wing\n(Left Peak)", fill=TEXT_AMBER, font=font_dim_sub, anchor="mm", align="center")
    draw.text((ox + pw - 1.25*scale, oy2 + ph/2), "2-1/2\" Wing\n(Right Peak)", fill=TEXT_AMBER, font=font_dim_sub, anchor="mm", align="center")
    draw.text((tx_apex, oy2 + 15), "3-5/8\" (3.64\") SOLID RIDGE BAND (CAPPED BY 32\" RIDGE BOARD)", fill=TEXT_EMERALD, font=font_cutout_sub, anchor="mm", align="center")

    # Dimensions E2
    draw_dim_h(draw, tx_base_left, tx_base_right, ty_base + 16, "27\" (27.00\") BASE OPENING", "Centered along rear eave")
    draw_dim_v(draw, ty_apex, ty_base, ox + pw + 35, "8.40\" (8-3/8\")", "Altitude", text_side="right")
    draw_dim_v(draw, oy2, oy2 + ph, ox - 35, "12-1/16\" (12.04\")", "Slope Run", text_side="left")

    # Footer
    draw.text((45, IMG_HEIGHT - 65), "Rear Roof Slope E2 restores the authentic gable roofline from the backview, while the 27\" × 8.40\" cutout provides effortless reach into the 3rd floor cathedral attic.", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_09_E1_E2_roof_panels.png")

# ==============================================================================
# 10. MASTER CARCASS INTERLOCK OVERVIEW
# ==============================================================================
def gen_cut_10_overview():
    im, draw = create_base_canvas("MASTER", "Complete Carcass Interlock & Roof Geometry", "All Joint Locations, 8.40\" Roof Rise (24.90\" Total H), Fence Settings & Assembly Registration")

    ox, oy = 280, 260
    scale = 20.0
    pw = 32.0 * scale       # 640px
    fl1_h = 8.25 * scale    # 165px
    fl2_h = 8.25 * scale    # 165px
    roof_rise_px = 8.40 * scale # 168px

    y_a3 = oy
    y_apex = y_a3 - roof_rise_px # 92px
    y_a2 = y_a3 + fl2_h         # 425px
    y_a1 = y_a2 + fl1_h         # 590px
    dt = 6

    # Roof Gable Profile on Deck A3
    roof_pts = [(ox, y_a3), (ox + pw/2, y_apex), (ox + pw, y_a3)]
    draw.polygon(roof_pts, fill=(241, 245, 249), outline=PANEL_OUTLINE, width=2)
    draw.line([(ox - 1.0*scale, y_a3 + 12), (ox + pw/2, y_apex), (ox + pw + 1.0*scale, y_a3 + 12)], fill=TEXT_MUTED, width=3)
    draw.text((ox + pw/2, y_a3 - roof_rise_px/2), "ATTIC CATHEDRAL VAULT\n8.40\" (8-3/8\") Peak Rise • 54.5° Pitch\n(8' 5\" Scale Headroom at Ridge!)", fill=TEXT_AMBER, font=font_label, anchor="mm", align="center")

    # Decks
    draw.rectangle([(ox, y_a1), (ox + pw, y_a1 + dt)], fill=(37, 99, 235), outline=(96, 165, 250), width=1)
    draw.text((ox - 15, y_a1 + dt/2), "DECK A1 (Base)", fill=TEXT_DARK, font=font_badge, anchor="rm")

    draw.rectangle([(ox, y_a2), (ox + pw, y_a2 + dt)], fill=(37, 99, 235), outline=(96, 165, 250), width=1)
    draw.text((ox - 15, y_a2 + dt/2), "DECK A2 (2nd Fl)", fill=TEXT_DARK, font=font_badge, anchor="rm")

    draw.rectangle([(ox, y_a3), (ox + pw, y_a3 + dt)], fill=(37, 99, 235), outline=(96, 165, 250), width=1)
    draw.text((ox - 15, y_a3 + dt/2), "DECK A3 (Attic)", fill=TEXT_DARK, font=font_badge, anchor="rm")

    # Exterior Gable Walls B1 & B2
    draw.rectangle([(ox, y_a3), (ox + dt, y_a1 + dt)], fill=PANEL_FILL, outline=GROOVE_BORDER, width=2)
    draw.rectangle([(ox + pw - dt, y_a3), (ox + pw, y_a1 + dt)], fill=PANEL_FILL, outline=GROOVE_BORDER, width=2)
    draw.text((ox + dt/2, y_a3 + 15), "B1 (Left)", fill=TEXT_AMBER, font=font_dim_sub, anchor="mm")
    draw.text((ox + pw - dt/2, y_a3 + 15), "B2 (Right)", fill=TEXT_AMBER, font=font_dim_sub, anchor="mm")

    # 1st Floor Partitions
    d1a_x = ox + 11.75 * scale
    d1b_x = ox + 23.50 * scale
    draw.rectangle([(d1a_x, y_a2 + dt), (d1a_x + dt, y_a1)], fill=GROOVE_FILL, outline=GROOVE_BORDER, width=1)
    draw.rectangle([(d1b_x, y_a2 + dt), (d1b_x + dt, y_a1)], fill=GROOVE_FILL, outline=GROOVE_BORDER, width=1)
    draw.text((d1a_x + dt/2, y_a2 + fl1_h/2), "D1-A\n(8-1/4\" H)", fill=TEXT_DARK, font=font_dim_sub, anchor="mm", align="center")
    draw.text((d1b_x + dt/2, y_a2 + fl1_h/2), "D1-B\n(8-1/4\" H)", fill=TEXT_DARK, font=font_dim_sub, anchor="mm", align="center")

    # 2nd Floor Partitions
    d2a_x = ox + 6.25 * scale
    d2b_x = ox + 19.00 * scale
    draw.rectangle([(d2a_x, y_a3 + dt), (d2a_x + dt, y_a2)], fill=GROOVE_FILL, outline=GROOVE_BORDER, width=1)
    draw.rectangle([(d2b_x, y_a3 + dt), (d2b_x + dt, y_a2)], fill=GROOVE_FILL, outline=GROOVE_BORDER, width=1)
    draw.text((d2a_x + dt/2, y_a3 + fl2_h/2), "D2-A\n(8-1/4\" H)", fill=TEXT_DARK, font=font_dim_sub, anchor="mm", align="center")
    draw.text((d2b_x + dt/2, y_a3 + fl2_h/2), "D2-B\n(8-1/4\" H)", fill=TEXT_DARK, font=font_dim_sub, anchor="mm", align="center")

    # Room Dimensions text
    draw.text((ox + 5.875*scale, y_a2 + fl1_h/2), "LIVING ROOM\n11-1/2\" W (11.50\")", fill=TEXT_MUTED, font=font_dim_sub, anchor="mm", align="center")
    draw.text((ox + 17.625*scale, y_a2 + fl1_h/2), "KITCHEN\n11-1/2\" W (11.50\")", fill=TEXT_MUTED, font=font_dim_sub, anchor="mm", align="center")
    draw.text((ox + 27.75*scale, y_a2 + fl1_h/2), "FOYER\n8\" W (8.00\")", fill=TEXT_MUTED, font=font_dim_sub, anchor="mm", align="center")

    draw.text((ox + 3.125*scale, y_a3 + fl2_h/2), "BATH\n6\" W", fill=TEXT_MUTED, font=font_dim_sub, anchor="mm", align="center")
    draw.text((ox + 12.625*scale, y_a3 + fl2_h/2), "WOMEN ROOM\n12-1/2\" W (12.50\")", fill=TEXT_MUTED, font=font_dim_sub, anchor="mm", align="center")
    draw.text((ox + 25.5*scale, y_a3 + fl2_h/2), "MANS ROOM\n12-1/2\" W (12.50\")", fill=TEXT_MUTED, font=font_dim_sub, anchor="mm", align="center")

    # Dimensions
    draw_dim_h(draw, ox, ox + pw, y_a1 + 30, "32\" (32.00\") TOTAL CARCASS WIDTH", "")
    draw_dim_v(draw, y_a2 + dt, y_a1, ox + pw + 35, "8.00\"", "1st Fl Clear")
    draw_dim_v(draw, y_a3 + dt, y_a2, ox + pw + 35, "8.00\"", "2nd Fl Clear")
    draw_dim_v(draw, y_apex, y_a3, ox + pw + 35, "8.40\" (8-3/8\")", "Roof Rise")
    draw_dim_v(draw, y_apex, y_a1 + dt, ox + pw + 115, "24.90\" (24-7/8\")", "Total Height")
    draw_dim_v(draw, y_a3, y_a1 + dt, ox - 45, "16-1/2\" (16.50\")", "Wall to Eave", text_side="left")

    # Quick Reference Box
    draw.rectangle([(ox, y_a1 + 45), (ox + pw, IMG_HEIGHT - 95)], fill=CARD_BG, outline=BORDER_COLOR, width=2)
    draw.text((ox + 20, y_a1 + 58), "MASTER FENCE SETTING QUICK REFERENCE TABLE (1/8\" DEEP GROOVES):", fill=TEXT_AMBER, font=font_badge)
    draw.text((ox + 20, y_a1 + 78), "• Base A1 Top: D1-A = 11-3/4\"  |  D1-B = 23-1/2\"  |  Left End Rabbet = 0-1/4\"  |  Right End Rabbet = 31-3/4-32\"", fill=TEXT_DARK, font=font_notes)
    draw.text((ox + 20, y_a1 + 96), "• 2nd Fl A2 Underside: D1-A Top = 11-3/4\"  |  D1-B Top = 23-1/2\"  (Identical to Base A1!)", fill=TEXT_DARK, font=font_notes)
    draw.text((ox + 20, y_a1 + 114), "• 2nd Fl A2 Top: D2-A = 6-1/4\"  |  D2-B = 19\"  |  Stair Opening = 29-1/2\" to 31-3/4\"", fill=TEXT_EMERALD, font=font_notes)
    draw.text((ox + 20, y_a1 + 132), "• Attic A3 Underside: D2-A Top = 6-1/4\"  |  D2-B Top = 19\"  (Identical to 2nd Fl A2 Top!)", fill=TEXT_DARK, font=font_notes)

    # Footer
    draw.text((45, IMG_HEIGHT - 65), "Total carcass height is exactly 24.90\" (16-1/2\" wall + 8.40\" roof rise, 54.5° pitch). 1/8\" grooves interlock all floors and partitions.", fill=TEXT_AMBER, font=font_notes_bd)

    save_image(im, "cut_10_master_interlock_overview.png")

if __name__ == "__main__":
    print("Regenerating all 10 polished architectural cut diagrams...")
    gen_cut_01_a1()
    gen_cut_02_a2()
    gen_cut_03_a3()
    gen_cut_04_b1()
    gen_cut_05_b2()
    gen_cut_06_c1()
    gen_cut_07_d1()
    gen_cut_08_d2()
    gen_cut_09_roof()
    gen_cut_10_overview()
    print("All 10 polished diagrams generated successfully!")
