/* R063 tail layer. Loaded after every legacy art stylesheet so one boundary
   owner remains visible and logo-bearing textures cannot return. */
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] .panel[data-art-frame-owner="true"]:not(.tab-panel-hidden) {
  border: 1px solid rgba(157, 109, 39, .72) !important;
  border-image: none !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;
  }
}

/* R065 final cascade position: keep the overscan rule after all R064
   pseudo-element restores so no earlier block can shrink the artwork back. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]::before {
  background-position: center top, center bottom, left center, right center !important;
  background-size: 104% 16px, 104% 16px, 16px 102%, 16px 102% !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 {
  background-size: 104% 12px, 104% 12px, 12px 102%, 12px 102% !important;
  opacity: .94 !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"]::before {
    background-size: 104% 13px, 104% 13px, 13px 102%, 13px 102% !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 {
    background-size: 104% 10px, 104% 10px, 10px 102%, 10px 102% !important;
  }
}

/* R067 final cascade: the production shell may omit data-active-view. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar,
  [data-command-recycle="true"] > .panel > h3
) {
  color: #f7faf5 !important;
  -webkit-text-fill-color: #f7faf5 !important;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar
) :is(h2, h3, h4, p, span, strong, small, label, a, button, i, svg) {
  color: #f7faf5 !important;
  -webkit-text-fill-color: #f7faf5 !important;
}
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar
) :is(.mini-action, button, a) {
  background: rgb(255 255 255 / 12%) !important;
  border-color: rgb(255 255 255 / 34%) !important;
  color: #f7faf5 !important;
  -webkit-text-fill-color: #f7faf5 !important;
}

/* R066 contrast repair: dark teal title/action bands must own a light
   foreground. Earlier visual layers restored the dark background after the
   module-specific ink variables, leaving labels and controls unreadable. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar,
  [data-command-recycle="true"] > .panel > h3
) {
  color: #f7faf5 !important;
  -webkit-text-fill-color: #f7faf5 !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar
) :is(h2, h3, h4, p, span, strong, small, label, a, button, i, svg) {
  color: #f7faf5 !important;
  -webkit-text-fill-color: #f7faf5 !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar
) :is(.mini-action, button, a) {
  background: rgb(255 255 255 / 12%) !important;
  border-color: rgb(255 255 255 / 34%) !important;
  color: #f7faf5 !important;
  -webkit-text-fill-color: #f7faf5 !important;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar
) :is(.mini-action, button, a):hover,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] :is(
  [data-items-v2="true"] .items-v2__header,
  [data-reminders-v2] .reminder-v2-overview-head,
  .knowledge-v2__command-bar
) :is(.mini-action, button, a):focus-visible {
  background: rgb(255 255 255 / 22%) !important;
  border-color: rgb(255 255 255 / 58%) !important;
  color: #fffdf4 !important;
  -webkit-text-fill-color: #fffdf4 !important;
}

/* R065 edge coverage: the horizontal source has about 2% transparent space
   at its right edge. Overscan and center-crop the rails so wide cards remain
   fully enclosed on all four sides. */
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,
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 {
  background-position: center top, center bottom, left center, right center !important;
  background-size: 104% 16px, 104% 16px, 16px 102%, 16px 102% !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 {
  background-position: center top, center bottom, left center, right center !important;
  background-size: 104% 12px, 104% 12px, 12px 102%, 12px 102% !important;
  opacity: .94 !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,
  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 {
    background-size: 104% 13px, 104% 13px, 13px 102%, 13px 102% !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 {
    background-size: 104% 10px, 104% 10px, 10px 102%, 10px 102% !important;
  }
}

/* R064 visible material mount: the legacy cascade hid frame artwork on
   metric/nested cards, leaving only a faint 1px rule in the live page. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background-image: var(--card-frame-top), var(--card-frame-bottom), var(--card-frame-left), var(--card-frame-right) !important;
  background-position: top center, bottom center, left center, right center !important;
  background-size: 100% 16px, 100% 16px, 16px 100%, 16px 100% !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: inherit !important;
}

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

/* Metrics and nested cards use the same artwork at a quieter scale so the
   material reads as a mounted boundary without covering labels or icons. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="metric"]::before,
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="nested"]::before {
  background-size: 100% 10px, 100% 10px, 10px 100%, 10px 100% !important;
  opacity: .88 !important;
}

/* Match the older :is(metric,nested) selector's specificity; otherwise its
   content:none rule wins even though this file loads last. */
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: "" !important;
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  background-image: var(--card-frame-top), var(--card-frame-bottom), var(--card-frame-left), var(--card-frame-right) !important;
  background-position: top center, bottom center, left center, right center !important;
  background-size: 100% 10px, 100% 10px, 10px 100%, 10px 100% !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: inherit !important;
  opacity: .88 !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"]::before {
    background-size: 100% 12px, 100% 12px, 12px 100%, 12px 100% !important;
  }
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="metric"]::before,
  html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"][data-art-tier="nested"]::before {
    background-size: 100% 8px, 100% 8px, 8px 100%, 8px 100% !important;
  }
}

/* R065 final cascade override. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) #moduleStage[data-active-view] [data-art-frame-owner="true"]::before {
  background-position: center top, center bottom, left center, right center !important;
  background-size: 104% 16px, 104% 16px, 16px 102%, 16px 102% !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 {
  background-size: 104% 12px, 104% 12px, 12px 102%, 12px 102% !important;
  opacity: .94 !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"]::before {
    background-size: 104% 13px, 104% 13px, 13px 102%, 13px 102% !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 {
    background-size: 104% 10px, 104% 10px, 10px 102%, 10px 102% !important;
  }
}
