/* Tapestry theme surface contract. Values are supplied by the Atelier Theme Studio. */
:root {
    --t-theme-header-background: none;
    --t-theme-navigation-background: none;
    --t-theme-childbar-background: none;
    --t-theme-window-background: none;
    --t-theme-window-frame: none;
    --t-theme-panel-background: none;
    --t-theme-panel-frame: none;
    --t-theme-dialog-background: none;
    --t-theme-dialog-frame: none;
    --t-theme-control-background: none;
}

html[data-tapestry-theme] .app-header__ribbon {
    background-image: var(--t-theme-header-background) !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

html[data-tapestry-theme] .child-region {
    background-image: var(--t-theme-childbar-background) !important;
    background-position: center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
}

/* Reserved contracts for future Atelier surface editors. */
html[data-tapestry-theme] .t-window,
html[data-tapestry-theme] .atelier-window-specimen {
    --t-active-window-background: var(--t-theme-window-background);
    --t-active-window-frame: var(--t-theme-window-frame);
}

html[data-tapestry-theme] .t-panel,
html[data-tapestry-theme] .atelier-panel {
    --t-active-panel-background: var(--t-theme-panel-background);
    --t-active-panel-frame: var(--t-theme-panel-frame);
}

html[data-tapestry-theme] .t-dialog,
html[data-tapestry-theme] [role="dialog"] {
    --t-active-dialog-background: var(--t-theme-dialog-background);
    --t-active-dialog-frame: var(--t-theme-dialog-frame);
}


/* Patch 144: centralized complete UI surface contract. Presence attributes are set by tapestry-theme-studio.js so empty slots never erase production styling. */
:root {
    --t-theme-font-display: "Cormorant Garamond", Georgia, serif;
    --t-theme-font-body: Georgia, "Times New Roman", serif;
    --t-theme-font-accent: "Segoe Script", "Snell Roundhand", cursive;
    --t-theme-font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
html[data-t-theme-fonts-display="true"] h1, html[data-t-theme-fonts-display="true"] h2, html[data-t-theme-fonts-display="true"] h3, html[data-t-theme-fonts-display="true"] h4, html[data-t-theme-fonts-display="true"] h5, html[data-t-theme-fonts-display="true"] h6, html[data-t-theme-fonts-display="true"] .atelier-plaque, html[data-t-theme-fonts-display="true"] .category-title { font-family:var(--t-theme-font-display)!important; }
html[data-t-theme-fonts-body="true"] body, html[data-t-theme-fonts-body="true"] input, html[data-t-theme-fonts-body="true"] select, html[data-t-theme-fonts-body="true"] textarea, html[data-t-theme-fonts-body="true"] button { font-family:var(--t-theme-font-body)!important; }
html[data-t-theme-fonts-accent="true"] .atelier-hero__inscription, html[data-t-theme-fonts-accent="true"] .t-script, html[data-t-theme-fonts-accent="true"] blockquote { font-family:var(--t-theme-font-accent)!important; }
html[data-t-theme-fonts-mono="true"] .operations-readout, html[data-t-theme-fonts-mono="true"] code, html[data-t-theme-fonts-mono="true"] pre { font-family:var(--t-theme-font-mono)!important; }

html[data-t-theme-windows-background="true"] :is(.t-window,.atelier-window-specimen,.floating-window,.dashboard-window){background-image:var(--t-theme-window-background)!important;background-size:cover!important;}
html[data-t-theme-windows-frame="true"] :is(.t-window,.atelier-window-specimen,.floating-window,.dashboard-window){border-image:var(--t-theme-window-frame) 28 fill / 18px / 0 stretch!important;}
html[data-t-theme-windows-title-bar="true"] :is(.t-window__header,.window-titlebar,.floating-window__header){background-image:var(--t-theme-window-titlebar)!important;background-size:cover!important;}
html[data-t-theme-dialogs-background="true"] :is(.t-dialog,[role="dialog"]){background-image:var(--t-theme-dialog-background)!important;background-size:cover!important;}
html[data-t-theme-dialogs-frame="true"] :is(.t-dialog,[role="dialog"]){border-image:var(--t-theme-dialog-frame) 28 fill / 18px / 0 stretch!important;}
html[data-t-theme-drawers-background="true"] :is(.t-drawer,.browser-sidecar,.atelier-detail){background-image:var(--t-theme-drawer-background)!important;background-size:cover!important;}
html[data-t-theme-drawers-frame="true"] :is(.t-drawer,.browser-sidecar,.atelier-detail){border-image:var(--t-theme-drawer-frame) 28 fill / 18px / 0 stretch!important;}
html[data-t-theme-panels-background="true"] :is(.t-panel,.atelier-panel,.operations-panel,.eng-panel,.today-panel){background-image:var(--t-theme-panel-background)!important;background-size:cover!important;}
html[data-t-theme-panels-frame="true"] :is(.t-panel,.atelier-panel,.operations-panel,.eng-panel,.today-panel){border-image:var(--t-theme-panel-frame) 28 fill / 16px / 0 stretch!important;}
html[data-t-theme-cards-background="true"] :is(.t-card,.home-card,.today-card,.google-service-card,.atelier-material,.atelier-recipe,.lifehub-card){background-image:var(--t-theme-card-background)!important;background-size:cover!important;}
html[data-t-theme-cards-frame="true"] :is(.t-card,.home-card,.today-card,.google-service-card,.atelier-material,.atelier-recipe,.lifehub-card){border-image:var(--t-theme-card-frame) 28 fill / 14px / 0 stretch!important;}
html[data-t-theme-plaques-background="true"] :is(.atelier-plaque,.operations-manufacturer-plate,.eng-panel__header,.t-plaque){background-image:var(--t-theme-plaque-background)!important;background-size:cover!important;}
html[data-t-theme-plaques-frame="true"] :is(.atelier-plaque,.operations-manufacturer-plate,.eng-panel__header,.t-plaque){border-image:var(--t-theme-plaque-frame) 24 fill / 12px / 0 stretch!important;}
html[data-t-theme-heroes-background="true"] :is(.today-hero,.lifehub-hero,.t-hero,.record-identity){background-image:var(--t-theme-hero-background)!important;background-size:cover!important;}
html[data-t-theme-heroes-frame="true"] :is(.today-hero,.lifehub-hero,.t-hero,.record-identity){border-image:var(--t-theme-hero-frame) 28 fill / 16px / 0 stretch!important;}
html[data-t-theme-record-books-background="true"] :is(.lifehub-recordbook,.record-book,.binder-shell){background-image:var(--t-theme-recordbook-background)!important;background-size:cover!important;}
html[data-t-theme-record-books-frame="true"] :is(.lifehub-recordbook,.record-book,.binder-shell){border-image:var(--t-theme-recordbook-frame) 32 fill / 20px / 0 stretch!important;}
html[data-t-theme-tables-background="true"] :is(table,.ledger,.register){background-image:var(--t-theme-table-background)!important;background-size:cover!important;}
html[data-t-theme-tables-frame="true"] :is(table,.ledger,.register){border-image:var(--t-theme-table-frame) 24 fill / 10px / 0 stretch!important;}
html[data-t-theme-timeline-background="true"] :is(.timeline,.record-timeline,.eng-activity){background-image:var(--t-theme-timeline-background)!important;background-size:cover!important;}
html[data-t-theme-calendar-background="true"] :is(.daybook-calendar,.unified-calendar-grid,.calendar-agenda){background-image:var(--t-theme-calendar-background)!important;background-size:cover!important;}
html[data-t-theme-controls-background="true"] :is(.t-button,button:not(.category-hit):not(.t-upper-shell__hitbox)){background-image:var(--t-theme-control-background)!important;background-size:cover!important;}
html[data-t-theme-controls-frame="true"] :is(.t-button,button:not(.category-hit):not(.t-upper-shell__hitbox)){border-image:var(--t-theme-control-frame) 18 fill / 8px / 0 stretch!important;}
html[data-t-theme-inputs-background="true"] :is(input,select,textarea){background-image:var(--t-theme-input-background)!important;background-size:cover!important;}
html[data-t-theme-inputs-frame="true"] :is(input,select,textarea){border-image:var(--t-theme-input-frame) 18 fill / 8px / 0 stretch!important;}
html[data-t-theme-toolbars-background="true"] :is(.atelier-filterbar,.browser-toolbar,.t-toolbar,.dashboard-toolbar){background-image:var(--t-theme-toolbar-background)!important;background-size:cover!important;}
html[data-t-theme-tabs-background="true"] :is(.t-tabs,.record-tabs,.child-strip){background-image:var(--t-theme-tabs-background)!important;background-size:cover!important;}
html[data-t-theme-status-background="true"] :is(.atelier-status,.status-badge,.badge){background-image:var(--t-theme-status-background)!important;background-size:cover!important;}
html[data-t-theme-empty-states-background="true"] :is(.atelier-empty,.t-purpose-empty,.no-results){background-image:var(--t-theme-empty-background)!important;background-size:cover!important;}
html[data-t-theme-notifications-background="true"] :is(.toast,.t-toast,.notification){background-image:var(--t-theme-notification-background)!important;background-size:cover!important;}
html[data-t-theme-ornaments-divider="true"] :is(.atelier-divider,.t-divider){background-image:var(--t-theme-divider-art)!important;background-size:contain!important;background-repeat:no-repeat!important;background-position:center!important;}

/* Patch 145 · centralized theme color roles */
html[data-tapestry-theme]{color:var(--t-theme-color-body,inherit)}
html[data-tapestry-theme] :where(h1,h2,h3,h4,h5,h6,.page-title,.section-title,.atelier-plaque,strong.t-title){color:var(--t-theme-color-heading,inherit)}
html[data-tapestry-theme] :where(a:not(.t-button)){color:var(--t-theme-color-link,inherit)}
html[data-tapestry-theme] :where(.t-button:not(.secondary):not(.danger),button.primary,.primary-action){background-color:var(--t-theme-color-button);border-color:var(--t-theme-color-outline);color:var(--t-theme-color-buttonText)}
html[data-tapestry-theme] :where(.t-card,.t-panel,.t-dialog,.museum-glass-card,input,select,textarea){border-color:var(--t-theme-color-outline,inherit)}
html[data-tapestry-theme] :where(small,.muted,.helper-text,.caption){color:var(--t-theme-color-muted,inherit)}
html[data-tapestry-theme] :where(button,a,input,select,textarea):focus-visible{outline-color:var(--t-theme-color-focus)}
