/* CARD-ART-R49: stronger material contrast with one ornate rail owner per hierarchy. */
:root {
  --card-art-brass: #9d6d27;
  --card-art-gold: #d6ad58;
  --card-art-paper: rgba(255, 252, 241, .96);
  --card-watermark: url("../assets/archive-crest-watermark.svg");
}

/* Retire legacy decoration on card hosts before the single-owner layer is applied. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .panel,
  .kpi,
  .metric,
  .summary-card,
  .module-canvas-toolbar,
  .finance-overview-kpis,
  .finance-overview-filter-bar,
  .finance-overview-range-control,
  .workbench-actions,
  .asset-capture-panel,
  .asset-reference-card,
  .ai-workbench
)::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .panel,
  .kpi,
  .metric,
  .summary-card,
  .module-canvas-toolbar,
  .finance-overview-kpis,
  .finance-overview-filter-bar,
  .finance-overview-range-control,
  .workbench-actions,
  .asset-capture-panel,
  .asset-reference-card,
  .ai-workbench
)::after {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  .panel,
  .kpi,
  .metric,
  .summary-card,
  .finance-overview-filter-bar,
  .finance-overview-range-control,
  .workbench-actions,
  .asset-capture-panel,
  .asset-reference-card
) {
  border-image: none !important;
}

/* This inherited conic/radial layer was the large circular ornament behind finance metrics. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage .asset-balance-kpis,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage .finance-overview-kpis {
  background-image: none !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"] {
  --card-frame-top: url("../assets/ornate-frame-top-tight.png");
  --card-frame-bottom: url("../assets/ornate-frame-bottom-tight.png");
  --card-frame-left: url("../assets/ornate-frame-side-tight.png");
  --card-frame-right: url("../assets/ornate-frame-side-mirror-tight.png");
  --card-texture: url("../assets/paper-grid.png");
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  border: 1px solid rgba(157, 109, 39, .62) !important;
  border-radius: 6px !important;
  background:
    linear-gradient(135deg, var(--card-art-paper), rgba(232, 223, 193, .68)) center / auto no-repeat,
    var(--card-texture) center / 148px 148px repeat,
    var(--card-watermark) right 18px top 18px / 168px 168px no-repeat !important;
  background-blend-mode: normal, multiply, normal !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 237, .84),
    inset 0 0 0 5px rgba(157, 109, 39, .13),
    0 8px 18px rgba(55, 39, 16, .12) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"]::after {
  content: none !important;
  display: none !important;
}

/* Small corner accents deepen the material treatment without becoming a second frame. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 7px !important;
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: .9;
  background:
    var(--card-watermark) right 10px top 10px / 132px 132px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top left / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top left / 1px 34px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top right / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top right / 1px 34px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom left / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom left / 1px 34px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom right / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom right / 1px 34px no-repeat !important;
  filter: drop-shadow(0 1px 1px rgba(48, 30, 7, .34));
}

/* Ornate rails stay inside the card edge, so adjacent cards cannot paint over one another. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background: var(--card-frame-top) top center / 100% 14px no-repeat,
    var(--card-frame-bottom) bottom center / 100% 14px no-repeat,
    var(--card-frame-left) center left / 14px 100% no-repeat,
    var(--card-frame-right) center right / 14px 100% no-repeat !important;
  filter: contrast(1.08) saturate(1.02) drop-shadow(0 1px 1px rgba(48, 30, 7, .38));
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"] > * {
  position: relative;
  z-index: 2;
}

/* Metrics use a restrained inset double rule, not a second four-rail image frame. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"][data-art-tier="metric"] {
  border-width: 1px !important;
  background-size: auto, 96px 96px !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 237, .9),
    inset 0 0 0 4px rgba(157, 109, 39, .24),
    0 5px 12px rgba(55, 39, 16, .1) !important;
}

/* Cards inside an ornate hero keep texture and a crisp inset rule, not another full rail set. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"][data-art-tier="nested"] {
  border: 1px solid rgba(157, 109, 39, .48) !important;
  background-size: auto, 112px 112px !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 237, .88),
    inset 0 0 0 4px rgba(157, 109, 39, .18),
    0 5px 14px rgba(55, 39, 16, .1) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] .overview-command-deck.overview-home [data-art-tier="nested"] .overview-section-head > div > span,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] .overview-command-deck.overview-home [data-art-tier="nested"] .overview-section-head h4 {
  color: #19363a !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-variant="teal"] {
  --card-texture: url("../assets/gold-scale-open.png");
  --card-watermark: url("../assets/botanical-paper-r1.svg");
  --card-art-paper: rgba(226, 239, 230, .9);
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-variant="rose"] {
  --card-texture: url("../assets/linen-gold.png");
  --card-watermark: url("../assets/arabesque-open.png");
  --card-art-paper: rgba(255, 247, 243, .9);
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-variant="archive"] {
  --card-texture: url("../assets/paper-fibers-open.png");
  --card-watermark: url("../assets/archive-crest-watermark.svg");
  --card-art-paper: rgba(249, 244, 226, .9);
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-variant="damask"] {
  --card-texture: url("../assets/arabesque-open.png");
  --card-watermark: url("../assets/arches-open.png");
  --card-art-paper: rgba(244, 240, 221, .9);
}

/* Archive modules: keep the page panel as a material boundary while giving
   each semantic work surface a crisp inset tier instead of a second rail. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="knowledge"] .knowledge-v2__overview-panel,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] .library-overview-panel,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .items-v2__overview {
  --card-art-paper: rgba(244, 240, 221, .96);
  --card-texture: url("../assets/paper-fibers-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="knowledge"] .knowledge-v2__canvas-card,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] .library-overview-column,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .items-v2__workspace-section {
  border: 1px solid rgba(157, 109, 39, .5) !important;
  background: linear-gradient(135deg, rgba(255, 252, 241, .9), rgba(232, 223, 193, .66)), url("../assets/gold-scale-open.png") center / 112px 112px repeat !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 237, .9), inset 0 0 0 4px rgba(157, 109, 39, .18), 0 5px 14px rgba(55, 39, 16, .1) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .items-v2__overview {
  color: #17383b !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .items-v2__overview :is(h1,h2,h3,h4,p,span,strong,button) {
  color: #17383b !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] .library-intelligence {
  background: linear-gradient(135deg, rgba(248, 244, 229, .9), rgba(229, 222, 197, .62)), url("../assets/gold-scale-open.png") center / 132px 132px repeat !important;
}

/* AI is a separate shell: one outer archive frame, restrained nested panes. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .ai-workbench {
  --card-texture: url("../assets/black-linen-open.png");
  --card-art-paper: rgba(241, 239, 222, .97);
  color: #17383b !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .ai-workbench__pane,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .ai-workbench__result {
  border: 1px solid rgba(157, 109, 39, .45) !important;
  background: linear-gradient(135deg, rgba(255, 252, 241, .9), rgba(232, 223, 193, .66)), url("../assets/paper-fibers-open.png") center / 112px 112px repeat !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 237, .86), inset 0 0 0 4px rgba(157, 109, 39, .16), 0 5px 14px rgba(55, 39, 16, .1) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .ai-workbench__state {
  border: 1px solid rgba(157, 109, 39, .38) !important;
  background: rgba(255, 252, 241, .78) !important;
  color: #19363a !important;
}

@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
    background-size: 100% 11px, 100% 11px, 11px 100%, 11px 100% !important;
  }

  /* The mobile reminder grid resolves its two cards 2px into each other. Keep
     the second outer rail visually separated without changing form behavior. */
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="reminders"] .reminder-v2-list-card[data-art-frame-owner="true"] {
    transform: translateY(3px) !important;
  }
}

/* Final cascade for material-only panels. Keep this after the legacy reset so
   ordinary cards visibly retain their texture and inset edge. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel[data-card-material="true"] {
  --card-material-paper: rgba(248, 244, 226, .9);
  --card-material-edge: rgba(157, 109, 39, .36);
  --card-material-texture: url("../assets/paper-fibers-open.png");
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  border: 1px solid var(--card-material-edge) !important;
  border-radius: 5px !important;
  background: linear-gradient(135deg, var(--card-material-paper), rgba(226, 215, 181, .68)), var(--card-material-texture) center / 118px 118px repeat !important;
  background-blend-mode: normal, multiply !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 241, .76), inset 0 0 22px rgba(136, 94, 34, .08), 0 7px 16px rgba(52, 39, 22, .1) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] .panel[data-card-material="true"] { --card-material-paper: rgba(224, 239, 228, .9); --card-material-edge: rgba(36, 100, 88, .42); --card-material-texture: url("../assets/gold-scale-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] .panel[data-card-material="true"] { --card-material-paper: rgba(249, 242, 218, .92); --card-material-edge: rgba(163, 111, 33, .42); --card-material-texture: url("../assets/paper-fibers-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="people"] .panel[data-card-material="true"] { --card-material-paper: rgba(255, 243, 239, .92); --card-material-edge: rgba(151, 91, 73, .4); --card-material-texture: url("../assets/linen-gold.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="reminders"] .panel[data-card-material="true"] { --card-material-paper: rgba(243, 239, 218, .92); --card-material-edge: rgba(132, 101, 45, .42); --card-material-texture: url("../assets/arabesque-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="knowledge"] .panel[data-card-material="true"] { --card-material-paper: rgba(247, 239, 213, .92); --card-material-edge: rgba(134, 94, 32, .4); --card-material-texture: url("../assets/paper-grid.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] .panel[data-card-material="true"] { --card-material-paper: rgba(239, 240, 221, .92); --card-material-edge: rgba(67, 101, 88, .42); --card-material-texture: url("../assets/arabesque-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .panel[data-card-material="true"] { --card-material-paper: rgba(228, 241, 229, .92); --card-material-edge: rgba(42, 105, 90, .42); --card-material-texture: url("../assets/paper-grid.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] .panel[data-card-material="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .panel[data-card-material="true"] { --card-material-paper: rgba(236, 238, 220, .92); --card-material-edge: rgba(55, 91, 81, .42); --card-material-texture: url("../assets/black-linen-open.png"); }

/* R063 tail override: legacy panel resets must never erase the visible edge. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"] {
  box-sizing: border-box !important;
  border: 1px solid rgba(157, 109, 39, .72) !important;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
  inset: 1px !important;
  background-size: 100% 13px, 100% 13px, 13px 100%, 13px 100% !important;
  border-radius: inherit;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="metric"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="nested"] {
  border-color: rgba(157, 109, 39, .58) !important;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .ai-workbench,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] .panel[data-art-frame-owner="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .panel[data-card-material="true"] {
  --card-texture: url("../assets/black-linen-open.png") !important;
  --card-watermark: url("../assets/botanical-paper-r1.svg") !important;
  background-image: linear-gradient(135deg, var(--card-art-paper, rgba(241, 239, 222, .97)), rgba(224, 210, 167, .58)), url("../assets/black-linen-open.png"), url("../assets/botanical-paper-r1.svg") !important;
  background-position: center, center, right 16px top 16px !important;
  background-size: auto, 124px 124px, 156px 156px !important;
  background-repeat: no-repeat, repeat, no-repeat !important;
  background-blend-mode: normal, multiply, normal !important;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-variant="damask"] {
  --card-texture: url("../assets/arches-open.png") !important;
  --card-watermark: url("../assets/botanical-paper-r1.svg") !important;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-art-variant="teal"] {
  --card-texture: url("../assets/gold-scale-open.png") !important;
}
@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
    background-size: 100% 10px, 100% 10px, 10px 100%, 10px 100% !important;
  }
}

/* CARD-MATERIAL-B006 finance: the functional tabs use generic panel classes,
   so their top-level work surfaces must be explicitly owned by the finance
   material system instead of inheriting the legacy pale gradient. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] .panel[data-art-frame-owner="true"] {
  --card-frame-top: url("../assets/ornate-frame-top-tight.png");
  --card-frame-bottom: url("../assets/ornate-frame-bottom-tight.png");
  --card-frame-left: url("../assets/ornate-frame-side-tight.png");
  --card-frame-right: url("../assets/ornate-frame-side-mirror-tight.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] [data-art-frame-owner="true"][data-art-tier="nested"] {
  --finance-nested-paper: rgba(255, 252, 241, .9);
  --finance-nested-edge: rgba(157, 109, 39, .48);
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  border: 1px solid var(--finance-nested-edge) !important;
  border-radius: 4px !important;
  background:
    linear-gradient(135deg, var(--finance-nested-paper), rgba(225, 211, 170, .62)),
    var(--card-texture) center / 88px 88px repeat !important;
  background-blend-mode: normal, multiply !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 253, 237, .86),
    inset 0 0 0 4px rgba(157, 109, 39, .16),
    0 4px 10px rgba(55, 39, 16, .09) !important;
}

/* Deliberate material variation within finance keeps the page from becoming
   a repeated card grid while preserving one restrained hierarchy. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] :is(.finance-chart-range-actions, .finance-budget-signals)[data-art-frame-owner="true"] {
  --card-texture: url("../assets/gold-scale-open.png");
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] :is(.asset-reference-card, .finance-trend-panel)[data-art-frame-owner="true"] {
  --card-texture: url("../assets/cloth-alike-open.png");
  --finance-nested-paper: rgba(247, 239, 213, .9);
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] :is(.finance-day-list, .finance-chart-reading-list, .budget-list)[data-art-frame-owner="true"] {
  --card-texture: url("../assets/lyonnette-open.png");
  --finance-nested-paper: rgba(244, 240, 221, .92);
}

/* CARD-MATERIAL-B006: restore the ornate owner on the remaining overview
   action card after the legacy overview-canvas gradient wins the cascade. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]) > .panel.overview-action-panel[data-art-frame-owner="true"][data-art-variant] {
  --card-art-paper: rgba(226, 239, 230, .9);
  --card-texture: url("../assets/gold-scale-open.png");
  --card-watermark: url("../assets/botanical-paper-r1.svg");
  background-color: var(--card-art-paper) !important;
  background-image: linear-gradient(135deg, var(--card-art-paper), rgba(224, 210, 167, .58)), var(--card-texture), var(--card-watermark) !important;
  background-position: center, center, right 16px top 16px !important;
  background-size: auto, 124px 124px, 156px 156px !important;
  background-repeat: no-repeat, repeat, no-repeat !important;
  background-blend-mode: normal, multiply, normal !important;
  border: 1px solid rgba(157, 109, 39, .62) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 237, .84), inset 0 0 0 5px rgba(157, 109, 39, .13), 0 8px 18px rgba(55, 39, 16, .12) !important;
}

/* Nested metric cards use the same material vocabulary without a second full
   rail, keeping the hierarchy readable on dense operational panels. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] :is(.reminder-v2-stat, .settings-panel .kpi, .settings-panel-heading + .kpis .kpi)[data-art-frame-owner="true"] {
  border: 1px solid rgba(157, 109, 39, .48) !important;
  background-image: linear-gradient(135deg, rgba(255, 252, 241, .86), rgba(225, 211, 170, .62)), var(--card-texture) !important;
  background-size: auto, 96px 96px !important;
  background-repeat: no-repeat, repeat !important;
  background-blend-mode: normal, multiply !important;
}

/* CARD-MATERIAL-R58: the overview canvas has a higher-specificity legacy
   gradient rule. Reassert the material surface after that rule so every
   visible information panel keeps its own texture and inset ornament. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]) > .panel[data-card-material="true"] {
  --card-material-paper: rgba(224, 239, 228, .82);
  --card-material-edge: rgba(36, 100, 88, .5);
  --card-material-texture: url("../assets/lyonnette-open.png");
  background-color: var(--card-material-paper) !important;
  background-image: linear-gradient(135deg, rgba(255, 255, 248, .68), rgba(214, 194, 140, .3)), var(--card-material-texture) !important;
  background-position: center, center !important;
  background-size: auto, 118px 118px !important;
  background-repeat: no-repeat, repeat !important;
  background-blend-mode: normal, multiply !important;
  border: 1px solid var(--card-material-edge) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 241, .82), inset 0 0 0 5px rgba(157, 109, 39, .14), 0 7px 16px rgba(52, 39, 22, .1) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]) > .panel[data-card-material="true"]::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 7px !important;
  z-index: 1 !important;
  pointer-events: none !important;
  border: 1px solid rgba(157, 109, 39, .28) !important;
  border-radius: 3px !important;
  background: linear-gradient(var(--card-art-gold), var(--card-art-gold)) top left / 30px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top left / 1px 30px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top right / 30px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top right / 1px 30px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom left / 30px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom left / 1px 30px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom right / 30px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom right / 1px 30px no-repeat !important;
  opacity: .78;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]) > .panel[data-card-material="true"]::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 14px !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background: var(--card-watermark) right 8px top 8px / 96px 96px no-repeat !important;
  opacity: .28;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-overview-canvas-widget]:not([data-overview-canvas-widget="focus"]) > .panel[data-card-material="true"] > * {
  position: relative;
  z-index: 2;
}

/* R57 sourced texture accents: letter-free textile, scale, floral and fine
   geometric patterns are assigned to different semantic modules. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/lyonnette-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/gold-scale-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="people"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/flower-trail-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="reminders"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/cloth-alike-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="knowledge"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/lyonnette-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/cloth-alike-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/gold-scale-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] .panel[data-card-material="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .panel[data-card-material="true"] { --card-material-texture: url("../assets/lyonnette-open.png"); }

/* The light material treatment needs dark operational text on hero cards. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="hero"] :is(h1,h2,h3,h4,p,span,strong,a,button) { color: #17383b !important; }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] [data-art-frame-owner="true"][data-art-tier="hero"] :is(h1,h2,h3,h4,p,span,strong,a,button) { color: #17383b !important; }

@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel[data-card-material="true"] { background-size: auto, 92px 92px !important; box-shadow: inset 0 0 0 2px rgba(255, 253, 241, .7), 0 5px 12px rgba(52, 39, 22, .09) !important; }
}

/* The legacy panel reset has the same structural specificity; this panel
   override restores the material surface after that reset without touching
   frame-owner rails. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel[data-card-material="true"] {
  --card-material-paper: rgba(248, 244, 226, .9);
  --card-material-edge: rgba(157, 109, 39, .36);
  --card-material-texture: url("../assets/paper-fibers-open.png");
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  border: 1px solid var(--card-material-edge) !important;
  border-radius: 5px !important;
  background: linear-gradient(135deg, var(--card-material-paper), rgba(226, 215, 181, .68)), var(--card-material-texture) center / 118px 118px repeat !important;
  background-blend-mode: normal, multiply !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 241, .76), inset 0 0 22px rgba(136, 94, 34, .08), 0 7px 16px rgba(52, 39, 22, .1) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(224, 239, 228, .9);
  --card-material-edge: rgba(36, 100, 88, .42);
--card-material-texture: url("../assets/gold-scale-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(249, 242, 218, .92);
  --card-material-edge: rgba(163, 111, 33, .42);
  --card-material-texture: url("../assets/paper-fibers-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="people"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(255, 243, 239, .92);
  --card-material-edge: rgba(151, 91, 73, .4);
  --card-material-texture: url("../assets/linen-gold.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="reminders"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(243, 239, 218, .92);
  --card-material-edge: rgba(132, 101, 45, .42);
  --card-material-texture: url("../assets/arabesque-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="knowledge"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(247, 239, 213, .92);
  --card-material-edge: rgba(134, 94, 32, .4);
  --card-material-texture: url("../assets/paper-grid.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(239, 240, 221, .92);
  --card-material-edge: rgba(67, 101, 88, .42);
  --card-material-texture: url("../assets/arabesque-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(228, 241, 229, .92);
  --card-material-edge: rgba(42, 105, 90, .42);
  --card-material-texture: url("../assets/paper-grid.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] .panel[data-card-material="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .panel[data-card-material="true"] {
  --card-material-paper: rgba(236, 238, 220, .92);
  --card-material-edge: rgba(55, 91, 81, .42);
  --card-material-texture: url("../assets/black-linen-open.png");
}

@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel[data-card-material="true"] {
    background-size: auto, 92px 92px !important;
    box-shadow: inset 0 0 0 2px rgba(255, 253, 241, .7), 0 5px 12px rgba(52, 39, 22, .09) !important;
  }
}

/* CARD-MATERIAL-R063: final visible boundary and non-letter texture contract.
   The legacy visual-upgrade layer once painted a literal logo texture. Keep one crisp boundary per card and move ornate
   rails one pixel inward so the edge belongs to the card, never its contents. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"] {
  box-sizing: border-box !important;
  border: 1px solid rgba(157, 109, 39, .72) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
  inset: 1px !important;
  background-size: 100% 13px, 100% 13px, 13px 100%, 13px 100% !important;
  border-radius: inherit;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="metric"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="nested"] {
  border-color: rgba(157, 109, 39, .58) !important;
}

/* Replace every legacy logo-bearing texture, including cards that are not
   currently selected by the JS owner pass. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .ai-workbench,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] .panel[data-art-frame-owner="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .panel[data-card-material="true"] {
  --card-texture: url("../assets/black-linen-open.png") !important;
  --card-watermark: url("../assets/botanical-paper-r1.svg") !important;
  background-image: linear-gradient(135deg, var(--card-art-paper, rgba(241, 239, 222, .97)), rgba(224, 210, 167, .58)), url("../assets/black-linen-open.png"), url("../assets/botanical-paper-r1.svg") !important;
  background-position: center, center, right 16px top 16px !important;
  background-size: auto, 124px 124px, 156px 156px !important;
  background-repeat: no-repeat, repeat, no-repeat !important;
  background-blend-mode: normal, multiply, normal !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-variant="damask"] {
  --card-texture: url("../assets/arches-open.png") !important;
  --card-watermark: url("../assets/botanical-paper-r1.svg") !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-art-variant="teal"] {
  --card-texture: url("../assets/gold-scale-open.png") !important;
}

@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
    background-size: 100% 10px, 100% 10px, 10px 100%, 10px 100% !important;
  }
}

/* R063 final cascade: this block intentionally remains last in the file so
   legacy panel resets cannot erase the visible card boundary. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"] {
  box-sizing: border-box !important;
  border: 1px solid rgba(157, 109, 39, .72) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
  inset: 1px !important;
  background-size: 100% 13px, 100% 13px, 13px 100%, 13px 100% !important;
  border-radius: inherit;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="metric"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="nested"] {
  border-color: rgba(157, 109, 39, .58) !important;
}

/* No card may load the legacy logo artwork. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .ai-workbench,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] .panel[data-art-frame-owner="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .panel[data-card-material="true"] {
  --card-texture: url("../assets/black-linen-open.png") !important;
  --card-watermark: url("../assets/botanical-paper-r1.svg") !important;
  background-image: linear-gradient(135deg, var(--card-art-paper, rgba(241, 239, 222, .97)), rgba(224, 210, 167, .58)), url("../assets/black-linen-open.png"), url("../assets/botanical-paper-r1.svg") !important;
  background-position: center, center, right 16px top 16px !important;
  background-size: auto, 124px 124px, 156px 156px !important;
  background-repeat: no-repeat, repeat, no-repeat !important;
  background-blend-mode: normal, multiply, normal !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-variant="damask"] {
  --card-texture: url("../assets/arches-open.png") !important;
  --card-watermark: url("../assets/botanical-paper-r1.svg") !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-art-variant="teal"] {
  --card-texture: url("../assets/gold-scale-open.png") !important;
}

@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
    background-size: 100% 10px, 100% 10px, 10px 100%, 10px 100% !important;
  }
}

/* R33 cascade boundary: neutralize the old full-panel frame selectors that load before this layer. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel:not(.tab-panel-hidden)::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel:not(.tab-panel-hidden)::after,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .module-canvas-widget > .panel:not(.overview-command-deck)::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .overview-canvas-widget > .panel:not(.overview-command-deck)::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .overview-canvas-widget::before {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Old finance KPI/list ornament backgrounds are decorative container layers, not card content. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] :is(.finance-overview-kpis, .asset-workbench-v2 .asset-balance-kpis, .finance-chart-kpis, .finance-overview-ledger-list, .finance-overview-anomaly-list, .finance-overview-asset-list) {
  background-image: none !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .finance-overview-ledger-list::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .finance-overview-anomaly-list::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .finance-overview-asset-list::before {
  content: none !important;
  display: none !important;
  background: none !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel:not([data-art-frame-owner]) .list:not([data-art-frame-owner])::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel:not([data-art-frame-owner]) .list:not([data-art-frame-owner])::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* Layout panels are not frame owners; their old inset shadows were the outer rails seen in the screenshot. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel:not([data-art-frame-owner]) {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Restore the sole frame owner after the legacy panel reset above. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background: var(--card-frame-top) top center / 100% 14px no-repeat,
    var(--card-frame-bottom) bottom center / 100% 14px no-repeat,
    var(--card-frame-left) center left / 14px 100% no-repeat,
    var(--card-frame-right) center right / 14px 100% no-repeat !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:is([data-art-tier="metric"], [data-art-tier="nested"])::before {
  content: none !important;
  display: none !important;
  background: none !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel:not(.tab-panel-hidden)[data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background: var(--card-frame-top) top center / 100% 14px no-repeat,
    var(--card-frame-bottom) bottom center / 100% 14px no-repeat,
    var(--card-frame-left) center left / 14px 100% no-repeat,
    var(--card-frame-right) center right / 14px 100% no-repeat !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]:not([data-art-tier="metric"]):not([data-art-tier="nested"])::after {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 7px !important;
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: .9;
  background:
    var(--card-watermark) right 10px top 10px / 132px 132px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top left / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top left / 1px 34px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top right / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) top right / 1px 34px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom left / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom left / 1px 34px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom right / 34px 1px no-repeat,
    linear-gradient(var(--card-art-gold), var(--card-art-gold)) bottom right / 1px 34px no-repeat !important;
}

/* Final material boundary: win the older card-system cascade without adding
   another rail owner. Texture and watermark stay behind content. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-variant] {
  background:
    linear-gradient(135deg, var(--card-art-paper), rgba(224, 210, 167, .58)) center / auto no-repeat,
    var(--card-texture) center / 124px 124px repeat,
    var(--card-watermark) right 16px top 16px / 156px 156px no-repeat !important;
  background-blend-mode: normal, multiply, normal !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-variant]:is([data-art-tier="metric"], [data-art-tier="nested"]) {
  background:
    linear-gradient(135deg, rgba(255, 252, 241, .86), rgba(225, 211, 170, .62)),
    var(--card-texture) center / 96px 96px repeat !important;
  background-blend-mode: normal, multiply !important;
}

/* CARD-MATERIAL-R50: give unframed information cards a real material surface
   without creating another ornate rail owner. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-card-material="true"] {
  --card-material-paper: rgba(248, 244, 226, .9);
  --card-material-edge: rgba(157, 109, 39, .36);
  --card-material-texture: url("../assets/paper-fibers-open.png");
  position: relative !important;
  isolation: isolate;
  overflow: hidden !important;
  border: 1px solid var(--card-material-edge) !important;
  border-radius: 5px !important;
  background:
    linear-gradient(135deg, var(--card-material-paper), rgba(226, 215, 181, .68)),
    var(--card-material-texture) center / 118px 118px repeat !important;
  background-blend-mode: normal, multiply !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 253, 241, .76),
    inset 0 0 22px rgba(136, 94, 34, .08),
    0 7px 16px rgba(52, 39, 22, .1) !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] [data-card-material="true"] {
  --card-material-paper: rgba(224, 239, 228, .9);
  --card-material-edge: rgba(36, 100, 88, .42);
  --card-material-texture: url("../assets/gold-damask.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] [data-card-material="true"] {
  --card-material-paper: rgba(249, 242, 218, .92);
  --card-material-edge: rgba(163, 111, 33, .42);
  --card-material-texture: url("../assets/paper-fibers-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="people"] [data-card-material="true"] {
  --card-material-paper: rgba(255, 243, 239, .92);
  --card-material-edge: rgba(151, 91, 73, .4);
  --card-material-texture: url("../assets/linen-gold.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="reminders"] [data-card-material="true"] {
  --card-material-paper: rgba(243, 239, 218, .92);
  --card-material-edge: rgba(132, 101, 45, .42);
  --card-material-texture: url("../assets/arabesque-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="knowledge"] [data-card-material="true"] {
  --card-material-paper: rgba(247, 239, 213, .92);
  --card-material-edge: rgba(134, 94, 32, .4);
  --card-material-texture: url("../assets/paper-grid.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] [data-card-material="true"] {
  --card-material-paper: rgba(239, 240, 221, .92);
  --card-material-edge: rgba(67, 101, 88, .42);
  --card-material-texture: url("../assets/arabesque-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] [data-card-material="true"] {
  --card-material-paper: rgba(228, 241, 229, .92);
  --card-material-edge: rgba(42, 105, 90, .42);
  --card-material-texture: url("../assets/paper-grid.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] [data-card-material="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] [data-card-material="true"] {
  --card-material-paper: rgba(236, 238, 220, .92);
  --card-material-edge: rgba(55, 91, 81, .42);
  --card-material-texture: url("../assets/black-linen-open.png");
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-card-material="true"] > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-card-material="true"] {
    background-size: auto, 92px 92px !important;
    box-shadow: inset 0 0 0 2px rgba(255, 253, 241, .7), 0 5px 12px rgba(52, 39, 22, .09) !important;
  }
}

/* Last-word panel material override: this intentionally follows the legacy
   transparent-panel reset in the same stylesheet. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] .panel[data-card-material="true"] {
  --card-material-paper: rgba(248, 244, 226, .9);
  --card-material-edge: rgba(157, 109, 39, .36);
  --card-material-texture: url("../assets/paper-fibers-open.png");
  background: linear-gradient(135deg, var(--card-material-paper), rgba(226, 215, 181, .68)), var(--card-material-texture) center / 118px 118px repeat !important;
  background-blend-mode: normal, multiply !important;
  border: 1px solid var(--card-material-edge) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 253, 241, .76), inset 0 0 22px rgba(136, 94, 34, .08), 0 7px 16px rgba(52, 39, 22, .1) !important;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="overview"] .panel[data-card-material="true"] { --card-material-paper: rgba(224, 239, 228, .9); --card-material-edge: rgba(36, 100, 88, .42); --card-material-texture: url("../assets/gold-scale-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="finance"] .panel[data-card-material="true"] { --card-material-paper: rgba(249, 242, 218, .92); --card-material-edge: rgba(163, 111, 33, .42); --card-material-texture: url("../assets/paper-fibers-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="people"] .panel[data-card-material="true"] { --card-material-paper: rgba(255, 243, 239, .92); --card-material-edge: rgba(151, 91, 73, .4); --card-material-texture: url("../assets/linen-gold.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="reminders"] .panel[data-card-material="true"] { --card-material-paper: rgba(243, 239, 218, .92); --card-material-edge: rgba(132, 101, 45, .42); --card-material-texture: url("../assets/arabesque-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="knowledge"] .panel[data-card-material="true"] { --card-material-paper: rgba(247, 239, 213, .92); --card-material-edge: rgba(134, 94, 32, .4); --card-material-texture: url("../assets/paper-grid.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="vault"] .panel[data-card-material="true"] { --card-material-paper: rgba(239, 240, 221, .92); --card-material-edge: rgba(67, 101, 88, .42); --card-material-texture: url("../assets/arabesque-open.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="items"] .panel[data-card-material="true"] { --card-material-paper: rgba(228, 241, 229, .92); --card-material-edge: rgba(42, 105, 90, .42); --card-material-texture: url("../assets/paper-grid.png"); }
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="settings"] .panel[data-card-material="true"],
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view="ai-workbench"] .panel[data-card-material="true"] { --card-material-paper: rgba(236, 238, 220, .92); --card-material-edge: rgba(55, 91, 81, .42); --card-material-texture: url("../assets/black-linen-open.png"); }
